Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
fa252a916c | |||
4d57bdbdff | |||
d0be4f88b0 | |||
cf1350033f |
@ -4,8 +4,9 @@ Project HomeFlix is a Kellerkinder Project. HomeFlix is a Programm that alowes y
|
|||||||
saved movies in clean UI.
|
saved movies in clean UI.
|
||||||
|
|
||||||
Librarys used in this Project:
|
Librarys used in this Project:
|
||||||
JFoenix https://github.com/jfoenixadmin/JFoenix
|
JFoenix: https://github.com/jfoenixadmin/JFoenix
|
||||||
minimal-json https://github.com/ralfstx/minimal-json
|
minimal-json: https://github.com/ralfstx/minimal-json
|
||||||
|
Commons Lang: https://commons.apache.org/proper/commons-lang/
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/application/MainWindowController$7$1.class
Normal file
BIN
bin/application/MainWindowController$7$1.class
Normal file
Binary file not shown.
BIN
bin/application/MainWindowController$7.class
Normal file
BIN
bin/application/MainWindowController$7.class
Normal file
Binary file not shown.
BIN
bin/application/MainWindowController$8.class
Normal file
BIN
bin/application/MainWindowController$8.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/application/streamUiData.class
Normal file
BIN
bin/application/streamUiData.class
Normal file
Binary file not shown.
@ -44,10 +44,14 @@ public class Main extends Application {
|
|||||||
|
|
||||||
public Stage primaryStage;
|
public Stage primaryStage;
|
||||||
private String path;
|
private String path;
|
||||||
|
private String streamingPath = System.getProperty("user.home") + "\\Documents\\HomeFlix";
|
||||||
private String color = "ee3523";
|
private String color = "ee3523";
|
||||||
private String autoUpdate = "0";
|
private String autoUpdate = "0";
|
||||||
|
private String mode = "local"; //local or streaming
|
||||||
private double size = 12;
|
private double size = 12;
|
||||||
private int local = 0;
|
private int local = 0;
|
||||||
|
private File dir = new File(System.getProperty("user.home") + "/Documents/HomeFlix"); //Windows: C:/Users/"User"/Documents/HomeFlix OSX: has to be tested Linux: has to be tested(shalt not work!)
|
||||||
|
private File file = new File(dir + "/config.xml"); //Windows: C:/Users/"User"/Documents/HomeFlix/config.xml OSX: has to be tested Linux: has to be tested(shalt not work!)
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
private MainWindowController mainWindowController;
|
private MainWindowController mainWindowController;
|
||||||
|
|
||||||
@ -58,7 +62,7 @@ public class Main extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void mainWindow(){
|
public void mainWindow(){
|
||||||
File file = new File("config.xml");
|
|
||||||
try {
|
try {
|
||||||
FXMLLoader loader = new FXMLLoader(Main.class.getResource("MainWindow.fxml"));
|
FXMLLoader loader = new FXMLLoader(Main.class.getResource("MainWindow.fxml"));
|
||||||
AnchorPane pane = loader.load();
|
AnchorPane pane = loader.load();
|
||||||
@ -68,29 +72,45 @@ public class Main extends Application {
|
|||||||
primaryStage.setTitle("Project HomeFlix");
|
primaryStage.setTitle("Project HomeFlix");
|
||||||
primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/recources/Homeflix_Icon_64x64.png"))); //f<>gt Anwendungsicon hinzu
|
primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/recources/Homeflix_Icon_64x64.png"))); //f<>gt Anwendungsicon hinzu
|
||||||
|
|
||||||
|
|
||||||
mainWindowController = loader.getController(); //verkn<6B>pfung von FXMLController und Controller Klasse
|
mainWindowController = loader.getController(); //verkn<6B>pfung von FXMLController und Controller Klasse
|
||||||
mainWindowController.setAutoUpdate(autoUpdate); //setzt autoupdate
|
mainWindowController.setAutoUpdate(autoUpdate); //setzt autoupdate
|
||||||
mainWindowController.setMain(this); //aufruf setMain
|
mainWindowController.setMain(this); //aufruf setMain
|
||||||
|
|
||||||
//pr<EFBFBD>ft ob config.xml vorhanden, wenn nicht hole Pfad und schreibe Daten in Controller
|
//dir exists -> check config.xml TODO nur Windows getestet siehe dir und file
|
||||||
|
if(dir.exists() == true){
|
||||||
if (file.exists() != true) {
|
if (file.exists() != true) {
|
||||||
mainWindowController.setPath(firstStart());
|
mainWindowController.setPath(firstStart());
|
||||||
|
mainWindowController.setStreamingPath(streamingPath);
|
||||||
mainWindowController.setColor(color);
|
mainWindowController.setColor(color);
|
||||||
mainWindowController.setSize(size);
|
mainWindowController.setSize(size);
|
||||||
mainWindowController.setAutoUpdate(autoUpdate);
|
mainWindowController.setAutoUpdate(autoUpdate);
|
||||||
mainWindowController.setLoaclUI(local);
|
mainWindowController.setLoaclUI(local);
|
||||||
|
mainWindowController.setMode(mode);
|
||||||
mainWindowController.saveSettings();
|
mainWindowController.saveSettings();
|
||||||
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu um Bugs zu verhindern
|
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu um Bugs zu verhindern
|
||||||
System.exit(0); //beendet sich selbst
|
System.exit(0); //beendet sich selbst
|
||||||
}else{
|
}else{
|
||||||
loadSettings();
|
loadSettings();
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
dir.mkdir();
|
||||||
|
mainWindowController.setPath(firstStart());
|
||||||
|
mainWindowController.setStreamingPath(streamingPath);
|
||||||
|
mainWindowController.setColor(color);
|
||||||
|
mainWindowController.setSize(size);
|
||||||
|
mainWindowController.setAutoUpdate(autoUpdate);
|
||||||
|
mainWindowController.setLoaclUI(local);
|
||||||
|
mainWindowController.setMode(mode);
|
||||||
|
mainWindowController.saveSettings();
|
||||||
|
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu um Bugs zu verhindern
|
||||||
|
System.exit(0); //beendet sich selbst
|
||||||
|
}
|
||||||
|
mainWindowController.loadStreamingSettings();
|
||||||
mainWindowController.applyColor(); //setzt die Theme Farbe
|
mainWindowController.applyColor(); //setzt die Theme Farbe
|
||||||
mainWindowController.cbLocal.getSelectionModel().select(mainWindowController.getLocal()); //setzt local
|
mainWindowController.cbLocal.getSelectionModel().select(mainWindowController.getLocal()); //setzt local
|
||||||
mainWindowController.mainColor.setValue(Color.valueOf(mainWindowController.getColor()));
|
mainWindowController.mainColor.setValue(Color.valueOf(mainWindowController.getColor()));
|
||||||
mainWindowController.loadData(); //l<>d die Daten im Controller
|
mainWindowController.loadData(); //l<>d die Daten im Controller
|
||||||
|
mainWindowController.addDataUI();
|
||||||
|
|
||||||
Scene scene = new Scene(pane); //neue Scen um inhalt der stage anzuzeigen
|
Scene scene = new Scene(pane); //neue Scen um inhalt der stage anzuzeigen
|
||||||
|
|
||||||
@ -124,24 +144,23 @@ public class Main extends Application {
|
|||||||
|
|
||||||
//l<>dt die einstellungen aus der XML
|
//l<>dt die einstellungen aus der XML
|
||||||
public void loadSettings(){
|
public void loadSettings(){
|
||||||
File configFile = new File("config.xml");
|
|
||||||
try {
|
try {
|
||||||
InputStream inputStream = new FileInputStream(configFile);
|
InputStream inputStream = new FileInputStream(file);
|
||||||
props.loadFromXML(inputStream);
|
props.loadFromXML(inputStream);
|
||||||
path = props.getProperty("path");
|
path = props.getProperty("path"); //setzt Propselement in Pfad
|
||||||
|
streamingPath = props.getProperty("streamingPath");
|
||||||
color = props.getProperty("color");
|
color = props.getProperty("color");
|
||||||
autoUpdate = props.getProperty("autoUpdate");
|
|
||||||
size = Double.parseDouble(props.getProperty("size"));
|
size = Double.parseDouble(props.getProperty("size"));
|
||||||
|
autoUpdate = props.getProperty("autoUpdate");
|
||||||
local = Integer.parseInt(props.getProperty("local"));
|
local = Integer.parseInt(props.getProperty("local"));
|
||||||
|
mode = props.getProperty("mode");
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Auto-generated catch block
|
System.out.println("An error has occurred!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
launch(args);
|
launch(args);
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
101
src/application/streamUiData.java
Normal file
101
src/application/streamUiData.java
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
package application;
|
||||||
|
|
||||||
|
import javafx.beans.property.DoubleProperty;
|
||||||
|
import javafx.beans.property.IntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleDoubleProperty;
|
||||||
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
|
public class streamUiData {
|
||||||
|
|
||||||
|
private IntegerProperty year = new SimpleIntegerProperty();
|
||||||
|
private IntegerProperty season = new SimpleIntegerProperty();
|
||||||
|
private DoubleProperty rating = new SimpleDoubleProperty();
|
||||||
|
private StringProperty resolution = new SimpleStringProperty();
|
||||||
|
private StringProperty titel = new SimpleStringProperty();
|
||||||
|
private StringProperty streamUrl = new SimpleStringProperty();
|
||||||
|
|
||||||
|
//uiData ist der Typ der Daten in der TreeTabelView
|
||||||
|
public streamUiData (final int year, final int season, final double rating, final String resolution, final String titel, final String streamUrl) {
|
||||||
|
this.year.set(year);
|
||||||
|
this.season.set(season);
|
||||||
|
this.rating.set(rating);
|
||||||
|
this.resolution.set(resolution);
|
||||||
|
this.titel.set(titel);
|
||||||
|
this.streamUrl.set(streamUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getYear() {
|
||||||
|
return year.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSeason() {
|
||||||
|
return season.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getRating() {
|
||||||
|
return rating.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResolution() {
|
||||||
|
return resolution.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitel() {
|
||||||
|
return titel.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStreamUrl() {
|
||||||
|
return streamUrl.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setYear(int year) {
|
||||||
|
this.year.set(year);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeason(int season) {
|
||||||
|
this.season.set(season);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRating(int rating) {
|
||||||
|
this.rating.set(rating);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResolution(String resolution) {
|
||||||
|
this.resolution.set(resolution);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitel(String titel) {
|
||||||
|
this.titel.set(titel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreamUrl(StringProperty streamUrl) {
|
||||||
|
this.streamUrl = streamUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntegerProperty yearProperty(){
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntegerProperty seasonProperty(){
|
||||||
|
return season;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DoubleProperty ratingProperty(){
|
||||||
|
return rating;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringProperty resolutionProperty(){
|
||||||
|
return resolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringProperty titelProperty(){
|
||||||
|
return titel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringProperty streamUrlProperty(){
|
||||||
|
return streamUrl;
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
@ -1 +1 @@
|
|||||||
0.3.6
|
0.3.7
|
Reference in New Issue
Block a user