Browse Source

clean up DetailViews

dev
Jannik Seiler 6 days ago
parent
commit
834bffda93
Signed by: Seil0 <seil0@mosad.xyz> GPG Key ID: E8459F3723C52C24
7 changed files with 56 additions and 76 deletions
  1. +2
    -0
      src/main/java/org/mosad/homeflix/application/MainWindowController.java
  2. +1
    -0
      src/main/java/org/mosad/homeflix/application/SettingsView.java
  3. +42
    -0
      src/main/java/org/mosad/homeflix/application/view/DetailView.java
  4. +5
    -42
      src/main/java/org/mosad/homeflix/application/view/FilmDetailView.java
  5. +4
    -32
      src/main/java/org/mosad/homeflix/application/view/SeriesDetailView.java
  6. +1
    -1
      src/main/resources/fxml/FilmDetailView.fxml
  7. +1
    -1
      src/main/resources/fxml/SeriesDetailView.fxml

+ 2
- 0
src/main/java/org/mosad/homeflix/application/MainWindowController.java View File

@@ -39,6 +39,8 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.kellerkinder.Alerts.JFX2BtnCancelAlert;
import org.kellerkinder.Alerts.JFXInfoAlert;
import org.mosad.homeflix.application.view.FilmDetailView;
import org.mosad.homeflix.application.view.SeriesDetailView;
import org.mosad.homeflix.controller.DBController;
import org.mosad.homeflix.controller.OMDbAPIController;
import org.mosad.homeflix.controller.UpdateController;


+ 1
- 0
src/main/java/org/mosad/homeflix/application/SettingsView.java View File

@@ -30,6 +30,7 @@ import java.io.Writer;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.mosad.homeflix.application.view.FilmDetailView;
import org.mosad.homeflix.controller.DBController;
import org.mosad.homeflix.controller.UpdateController;
import org.mosad.homeflix.controller.XMLController;


+ 42
- 0
src/main/java/org/mosad/homeflix/application/view/DetailView.java View File

@@ -0,0 +1,42 @@
package org.mosad.homeflix.application.view;

import org.mosad.homeflix.application.MainWindowController;

import javafx.animation.FadeTransition;
import javafx.fxml.FXML;
import javafx.scene.layout.AnchorPane;
import javafx.util.Duration;

public class DetailView {
@FXML protected AnchorPane rootPane;
public void updateGUILocal() {
throw new UnsupportedOperationException();
}
/**
* show the root pane
*/
public void showPane() {
rootPane.setVisible(true);
FadeTransition fadeIn = new FadeTransition(Duration.millis(300), rootPane);
fadeIn.setFromValue(0.3);
fadeIn.setToValue(1.0);
fadeIn.play();
}
/**
* hide the root pane and disable the blur in MainWindowController
*/
protected void hidePane() {
FadeTransition fadeOut = new FadeTransition(Duration.millis(200), rootPane);
fadeOut.setFromValue(1.0);
fadeOut.setToValue(0.3);
fadeOut.play();

rootPane.setVisible(false);
MainWindowController.getInstance().disableBlur(); // disable blur
}
}

src/main/java/org/mosad/homeflix/application/FilmDetailView.java → src/main/java/org/mosad/homeflix/application/view/FilmDetailView.java View File

@@ -20,7 +20,7 @@
*
*/

package org.mosad.homeflix.application;
package org.mosad.homeflix.application.view;

import java.awt.Desktop;
import java.io.File;
@@ -35,18 +35,13 @@ import org.mosad.homeflix.player.Player;

import com.jfoenix.controls.JFXButton;

import javafx.animation.FadeTransition;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.text.Text;
import javafx.util.Duration;

