code cleanup part 2

This commit is contained in:
Seil0 2016-10-09 18:35:55 +02:00
parent c6a78bb345
commit 9de3e6a3f1
18 changed files with 190 additions and 214 deletions

View File

@ -1,8 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?> <?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXColorPicker?>
<?import com.jfoenix.controls.JFXSlider?>
<?import com.jfoenix.controls.JFXTextArea?> <?import com.jfoenix.controls.JFXTextArea?>
<?import com.jfoenix.controls.JFXTextField?> <?import com.jfoenix.controls.JFXTextField?>
<?import com.jfoenix.controls.JFXToggleButton?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TreeTableView?> <?import javafx.scene.control.TreeTableView?>
<?import javafx.scene.image.Image?> <?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.ImageView?>
@ -38,7 +44,7 @@
<JFXButton fx:id="menubtn" onAction="#menubtnclicked" prefHeight="32.0" prefWidth="32.0" /> <JFXButton fx:id="menubtn" onAction="#menubtnclicked" prefHeight="32.0" prefWidth="32.0" />
</children> </children>
</HBox> </HBox>
<VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="660.0" prefWidth="150.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="34.0"> <VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="660.0" prefWidth="150.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="38.0">
<children> <children>
<JFXButton fx:id="infoBtn" onAction="#infoBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER"> <JFXButton fx:id="infoBtn" onAction="#infoBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
<font> <font>
@ -67,5 +73,25 @@
</JFXButton> </JFXButton>
</children> </children>
</VBox> </VBox>
<AnchorPane fx:id="streamingSettingsAnchor" layoutX="138.0" layoutY="33.0" prefHeight="566.0" prefWidth="760.0" style="-fx-background-color: #FFFFFF;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<children>
<JFXTextField fx:id="tfStreamingPath" layoutX="14.0" layoutY="14.0" onAction="#tfStreamingPathAction" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" />
<JFXButton fx:id="streamingDirectoryBtn" layoutX="263.0" layoutY="2.0" onAction="#streamingDirectoryBtnAction" AnchorPane.leftAnchor="260.0" AnchorPane.topAnchor="5.0" />
<TableView fx:id="tableViewStreamingdata" layoutX="14.0" layoutY="44.0" prefHeight="200.0" prefWidth="300.0" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
</children></AnchorPane>
<AnchorPane fx:id="settingsAnchor" layoutX="160.0" layoutY="44.0" prefHeight="566.0" prefWidth="760.0" style="-fx-background-color: #FFFFFF;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<children>
<JFXTextField fx:id="tfPath" layoutX="14.0" layoutY="14.0" onAction="#tfPathAction" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" />
<JFXButton fx:id="directoryBtn" layoutX="255.0" layoutY="8.0" onAction="#directoryBtnAction" prefHeight="25.0" AnchorPane.leftAnchor="260.0" />
<JFXColorPicker fx:id="mainColor" layoutX="14.0" layoutY="45.0" onAction="#mainColorAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
<Label fx:id="sizelbl" layoutY="73.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="75.0" />
<JFXSlider fx:id="sliderFontSize" layoutX="10.0" layoutY="99.0" max="48.0" min="2.0" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="110.0" />
<ChoiceBox fx:id="cbLocal" layoutX="14.0" layoutY="131.0" prefWidth="150.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="145.0" />
<JFXButton fx:id="updateBtn" layoutX="7.0" layoutY="177.0" onAction="#updateBtnAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="180.0" />
<Label fx:id="aulbl" layoutX="43.0" layoutY="219.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="215.0" />
<JFXToggleButton fx:id="autoupdateBtn" layoutX="19.0" layoutY="215.0" onAction="#autoupdateBtnAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="230.0" />
<Label fx:id="versionlbl" layoutX="29.0" layoutY="297.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="280.0" />
</children>
</AnchorPane>
</children> </children>
</AnchorPane> </AnchorPane>

View File

@ -3,6 +3,7 @@ info = Info
settings = Einstellungen settings = Einstellungen
streamingSettings = Stream Einst. streamingSettings = Stream Einst.
play = play play = play
tfPath = Pfad...
openFolder = Ordner \u00F6ffnen openFolder = Ordner \u00F6ffnen
chooseFolder = Ordner ausw\u00E4hlen chooseFolder = Ordner ausw\u00E4hlen
fontSize = Schriftgr\u00F6\u00DFe: fontSize = Schriftgr\u00F6\u00DFe:

