maven
we now use maven to manage all dependencies and build Project-HomeFlix
@ -4,7 +4,7 @@
|
||||
* connection is in manual commit!
|
||||
*/
|
||||
|
||||
package application;
|
||||
package org.kellerkinder.Project_HomeFlix;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@ -39,8 +39,8 @@ public class DBController {
|
||||
private MainWindowController mainWindowController;
|
||||
private Main main;
|
||||
private String DB_PATH = System.getProperty("user.home") + "\\Documents\\HomeFlix" + "\\" + "Homeflix.db"; //path to database file
|
||||
private Image favorite_black = new Image("resources/icons/ic_favorite_black_18dp_1x.png");
|
||||
private Image favorite_border_black = new Image("resources/icons/ic_favorite_border_black_18dp_1x.png");
|
||||
private Image favorite_black = new Image("icons/ic_favorite_black_18dp_1x.png");
|
||||
private Image favorite_border_black = new Image("icons/ic_favorite_border_black_18dp_1x.png");
|
||||
private List<String> filmsdbAll = new ArrayList<String>();
|
||||
private List<String> filmsdbLocal = new ArrayList<String>();
|
||||
private List<String> filmsdbStream = new ArrayList<String>();
|
@ -20,7 +20,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package application;
|
||||
package org.kellerkinder.Project_HomeFlix;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -67,13 +67,14 @@ public class Main extends Application {
|
||||
private void mainWindow(){
|
||||
|
||||
try {
|
||||
FXMLLoader loader = new FXMLLoader(Main.class.getResource("MainWindow.fxml"));
|
||||
AnchorPane pane = loader.load();
|
||||
FXMLLoader loader = new FXMLLoader();
|
||||
loader.setLocation(ClassLoader.getSystemResource("fxml/MainWindow.fxml"));
|
||||
AnchorPane pane = (AnchorPane) loader.load();
|
||||
primaryStage.setMinHeight(600.00);
|
||||
primaryStage.setMinWidth(900.00);
|
||||
primaryStage.setResizable(false);
|
||||
primaryStage.setTitle("Project HomeFlix");
|
||||
primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/resources/Homeflix_Icon_64x64.png"))); //adds application icon
|
||||
primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/icons/Homeflix_Icon_64x64.png"))); //adds application icon
|
||||
|
||||
mainWindowController = loader.getController(); //Link of FXMLController and controller class
|
||||
mainWindowController.setAutoUpdate(AUTO_UPDATE); //set auto-update
|
||||
@ -128,7 +129,7 @@ public class Main extends Application {
|
||||
mainWindowController.addDataUI();
|
||||
|
||||
Scene scene = new Scene(pane); //create new scene, append pane to scene
|
||||
scene.getStylesheets().add(Main.class.getResource("MainWindow.css").toExternalForm());
|
||||
scene.getStylesheets().add(getClass().getResource("/css/MainWindow.css").toExternalForm());
|
||||
primaryStage.setScene(scene); //append scene to stage
|
||||
primaryStage.show(); //show stage
|
||||
} catch (IOException e) {
|
||||
@ -140,11 +141,11 @@ public class Main extends Application {
|
||||
private String firstStart(){
|
||||
MainWindowController.firststart = true;
|
||||
switch(System.getProperty("user.language")+"_"+System.getProperty("user.country")){
|
||||
case "en_US": bundle = ResourceBundle.getBundle("resources.HomeFlix-Local", Locale.US); //us_english
|
||||
case "en_US": bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US); //us_english
|
||||
break;
|
||||
case "de_DE": bundle = ResourceBundle.getBundle("resources.HomeFlix-Local", Locale.GERMAN); //German
|
||||
case "de_DE": bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.GERMAN); //German
|
||||
break;
|
||||
default: bundle = ResourceBundle.getBundle("resources.HomeFlix-Local", Locale.US); //default local
|
||||
default: bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US); //default local
|
||||
break;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
package application;
|
||||
package org.kellerkinder.Project_HomeFlix;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.io.BufferedReader;
|
||||
@ -249,12 +249,12 @@ public class MainWindowController {
|
||||
ObservableList<tableData> localFilms = FXCollections.observableArrayList();
|
||||
ObservableList<tableData> streamingFilms = FXCollections.observableArrayList();
|
||||
ObservableList<tableData> streamingData = FXCollections.observableArrayList();
|
||||
private ImageView skip_previous_white = new ImageView(new Image("resources/icons/ic_skip_previous_white_18dp_1x.png"));
|
||||
private ImageView skip_previous_black = new ImageView(new Image("resources/icons/ic_skip_previous_black_18dp_1x.png"));
|
||||
private ImageView skip_next_white = new ImageView(new Image("resources/icons/ic_skip_next_white_18dp_1x.png"));
|
||||
private ImageView skip_next_black = new ImageView(new Image("resources/icons/ic_skip_next_black_18dp_1x.png"));
|
||||
private ImageView play_arrow_white = new ImageView(new Image("resources/icons/ic_play_arrow_white_18dp_1x.png"));
|
||||
private ImageView play_arrow_black = new ImageView(new Image("resources/icons/ic_play_arrow_black_18dp_1x.png"));
|
||||
private ImageView skip_previous_white = new ImageView(new Image("icons/ic_skip_previous_white_18dp_1x.png"));
|
||||
private ImageView skip_previous_black = new ImageView(new Image("icons/ic_skip_previous_black_18dp_1x.png"));
|
||||
private ImageView skip_next_white = new ImageView(new Image("icons/ic_skip_next_white_18dp_1x.png"));
|
||||
private ImageView skip_next_black = new ImageView(new Image("icons/ic_skip_next_black_18dp_1x.png"));
|
||||
private ImageView play_arrow_white = new ImageView(new Image("icons/ic_play_arrow_white_18dp_1x.png"));
|
||||
private ImageView play_arrow_black = new ImageView(new Image("icons/ic_play_arrow_black_18dp_1x.png"));
|
||||
private DirectoryChooser directoryChooser = new DirectoryChooser();
|
||||
private MenuItem like = new MenuItem("like");
|
||||
private MenuItem dislike = new MenuItem("dislike"); //TODO one option (like or dislike)
|
||||
@ -636,7 +636,8 @@ public class MainWindowController {
|
||||
});
|
||||
|
||||
cbLocal.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
|
||||
public void changed(ObservableValue<? extends Number> ov, Number value, Number new_value) {
|
||||
@Override
|
||||
public void changed(ObservableValue<? extends Number> ov, Number value, Number new_value) {
|
||||
String local = cbLocal.getItems().get((int) new_value).toString();
|
||||
local = local.substring(local.length()-6,local.length()-1); //reading only en_US from English (en_US)
|
||||
setLocal(local);
|
||||
@ -937,15 +938,15 @@ public class MainWindowController {
|
||||
void setLocalUI(){
|
||||
switch(getLocal()){
|
||||
case "en_US":
|
||||
bundle = ResourceBundle.getBundle("resources.HomeFlix-Local", Locale.US); //us_English
|
||||
bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US); //us_English
|
||||
cbLocal.getSelectionModel().select(0);
|
||||
break;
|
||||
case "de_DE":
|
||||
bundle = ResourceBundle.getBundle("resources.HomeFlix-Local", Locale.GERMAN); //German
|
||||
bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.GERMAN); //German
|
||||
cbLocal.getSelectionModel().select(1);
|
||||
break;
|
||||
default:
|
||||
bundle = ResourceBundle.getBundle("resources.HomeFlix-Local", Locale.US); //default local
|
||||
bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US); //default local
|
||||
cbLocal.getSelectionModel().select(0);
|
||||
break;
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
* apiQuery for Project HomeFlix
|
||||
* sends a query to the omdb api
|
||||
*/
|
||||
package application;
|
||||
package org.kellerkinder.Project_HomeFlix;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
@ -1,4 +1,4 @@
|
||||
package application;
|
||||
package org.kellerkinder.Project_HomeFlix;
|
||||
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.DoubleProperty;
|
@ -2,7 +2,7 @@
|
||||
* updater for Project HomeFlix
|
||||
* checks for Updates and downloads it in case there is one
|
||||
*/
|
||||
package application;
|
||||
package org.kellerkinder.Project_HomeFlix;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
@ -20,7 +20,7 @@
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import javafx.scene.text.TextFlow?>
|
||||
|
||||
<AnchorPane fx:id="anpane" prefHeight="600.0" prefWidth="950.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainWindowController">
|
||||
<AnchorPane fx:id="anpane" prefHeight="600.0" prefWidth="950.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.kellerkinder.Project_HomeFlix.MainWindowController">
|
||||
<children>
|
||||
<ScrollPane fx:id="scrollPane" fitToWidth="true" layoutX="408.0" layoutY="44.0" prefHeight="544.0" prefWidth="320.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="408.0" AnchorPane.rightAnchor="222.0" AnchorPane.topAnchor="44.0">
|
||||
<content>
|
||||
@ -42,7 +42,7 @@
|
||||
</font></JFXTextField>
|
||||
<ImageView fx:id="image1" fitHeight="297.0" fitWidth="198.0" layoutX="481.0" layoutY="46.0" pickOnBounds="true" preserveRatio="true" AnchorPane.rightAnchor="12.0" AnchorPane.topAnchor="44.0">
|
||||
<image>
|
||||
<Image url="@../resources/Homeflix_Poster.png" />
|
||||
<Image url="@../icons/Homeflix_Poster.png" />
|
||||
</image></ImageView>
|
||||
<JFXButton fx:id="returnBtn" contentDisplay="CENTER" layoutX="690.0" layoutY="443.0" onAction="#returnBtnclicked" prefHeight="25.0" prefWidth="90.0" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="120.0" />
|
||||
<JFXButton fx:id="forwardBtn" contentDisplay="CENTER" layoutX="798.0" layoutY="443.0" onAction="#forwardBtnclicked" prefHeight="25.0" prefWidth="90.0" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="12.0" />
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 135 B |
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 128 B |
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
38
src/test/java/org/kellerkinder/Project_HomeFlix/AppTest.java
Normal file
@ -0,0 +1,38 @@
|
||||
package org.kellerkinder.Project_HomeFlix;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|