minor clean up

This commit is contained in:
Jannik 2019-05-06 17:26:19 +02:00
parent fdb39ea2f5
commit ea9e740552
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
1 changed files with 10 additions and 17 deletions

View File

@ -374,6 +374,7 @@ public class MainWindowController {
}); });
// Change-listener for treeTableViewfilm // Change-listener for treeTableViewfilm
filmsTreeTable.getSelectionModel().selectedItemProperty().addListener((e, paramT1, paramT2) -> { filmsTreeTable.getSelectionModel().selectedItemProperty().addListener((e, paramT1, paramT2) -> {
if (filmsTreeTable.getSelectionModel().getSelectedItem() == null) { if (filmsTreeTable.getSelectionModel().getSelectedItem() == null) {
return; return;
@ -381,15 +382,15 @@ public class MainWindowController {
currentTableFilm = filmsTreeTable.getSelectionModel().getSelectedItem().getValue(); // set the current film object currentTableFilm = filmsTreeTable.getSelectionModel().getSelectedItem().getValue(); // set the current film object
indexTable = filmsTreeTable.getSelectionModel().getSelectedIndex(); // get selected items table index indexTable = filmsTreeTable.getSelectionModel().getSelectedIndex(); // get selected items table index
last = indexTable - 1;
next = indexTable + 1;
for (FilmTabelDataType film : filmsList) { for (FilmTabelDataType film : filmsList) {
if (film.equals(currentTableFilm)) { if (film.equals(currentTableFilm)) {
indexList = filmsList.indexOf(film); // get selected items list index indexList = filmsList.indexOf(film); // get selected items list index
} }
} }
last = indexTable - 1;
next = indexTable + 1;
if ((currentTableFilm.getCached().isAfter(lastValidCache)) && dbController.searchCacheByURL(getCurrentStreamUrl())) { if ((currentTableFilm.getCached().isAfter(lastValidCache)) && dbController.searchCacheByURL(getCurrentStreamUrl())) {
LOGGER.info("loading from cache: " + getCurrentTitle()); LOGGER.info("loading from cache: " + getCurrentTitle());
setSelectedFilmInfo(dbController.readCache(getCurrentStreamUrl())); setSelectedFilmInfo(dbController.readCache(getCurrentStreamUrl()));
@ -505,11 +506,7 @@ public class MainWindowController {
@FXML @FXML
private void settingsBtnclicked() { private void settingsBtnclicked() {
if (settingsScrollPane.isVisible()) { settingsScrollPane.setVisible(!settingsScrollPane.isVisible());
settingsScrollPane.setVisible(false);
} else {
settingsScrollPane.setVisible(true);
}
} }
@FXML @FXML
@ -686,8 +683,7 @@ public class MainWindowController {
BigInteger checkColor = new BigInteger("78909cff", 16); BigInteger checkColor = new BigInteger("78909cff", 16);
if (usedColor.compareTo(checkColor) == -1) { if (usedColor.compareTo(checkColor) == -1) {
btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + XMLController.getColor() btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + XMLController.getColor() + "; -fx-text-fill: WHITE;";
+ "; -fx-text-fill: WHITE;";
menuBtnStyle = "-fx-text-fill: WHITE;"; menuBtnStyle = "-fx-text-fill: WHITE;";
playbtn.setGraphic(new ImageView(new Image("icons/ic_play_arrow_white_18dp_1x.png"))); playbtn.setGraphic(new ImageView(new Image("icons/ic_play_arrow_white_18dp_1x.png")));
@ -697,8 +693,7 @@ public class MainWindowController {
menuHam.getStyleClass().clear(); menuHam.getStyleClass().clear();
menuHam.getStyleClass().add("jfx-hamburgerW"); menuHam.getStyleClass().add("jfx-hamburgerW");
} else { } else {
btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + XMLController.getColor() btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + XMLController.getColor() + "; -fx-text-fill: BLACK;";
+ "; -fx-text-fill: BLACK;";
menuBtnStyle = "-fx-text-fill: BLACK;"; menuBtnStyle = "-fx-text-fill: BLACK;";
playbtn.setGraphic(new ImageView(new Image("icons/ic_play_arrow_black_18dp_1x.png"))); playbtn.setGraphic(new ImageView(new Image("icons/ic_play_arrow_black_18dp_1x.png")));
@ -819,12 +814,10 @@ public class MainWindowController {
// clear the textFlow and add the new text // clear the textFlow and add the new text
textFlow.clear(); textFlow.clear();
// TODO rework
for (int i = 0; i < 20; i++) { for (int i = 0; i < 20; i++) {
if (cacheData[i] != null && (i == 5 || i == 6) && cacheData[5].length() == 0) { // if the cacheData exists and they are not empty add the text
// do nothing if(cacheData[i] != null && cacheData[i].length() > 0) {
} else if (cacheData[i] != null) {
textFlow.addAll(nameText[i], new Text(cacheData[i] + "\n")); textFlow.addAll(nameText[i], new Text(cacheData[i] + "\n"));
} }
} }