code cleanup
This commit is contained in:
parent
46efa77fce
commit
1e0ab2b943
|
@ -215,7 +215,7 @@ public class MainWindowController {
|
||||||
private boolean autoplay = false;
|
private boolean autoplay = false;
|
||||||
|
|
||||||
private final String version = "0.7.0";
|
private final String version = "0.7.0";
|
||||||
private final String buildNumber = "155";
|
private final String buildNumber = "157";
|
||||||
private final String versionName = "toothless dragon";
|
private final String versionName = "toothless dragon";
|
||||||
private String btnStyle;
|
private String btnStyle;
|
||||||
private String color;
|
private String color;
|
||||||
|
@ -236,12 +236,6 @@ public class MainWindowController {
|
||||||
private ObservableList<FilmTabelDataType> filterData = FXCollections.observableArrayList();
|
private ObservableList<FilmTabelDataType> filterData = FXCollections.observableArrayList();
|
||||||
private ObservableList<FilmTabelDataType> filmsList = FXCollections.observableArrayList();
|
private ObservableList<FilmTabelDataType> filmsList = FXCollections.observableArrayList();
|
||||||
private ObservableList<SourceDataType> sourcesList = FXCollections.observableArrayList();
|
private ObservableList<SourceDataType> sourcesList = FXCollections.observableArrayList();
|
||||||
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 MenuItem like = new MenuItem("like");
|
private MenuItem like = new MenuItem("like");
|
||||||
private MenuItem dislike = new MenuItem("dislike"); // TODO one option (like or dislike)
|
private MenuItem dislike = new MenuItem("dislike"); // TODO one option (like or dislike)
|
||||||
private ContextMenu menu = new ContextMenu(like, dislike);
|
private ContextMenu menu = new ContextMenu(like, dislike);
|
||||||
|
@ -408,7 +402,6 @@ public class MainWindowController {
|
||||||
if (!getCurrentTitle().isEmpty()) {
|
if (!getCurrentTitle().isEmpty()) {
|
||||||
dbController.readCache(getCurrentStreamUrl());
|
dbController.readCache(getCurrentStreamUrl());
|
||||||
}
|
}
|
||||||
// ta1.setFont(Font.font("System", size));
|
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -459,7 +452,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addDataUI(filterData);
|
addFilmsToTable(filterData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -646,7 +639,7 @@ public class MainWindowController {
|
||||||
/**
|
/**
|
||||||
* add data from films-list to films-table
|
* add data from films-list to films-table
|
||||||
*/
|
*/
|
||||||
public void addDataUI(ObservableList<FilmTabelDataType> elementsList) {
|
public void addFilmsToTable(ObservableList<FilmTabelDataType> elementsList) {
|
||||||
|
|
||||||
for (FilmTabelDataType element : elementsList) {
|
for (FilmTabelDataType element : elementsList) {
|
||||||
|
|
||||||
|
@ -713,28 +706,26 @@ public class MainWindowController {
|
||||||
*/
|
*/
|
||||||
private void applyColor() {
|
private void applyColor() {
|
||||||
String menuBtnStyle;
|
String menuBtnStyle;
|
||||||
String btnStyleBlack = "-fx-button-type: RAISED; -fx-background-color: #" + getColor() + "; -fx-text-fill: BLACK;";
|
|
||||||
String btnStyleWhite = "-fx-button-type: RAISED; -fx-background-color: #" + getColor() + "; -fx-text-fill: WHITE;";
|
|
||||||
BigInteger usedColor = new BigInteger(getColor(), 16);
|
BigInteger usedColor = new BigInteger(getColor(), 16);
|
||||||
BigInteger checkColor = new BigInteger("78909cff", 16);
|
BigInteger checkColor = new BigInteger("78909cff", 16);
|
||||||
|
|
||||||
if (usedColor.compareTo(checkColor) == -1) {
|
if (usedColor.compareTo(checkColor) == -1) {
|
||||||
btnStyle = btnStyleWhite;
|
btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + getColor() + "; -fx-text-fill: WHITE;";
|
||||||
menuBtnStyle = "-fx-text-fill: WHITE;";
|
menuBtnStyle = "-fx-text-fill: WHITE;";
|
||||||
|
|
||||||
playbtn.setGraphic(play_arrow_white);
|
playbtn.setGraphic(new ImageView(new Image("icons/ic_play_arrow_white_18dp_1x.png")));
|
||||||
returnBtn.setGraphic(skip_previous_white);
|
returnBtn.setGraphic(new ImageView(new Image("icons/ic_skip_previous_white_18dp_1x.png")));
|
||||||
forwardBtn.setGraphic(skip_next_white);
|
forwardBtn.setGraphic(new ImageView(new Image("icons/ic_skip_next_white_18dp_1x.png")));
|
||||||
|
|
||||||
menuHam.getStyleClass().clear();
|
menuHam.getStyleClass().clear();
|
||||||
menuHam.getStyleClass().add("jfx-hamburgerW");
|
menuHam.getStyleClass().add("jfx-hamburgerW");
|
||||||
} else {
|
} else {
|
||||||
btnStyle = btnStyleBlack;
|
btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + getColor() + "; -fx-text-fill: BLACK;";
|
||||||
menuBtnStyle = "-fx-text-fill: BLACK;";
|
menuBtnStyle = "-fx-text-fill: BLACK;";
|
||||||
|
|
||||||
playbtn.setGraphic(play_arrow_black);
|
playbtn.setGraphic(new ImageView(new Image("icons/ic_play_arrow_black_18dp_1x.png")));
|
||||||
returnBtn.setGraphic(skip_previous_black);
|
returnBtn.setGraphic(new ImageView(new Image("icons/ic_skip_previous_black_18dp_1x.png")));
|
||||||
forwardBtn.setGraphic(skip_next_black);
|
forwardBtn.setGraphic(new ImageView(new Image("icons/ic_skip_next_black_18dp_1x.png")));
|
||||||
|
|
||||||
menuHam.getStyleClass().clear();
|
menuHam.getStyleClass().clear();
|
||||||
menuHam.getStyleClass().add("jfx-hamburgerB");
|
menuHam.getStyleClass().add("jfx-hamburgerB");
|
||||||
|
|
|
@ -235,7 +235,7 @@ public class DBController {
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.info("loading data to the GUI ...");
|
LOGGER.info("loading data to the GUI ...");
|
||||||
mainWindowController.addDataUI(mainWindowController.getFilmsList());
|
mainWindowController.addFilmsToTable(mainWindowController.getFilmsList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -152,7 +152,6 @@ public class OMDbAPIController implements Runnable {
|
||||||
BufferedReader ina = new BufferedReader(new InputStreamReader(apiUrl.openStream()));
|
BufferedReader ina = new BufferedReader(new InputStreamReader(apiUrl.openStream()));
|
||||||
output = ina.readLine();
|
output = ina.readLine();
|
||||||
ina.close();
|
ina.close();
|
||||||
System.out.println(apiUrl.toString());
|
|
||||||
LOGGER.info("response from '" + URL + "&t=" + title + "' was:" + output);
|
LOGGER.info("response from '" + URL + "&t=" + title + "' was:" + output);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error("error while making api request or reading response");
|
LOGGER.error("error while making api request or reading response");
|
||||||
|
|
Loading…
Reference in New Issue