View File

@ -3,6 +3,7 @@ info = Info
settings = Settings settings = Settings
streamingSettings = Stream Settings streamingSettings = Stream Settings
play = play play = play
tfPath = Path...
openFolder = open Folder openFolder = open Folder
chooseFolder = choose Directory chooseFolder = choose Directory
fontSize = font size: fontSize = font size:

View File

@ -1,8 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?> <?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXColorPicker?>
<?import com.jfoenix.controls.JFXSlider?>
<?import com.jfoenix.controls.JFXTextArea?> <?import com.jfoenix.controls.JFXTextArea?>
<?import com.jfoenix.controls.JFXTextField?> <?import com.jfoenix.controls.JFXTextField?>
<?import com.jfoenix.controls.JFXToggleButton?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TreeTableView?> <?import javafx.scene.control.TreeTableView?>
<?import javafx.scene.image.Image?> <?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.ImageView?>
@ -38,7 +44,7 @@
<JFXButton fx:id="menubtn" onAction="#menubtnclicked" prefHeight="32.0" prefWidth="32.0" /> <JFXButton fx:id="menubtn" onAction="#menubtnclicked" prefHeight="32.0" prefWidth="32.0" />
</children> </children>
</HBox> </HBox>
<VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="660.0" prefWidth="150.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="34.0"> <VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="660.0" prefWidth="150.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="38.0">
<children> <children>
<JFXButton fx:id="infoBtn" onAction="#infoBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER"> <JFXButton fx:id="infoBtn" onAction="#infoBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
<font> <font>
@ -67,5 +73,25 @@
</JFXButton> </JFXButton>
</children> </children>
</VBox> </VBox>
<AnchorPane fx:id="streamingSettingsAnchor" layoutX="138.0" layoutY="33.0" prefHeight="566.0" prefWidth="760.0" style="-fx-background-color: #FFFFFF;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<children>
<JFXTextField fx:id="tfStreamingPath" layoutX="14.0" layoutY="14.0" onAction="#tfStreamingPathAction" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" />
<JFXButton fx:id="streamingDirectoryBtn" layoutX="263.0" layoutY="2.0" onAction="#streamingDirectoryBtnAction" AnchorPane.leftAnchor="260.0" AnchorPane.topAnchor="5.0" />
<TableView fx:id="tableViewStreamingdata" layoutX="14.0" layoutY="44.0" prefHeight="200.0" prefWidth="300.0" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
</children></AnchorPane>
<AnchorPane fx:id="settingsAnchor" layoutX="160.0" layoutY="44.0" prefHeight="566.0" prefWidth="760.0" style="-fx-background-color: #FFFFFF;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<children>
<JFXTextField fx:id="tfPath" layoutX="14.0" layoutY="14.0" onAction="#tfPathAction" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" />
<JFXButton fx:id="directoryBtn" layoutX="255.0" layoutY="8.0" onAction="#directoryBtnAction" prefHeight="25.0" AnchorPane.leftAnchor="260.0" />
<JFXColorPicker fx:id="mainColor" layoutX="14.0" layoutY="45.0" onAction="#mainColorAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
<Label fx:id="sizelbl" layoutY="73.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="75.0" />
<JFXSlider fx:id="sliderFontSize" layoutX="10.0" layoutY="99.0" max="48.0" min="2.0" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="110.0" />
<ChoiceBox fx:id="cbLocal" layoutX="14.0" layoutY="131.0" prefWidth="150.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="145.0" />
<JFXButton fx:id="updateBtn" layoutX="7.0" layoutY="177.0" onAction="#updateBtnAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="180.0" />
<Label fx:id="aulbl" layoutX="43.0" layoutY="219.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="215.0" />
<JFXToggleButton fx:id="autoupdateBtn" layoutX="19.0" layoutY="215.0" onAction="#autoupdateBtnAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="230.0" />
<Label fx:id="versionlbl" layoutX="29.0" layoutY="297.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="280.0" />
</children>
</AnchorPane>
</children> </children>
</AnchorPane> </AnchorPane>

View File