public class FilmDetailView {
@FXML private AnchorPane filmDVPane;
public class FilmDetailView extends DetailView {
@FXML private Label lblTitle;
@FXML private Label lblYear;
@@ -88,7 +83,7 @@ public class FilmDetailView {
public void initialize() {
dbController = DBController.getInstance();
filmDVPane.setStyle("-fx-background-color: rgba(89,89,89,0.9);");
rootPane.setStyle("-fx-background-color: rgba(89,89,89,0.9);");
}
@FXML
@@ -115,7 +110,7 @@ public class FilmDetailView {
@FXML
private void btnPlayAction() {
playFilm();
new Player(currentStreamURL);
}
@FXML
@@ -178,6 +173,7 @@ public class FilmDetailView {
/**
* update the text of all static GUI elements of FilmDeatilView
*/
@Override
public void updateGUILocal() {
lblCrew.setText(XMLController.getLocalBundle().getString("crew"));
lblDirectorsInfo.setText(XMLController.getLocalBundle().getString("directors"));
@@ -190,38 +186,5 @@ public class FilmDetailView {
lblRevenueInfo.setText(XMLController.getLocalBundle().getString("boxOffice"));
lblRatingInfo.setText(XMLController.getLocalBundle().getString("rated"));
}
/**
* show the FilmDVpane
*/
public void showPane() {
filmDVPane.setVisible(true);
FadeTransition fadeIn = new FadeTransition(Duration.millis(300), filmDVPane);
fadeIn.setFromValue(0.3);
fadeIn.setToValue(1.0);
fadeIn.play();
}
/**
* hide the FilmDVpane
*/
private void hidePane() {
FadeTransition fadeOut = new FadeTransition(Duration.millis(200), filmDVPane);
fadeOut.setFromValue(1.0);
fadeOut.setToValue(0.3);
fadeOut.play();

filmDVPane.setVisible(false);
MainWindowController.getInstance().disableBlur(); // disable blur
}
private void playFilm() {
if(new File(currentStreamURL).isDirectory()) {
return;
}
new Player(currentStreamURL);
}

}

src/main/java/org/mosad/homeflix/application/SeriesDetailView.java → src/main/java/org/mosad/homeflix/application/view/SeriesDetailView.java View File

@@ -20,7 +20,7 @@
*
*/

package org.mosad.homeflix.application;
package org.mosad.homeflix.application.view;

import java.awt.Desktop;
import java.io.File;
@@ -36,7 +36,6 @@ import org.mosad.homeflix.player.Player;

import com.jfoenix.controls.JFXButton;

import javafx.animation.FadeTransition;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
@@ -46,14 +45,11 @@ import javafx.scene.control.ScrollPane;
import javafx.scene.control.ScrollPane.ScrollBarPolicy;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text;
import javafx.util.Duration;

public class SeriesDetailView {
public class SeriesDetailView extends DetailView {
@FXML private AnchorPane seriesDVPane;
@FXML private ScrollPane scrollPaneEpisodes;
@FXML private HBox hBoxEpisodes;
@@ -90,7 +86,7 @@ public class SeriesDetailView {
public void initialize() {
dbController = DBController.getInstance();
seriesDVPane.setStyle("-fx-background-color: rgba(89,89,89,0.9);");
rootPane.setStyle("-fx-background-color: rgba(89,89,89,0.9);");
scrollPaneEpisodes.setStyle("-fx-background-color: transparent;");
scrollPaneEpisodes.setHbarPolicy(ScrollBarPolicy.ALWAYS);
@@ -188,6 +184,7 @@ public class SeriesDetailView {
/**
* update the text of all static GUI elements of FilmDeatilView
*/
@Override
public void updateGUILocal() {
lblCrew.setText(XMLController.getLocalBundle().getString("crew"));
lblDirectorsInfo.setText(XMLController.getLocalBundle().getString("directors"));
@@ -195,31 +192,6 @@ public class SeriesDetailView {
lblActorsInfo.setText(XMLController.getLocalBundle().getString("actors"));
}
/**
* show the FilmDVpane
*/
public void showPane() {
seriesDVPane.setVisible(true);
FadeTransition fadeIn = new FadeTransition(Duration.millis(300), seriesDVPane);
fadeIn.setFromValue(0.3);
fadeIn.setToValue(1.0);
fadeIn.play();
}
/**
* hide the FilmDVpane
*/
private void hidePane() {
FadeTransition fadeOut = new FadeTransition(Duration.millis(200), seriesDVPane);
fadeOut.setFromValue(1.0);
fadeOut.setToValue(0.3);
fadeOut.play();

seriesDVPane.setVisible(false);
MainWindowController.getInstance().disableBlur(); // disable blur
}
/**
* add all episodes of one season to the ScrollPane
* @param season the season to add

+ 1
- 1
src/main/resources/fxml/FilmDetailView.fxml View File

@@ -12,7 +12,7 @@
<?import javafx.scene.text.Text?>
<?import javafx.scene.text.TextFlow?>

<AnchorPane fx:id="filmDVPane" prefHeight="568.0" prefWidth="1130.0" style="-fx-background-color: #595959;" visible="false" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.mosad.homeflix.application.FilmDetailView">
<AnchorPane fx:id="rootPane" prefHeight="568.0" prefWidth="1130.0" style="-fx-background-color: #595959;" visible="false" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.mosad.homeflix.application.view.FilmDetailView">
<children>
<HBox layoutX="22.0" layoutY="21.0" prefWidth="808.0" spacing="10.0" AnchorPane.leftAnchor="22.0" AnchorPane.rightAnchor="300.0" AnchorPane.topAnchor="22.0">
<children>


+ 1
- 1
src/main/resources/fxml/SeriesDetailView.fxml View File

@@ -14,7 +14,7 @@
<?import javafx.scene.text.Text?>
<?import javafx.scene.text.TextFlow?>

<AnchorPane fx:id="seriesDVPane" prefHeight="568.0" prefWidth="1130.0" style="-fx-background-color: #595959;" visible="false" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.mosad.homeflix.application.SeriesDetailView">
<AnchorPane fx:id="rootPane" prefHeight="568.0" prefWidth="1130.0" style="-fx-background-color: #595959;" visible="false" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.mosad.homeflix.application.view.SeriesDetailView">
<children>
<HBox layoutX="22.0" layoutY="21.0" prefWidth="808.0" spacing="10.0" AnchorPane.leftAnchor="22.0" AnchorPane.rightAnchor="310.0" AnchorPane.topAnchor="22.0">
<children>


Loading…
Cancel
Save