@ -63,8 +63,6 @@ import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType; import javafx.scene.control.Alert.AlertType;
@ -89,21 +87,17 @@ public class MainWindowController {
@FXML @FXML
private AnchorPane anpane; private AnchorPane anpane;
@FXML @FXML
private AnchorPane settingsan = new AnchorPane(); private AnchorPane settingsAnchor;
@FXML @FXML
private AnchorPane streamingSettingsan = new AnchorPane(); private AnchorPane streamingSettingsAnchor;
@FXML @FXML
private HBox topHBox; private HBox topHBox;
@FXML @FXML
private VBox sideMenuVBox; private VBox sideMenuVBox;
@FXML @FXML
private VBox settingsBox = new VBox();
@FXML
private VBox streamingSettingsBox = new VBox();
@FXML
private TreeTableView<streamUiData> treeTableViewfilm; private TreeTableView<streamUiData> treeTableViewfilm;
@FXML @FXML
private TableView<streamUiData> treeViewStreamingdata = new TableView<>(); private TableView<streamUiData> tableViewStreamingdata;
@FXML @FXML
private JFXTextArea ta1; private JFXTextArea ta1;
@FXML @FXML
@ -127,33 +121,33 @@ public class MainWindowController {
@FXML @FXML
private JFXButton debugBtn; private JFXButton debugBtn;
@FXML @FXML
private JFXButton updateBtn = new JFXButton("Auf Update prüfen"); private JFXButton updateBtn;
@FXML @FXML
private JFXButton directoryBtn = new JFXButton("Ordner auswählen"); private JFXButton directoryBtn;
@FXML @FXML
private JFXButton streamingDirectoryBtn = new JFXButton("Ordner auswählen"); private JFXButton streamingDirectoryBtn;
@FXML @FXML
private JFXToggleButton autoupdateBtn = new JFXToggleButton(); private JFXToggleButton autoupdateBtn;
@FXML @FXML
public JFXTextField tfPfad = new JFXTextField(); public JFXTextField tfPath;
@FXML @FXML
public JFXTextField streamingtfPfad = new JFXTextField(); public JFXTextField tfStreamingPath;
@FXML @FXML
private JFXTextField tfsearch; private JFXTextField tfsearch;
@FXML @FXML
public JFXColorPicker mainColor = new JFXColorPicker(); public JFXColorPicker mainColor;
@FXML @FXML
public ChoiceBox<String> cbLocal = new ChoiceBox<String>(); public ChoiceBox<String> cbLocal;
@FXML @FXML
public JFXSlider sl1 = new JFXSlider(); public JFXSlider sliderFontSize;
@FXML @FXML
private JFXDialog dialog = new JFXDialog(); private JFXDialog dialog = new JFXDialog();
@FXML @FXML
private Label versionlbl = new Label(); private Label versionlbl;
@FXML @FXML
private Label sizelbl = new Label("Schriftgröße:"); private Label sizelbl;
@FXML @FXML
private Label aulbl = new Label("beim starten nach Updates suchen:"); private Label aulbl;
@FXML @FXML
private ImageView image1; private ImageView image1;
@ -180,7 +174,7 @@ public class MainWindowController {
private TableColumn<streamUiData, String> dataNameEndColumn = new TableColumn<>("Datei Name mit Endung"); private TableColumn<streamUiData, String> dataNameEndColumn = new TableColumn<>("Datei Name mit Endung");
private boolean menutrue = false; //merker f�r menubtn (�ffnen oder schlie�en) private boolean menutrue = false; //merker für menubtn (öffnen oder schließen)
private boolean settingstrue = false; private boolean settingstrue = false;
private boolean streamingSettingsTrue = false; private boolean streamingSettingsTrue = false;
private String version = "0.3.7"; private String version = "0.3.7";
@ -240,13 +234,13 @@ public class MainWindowController {
menutrue = false; menutrue = false;
} }
if(settingstrue == true){ if(settingstrue == true){
anpane.getChildren().removeAll(settingsBox); settingsAnchor.setVisible(false);
setPath(tfPfad.getText()); setPath(tfPath.getText());
saveSettings(); saveSettings();
settingstrue = false; settingstrue = false;
} }
if(streamingSettingsTrue == true){ if(streamingSettingsTrue == true){
anpane.getChildren().removeAll(streamingSettingsBox); streamingSettingsAnchor.setVisible(false);
streamingSettingsTrue = false; streamingSettingsTrue = false;
} }
} }
@ -360,75 +354,15 @@ public class MainWindowController {
@FXML @FXML
private void settingsBtnclicked(){ private void settingsBtnclicked(){
if(settingstrue == false){ if(settingstrue == false){
anpane.getChildren().addAll(settingsBox); if(streamingSettingsTrue == true){
streamingSettingsAnchor.setVisible(false);
tfPfad.setOnAction(new EventHandler<ActionEvent>(){ streamingSettingsTrue = false;
@Override }
public void handle(ActionEvent event){ settingsAnchor.setVisible(true);
setPath(tfPfad.getText());
saveSettings();
}
});
directoryBtn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event){
selectedFolder = directoryChooser.showDialog(null);
if(selectedFolder == null){
System.out.println("No Directory selected");
}else{
setPath(selectedFolder.getAbsolutePath());
saveSettings();
tfPfad.setText(getPath());
try {
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu
System.exit(0); //beendet sich selbst
} catch (IOException e) {
System.out.println("es ist ein Fehler aufgetreten");
e.printStackTrace();
}
}
}
});
mainColor.setOnAction(new EventHandler<ActionEvent>(){
@Override
public void handle(ActionEvent event){
editColor(mainColor.getValue().toString());
applyColor();
}
});
sl1.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> ov,Number old_val, Number new_val) {
setSize(sl1.getValue());
ta1.setFont(Font.font("System", size));
saveSettings();
}
});
//updater
updateBtn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event){
update();
}
});
autoupdateBtn.setOnAction(new EventHandler<ActionEvent>(){
@Override
public void handle(ActionEvent event) {
if(autoUpdate.equals("0")){
setAutoUpdate("1");
saveSettings();
}else{
setAutoUpdate("0");
saveSettings();
}
}
});
settingstrue = true; settingstrue = true;
}else{ }else{
anpane.getChildren().removeAll(settingsBox); settingsAnchor.setVisible(false);
setPath(tfPfad.getText()); setPath(tfPath.getText());
saveSettings(); saveSettings();
settingstrue = false; settingstrue = false;
} }
@ -440,32 +374,14 @@ public class MainWindowController {
@FXML @FXML
private void streamingSettingsBtnclicked(){ private void streamingSettingsBtnclicked(){
if(streamingSettingsTrue == false){ if(streamingSettingsTrue == false){
anpane.getChildren().addAll(streamingSettingsBox); if(settingstrue == true){
streamingDirectoryBtn.setOnAction(new EventHandler<ActionEvent>() { settingsAnchor.setVisible(false);
settingstrue = false;
@Override }
public void handle(ActionEvent event) { streamingSettingsAnchor.setVisible(true);
selectedStreamingFolder = directoryChooser.showDialog(null);
if(selectedStreamingFolder == null){
System.out.println("No Directory selected");
}else{
setStreamingPath(selectedStreamingFolder.getAbsolutePath());
saveSettings();
streamingtfPfad.setText(getStreamingPath());
try {
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu
System.exit(0); //beendet sich selbst
} catch (IOException e) {
System.out.println("es ist ein Fehler aufgetreten");
e.printStackTrace();
}
}
}
});
streamingSettingsTrue = true; streamingSettingsTrue = true;
}else{ }else{
anpane.getChildren().removeAll(streamingSettingsBox); streamingSettingsAnchor.setVisible(false);
streamingSettingsTrue = false; streamingSettingsTrue = false;
} }
} }
@ -482,22 +398,95 @@ public class MainWindowController {
saveSettings(); saveSettings();
root.getChildren().remove(0,root.getChildren().size()); root.getChildren().remove(0,root.getChildren().size());
addDataUI(); addDataUI();
settingsAnchor.setVisible(false);
streamingSettingsAnchor.setVisible(false);
sideMenuVBox.setVisible(false); //disables sidemenu sideMenuVBox.setVisible(false); //disables sidemenu
menutrue = false; menutrue = false;
settingstrue = false;
streamingSettingsTrue = false;
} }
@FXML @FXML
private void debugBtnclicked(){ private void debugBtnclicked(){
//for testing //for testing
} }
@FXML
private void tfPathAction(){
setPath(tfPath.getText());
saveSettings();
}
@FXML
private void directoryBtnAction(){
selectedFolder = directoryChooser.showDialog(null);
if(selectedFolder == null){
System.out.println("No Directory selected");
}else{
setPath(selectedFolder.getAbsolutePath());
saveSettings();
tfPath.setText(getPath());
try {
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu
System.exit(0); //beendet sich selbst
} catch (IOException e) {
System.out.println("es ist ein Fehler aufgetreten");
e.printStackTrace();
}
}
}
@FXML
private void mainColorAction(){
editColor(mainColor.getValue().toString());
applyColor();
}
@FXML
private void updateBtnAction(){
update();
}
@FXML
private void autoupdateBtnAction(){
if(autoUpdate.equals("0")){
setAutoUpdate("1");
}else{
setAutoUpdate("0");
}
saveSettings();
}
@FXML
private void tfStreamingPathAction(){
//
}
@FXML
private void streamingDirectoryBtnAction(){
selectedStreamingFolder = directoryChooser.showDialog(null);
if(selectedStreamingFolder == null){
System.out.println("No Directory selected");
}else{
setStreamingPath(selectedStreamingFolder.getAbsolutePath());
saveSettings();
tfStreamingPath.setText(getStreamingPath());
try {
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu
System.exit(0); //beendet sich selbst
} catch (IOException e) {
System.out.println("es ist ein Fehler aufgetreten");
e.printStackTrace();
}
}
}
//"Main" Methode die beim start von der Klasse Main aufgerufen wird, initialiesirung der einzellnen UI-Objekte //"Main" Methode die beim start von der Klasse Main aufgerufen wird, initialiesirung der einzellnen UI-Objekte
@SuppressWarnings({ "static-access"})
public void setMain(Main main) { public void setMain(Main main) {
loadSettings(); loadSettings();
// loadStreamingSettings();
initTabel(); initTabel();
initActions(); initActions();
@ -505,33 +494,15 @@ public class MainWindowController {
debugBtn.setDisable(true); //debugging btn for tests debugBtn.setDisable(true); //debugging btn for tests
debugBtn.setVisible(false); debugBtn.setVisible(false);
tfPfad.setPrefWidth(250);
tfPfad.setPromptText("Pfad");
tfPfad.setText(getPath());
streamingtfPfad.setPrefWidth(250); tfPath.setText(getPath());
streamingtfPfad.setPromptText("Pfad");
streamingtfPfad.setText(getStreamingPath());
sl1.setMaxWidth(250); sliderFontSize.setValue(getSize());
sl1.setMin(2);
sl1.setMax(48);
sl1.setValue(getSize());
cbLocal.setItems(locals); cbLocal.setItems(locals);
updateBtn.setFont(Font.font("System", 12)); updateBtn.setFont(Font.font("System", 12));
directoryBtn.setFont(Font.font("System", 12));
directoryBtn.setMaxSize(180, 25);
streamingDirectoryBtn.setFont(Font.font("System", 12));
streamingDirectoryBtn.setMaxSize(180, 25);
treeViewStreamingdata.setPrefHeight(533);
treeViewStreamingdata.setPrefWidth(370);
if(autoUpdate.equals("1")){ if(autoUpdate.equals("1")){
autoupdateBtn.setSelected(true); autoupdateBtn.setSelected(true);
update(); update();
@ -540,68 +511,7 @@ public class MainWindowController {
} }
versionlbl.setText("Version: "+version); versionlbl.setText("Version: "+version);
settingsBox.setStyle("-fx-background-color: #FFFFFF;");
settingsBox.getChildren().add(settingsan);
streamingSettingsBox.setStyle("-fx-background-color: #FFFFFF;");
streamingSettingsBox.getChildren().add(streamingSettingsan);
settingsan.getChildren().addAll(tfPfad, directoryBtn, mainColor, sizelbl, sl1, cbLocal, updateBtn, aulbl, autoupdateBtn, versionlbl);
settingsan.setTopAnchor(tfPfad, 5d);
settingsan.setLeftAnchor(tfPfad, 5d);
settingsan.setTopAnchor(directoryBtn, 5d);
settingsan.setLeftAnchor(directoryBtn, 260d);
settingsan.setTopAnchor(mainColor, 40d);
settingsan.setLeftAnchor(mainColor, 5d);
settingsan.setTopAnchor(sizelbl, 75d);
settingsan.setLeftAnchor(sizelbl, 5d);
settingsan.setTopAnchor(sl1, 110d);
settingsan.setLeftAnchor(sl1, 5d);
settingsan.setTopAnchor(cbLocal, 145d);
settingsan.setLeftAnchor(cbLocal, 5d);
settingsan.setTopAnchor(updateBtn, 180d);
settingsan.setLeftAnchor(updateBtn, 5d);
settingsan.setTopAnchor(aulbl, 215d);
settingsan.setLeftAnchor(aulbl, 5d);
settingsan.setTopAnchor(autoupdateBtn, 230d);
settingsan.setLeftAnchor(autoupdateBtn, 5d);
settingsan.setTopAnchor(versionlbl, 280d);
settingsan.setLeftAnchor(versionlbl, 5d);
streamingSettingsan.getChildren().addAll(streamingtfPfad, streamingDirectoryBtn,treeViewStreamingdata);
streamingSettingsan.setTopAnchor(streamingtfPfad, 5d);
streamingSettingsan.setLeftAnchor(streamingtfPfad, 5d);
streamingSettingsan.setTopAnchor(streamingDirectoryBtn, 5d);
streamingSettingsan.setLeftAnchor(streamingDirectoryBtn, 260d);
streamingSettingsan.setTopAnchor(treeViewStreamingdata, 40d);
streamingSettingsan.setLeftAnchor(treeViewStreamingdata, 5d);
streamingSettingsan.setBottomAnchor(treeViewStreamingdata, 5d);
AnchorPane.setTopAnchor(settingsBox, 34d);
AnchorPane.setRightAnchor(settingsBox, 0d);
AnchorPane.setBottomAnchor(settingsBox, 0d);
AnchorPane.setLeftAnchor(settingsBox, 150d);
AnchorPane.setTopAnchor(streamingSettingsBox, 34d);
AnchorPane.setRightAnchor(streamingSettingsBox, 0d);
AnchorPane.setBottomAnchor(streamingSettingsBox, 0d);
AnchorPane.setLeftAnchor(streamingSettingsBox, 150d);
ta1.setWrapText(true); ta1.setWrapText(true);
ta1.setEditable(false); ta1.setEditable(false);
ta1.setFont(Font.font("System", getSize())); ta1.setFont(Font.font("System", getSize()));
@ -611,12 +521,12 @@ public class MainWindowController {
@SuppressWarnings({ "unchecked", "rawtypes" }) @SuppressWarnings({ "unchecked", "rawtypes" })
private void initTabel(){ private void initTabel(){
//Filmtabelle //Filmtabelle
// root.setExpanded(true);
columnRating.setMaxWidth(120); columnRating.setMaxWidth(120);
columnTitel.setMaxWidth(240); columnTitel.setMaxWidth(240);
columnStreamUrl.setMaxWidth(0); columnStreamUrl.setMaxWidth(0);
dataNameColumn.setPrefWidth(130);
dataNameEndColumn.setPrefWidth(170);
treeTableViewfilm.setRoot(root); treeTableViewfilm.setRoot(root);
treeTableViewfilm.setColumnResizePolicy( TreeTableView.CONSTRAINED_RESIZE_POLICY ); treeTableViewfilm.setColumnResizePolicy( TreeTableView.CONSTRAINED_RESIZE_POLICY );
@ -662,12 +572,11 @@ public class MainWindowController {
}); });
//Streaming-Settings Tabelle //Streaming-Settings Tabelle
dataNameColumn.setCellValueFactory(cellData -> cellData.getValue().titelProperty()); dataNameColumn.setCellValueFactory(cellData -> cellData.getValue().titelProperty());
dataNameEndColumn.setCellValueFactory(cellData -> cellData.getValue().streamUrlProperty()); dataNameEndColumn.setCellValueFactory(cellData -> cellData.getValue().streamUrlProperty());
treeViewStreamingdata.getColumns().addAll(dataNameColumn, dataNameEndColumn); tableViewStreamingdata.getColumns().addAll(dataNameColumn, dataNameEndColumn);
treeViewStreamingdata.setItems(streamingData); tableViewStreamingdata.setItems(streamingData);
} }
//initialisierung der Button Actions //initialisierung der Button Actions
@ -702,11 +611,19 @@ public class MainWindowController {
saveSettings(); saveSettings();
} }
}); });
sliderFontSize.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> ov,Number old_val, Number new_val) {
setSize(sliderFontSize.getValue());
ta1.setFont(Font.font("System", size));
saveSettings();
}
});
} }
//prüft auf Update und fürht es gegebenenfalls aus //prüft auf Update und fürht es gegebenenfalls aus
private void update(){ private void update(){
System.out.println("check for updates ..."); System.out.println("check for updates ...");
try { try {
URL url = new URL(versionURL); //URL der Datei mit aktueller Versionsnummer URL url = new URL(versionURL); //URL der Datei mit aktueller Versionsnummer
@ -866,7 +783,7 @@ public class MainWindowController {
sideMenuVBox.setStyle(style); sideMenuVBox.setStyle(style);
topHBox.setStyle(style); topHBox.setStyle(style);
tfsearch.setFocusColor(Color.valueOf(getColor())); tfsearch.setFocusColor(Color.valueOf(getColor()));
tfPfad.setFocusColor(Color.valueOf(getColor())); tfPath.setFocusColor(Color.valueOf(getColor()));
if(icolor.compareTo(ccolor) == -1){ if(icolor.compareTo(ccolor) == -1){
settingsBtn.setStyle("-fx-text-fill: WHITE;"); settingsBtn.setStyle("-fx-text-fill: WHITE;");
@ -921,9 +838,12 @@ public class MainWindowController {
settingsBtn.setText(bundle.getString("settings")); settingsBtn.setText(bundle.getString("settings"));
streamingSettingsBtn.setText(bundle.getString("streamingSettings")); streamingSettingsBtn.setText(bundle.getString("streamingSettings"));
playbtn.setText(bundle.getString("play")); playbtn.setText(bundle.getString("play"));
tfPath.setPromptText(bundle.getString("tfPath"));
tfStreamingPath.setPromptText(bundle.getString("tfPath"));
openfolderbtn.setText(bundle.getString("openFolder")); openfolderbtn.setText(bundle.getString("openFolder"));
updateBtn.setText(bundle.getString("checkUpdates")); updateBtn.setText(bundle.getString("checkUpdates"));
directoryBtn.setText(bundle.getString("chooseFolder")); directoryBtn.setText(bundle.getString("chooseFolder"));
streamingDirectoryBtn.setText(bundle.getString("chooseFolder"));
sizelbl.setText(bundle.getString("fontSize")); sizelbl.setText(bundle.getString("fontSize"));
aulbl.setText(bundle.getString("autoUpdate")); aulbl.setText(bundle.getString("autoUpdate"));
versionlbl.setText(bundle.getString("version")+" "+version); versionlbl.setText(bundle.getString("version")+" "+version);
@ -1119,7 +1039,7 @@ public class MainWindowController {
ta1.appendText("Titel: "+titel+"\n"); ta1.appendText("Titel: "+titel+"\n");
ta1.appendText("Jahr: "+ year+"\n"); ta1.appendText("Jahr: "+ year+"\n");
ta1.appendText("Einstufung: "+rated+"\n"); ta1.appendText("Einstufung: "+rated+"\n");
ta1.appendText("Ver�ffentlicht am: "+released+"\n"); ta1.appendText("Veröffentlicht am: "+released+"\n");
ta1.appendText("Laufzeit: "+runtime+"\n"); ta1.appendText("Laufzeit: "+runtime+"\n");
ta1.appendText("Genre: "+genre+"\n"); ta1.appendText("Genre: "+genre+"\n");
ta1.appendText("Regisseur: "+director+"\n"); ta1.appendText("Regisseur: "+director+"\n");

View File

@ -3,6 +3,7 @@ info = Info
settings = Einstellungen settings = Einstellungen
streamingSettings = Stream Einst. streamingSettings = Stream Einst.
play = play play = play
tfPath = Pfad...
openFolder = Ordner \u00F6ffnen openFolder = Ordner \u00F6ffnen
chooseFolder = Ordner ausw\u00E4hlen chooseFolder = Ordner ausw\u00E4hlen
fontSize = Schriftgr\u00F6\u00DFe: fontSize = Schriftgr\u00F6\u00DFe:

View File

@ -3,6 +3,7 @@ info = Info
settings = Settings settings = Settings
streamingSettings = Stream Settings streamingSettings = Stream Settings
play = play play = play
tfPath = Path...
openFolder = open Folder openFolder = open Folder
chooseFolder = choose Directory chooseFolder = choose Directory
fontSize = font size: fontSize = font size: