more FilmDeatilView work

This commit is contained in:
Jannik 2019-06-16 15:23:17 +02:00
parent f23e6c77ea
commit 2bbbfff532
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
7 changed files with 97 additions and 20 deletions

View File

@ -1,18 +1,44 @@
package kellerkinder.HomeFlix.application;
import com.jfoenix.controls.JFXButton;
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;
public class FilmDetailView {
@FXML private Label lblFilm;
@FXML private AnchorPane filmDVPane;
@FXML private Label lblTitle;
@FXML private Label lblYear;
@FXML private Label lblScore;
@FXML private JFXButton btnWhishlist;
@FXML private JFXButton btnFavourite;
@FXML private Text textPlot;
public void initialize() {
System.out.println("init nested controller");
filmDVPane.setStyle("-fx-background-color: rgba(89,89,89,0.9);");
btnWhishlist.setGraphic(new ImageView(new Image("icons/ic_play_arrow_black_18dp_1x.png")));
}
public void foo() {
System.out.println("test");
}
@FXML
private void btnWhishlistAction() {
}
@FXML
private void btnFavouriteAction() {
}
}

View File

@ -34,7 +34,6 @@ import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;

View File

@ -72,6 +72,7 @@ import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeTableColumn;
import javafx.scene.control.TreeTableColumn.SortType;
import javafx.scene.control.TreeTableView;
import javafx.scene.effect.BoxBlur;
import javafx.scene.control.ScrollPane.ScrollBarPolicy;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
@ -225,7 +226,7 @@ public class MainWindowController {
// load sources list in gui
addSourceToTable();
// posterModeStartup(); // TODO testing DO NOT USE THIS!!
posterModeStartup(); // TODO testing DO NOT USE THIS!!
}
// Initialize general UI elements
@ -252,6 +253,12 @@ public class MainWindowController {
setLocalUI();
applyColor();
BoxBlur boxBlur = new BoxBlur();
boxBlur.setWidth(9);
boxBlur.setHeight(7);
boxBlur.setIterations(3);
posterModeFlowPane.setEffect(boxBlur);
}
/**
@ -501,7 +508,7 @@ public class MainWindowController {
@FXML
private void returnBtnclicked() {
filmsTreeTable.getSelectionModel().select(last);
filmDetailViewController.foo();
filmDetailViewController.foo(); // TODO
}
@FXML
@ -843,15 +850,15 @@ public class MainWindowController {
getTextFlow().setStyle("-fx-font-size : " + ((int) Math.round(XMLController.getFontSize()) + 1) + "px;");
// add the image
if (new File(cacheData[20]).isFile()) {
try {
try {
if (new File(cacheData[20]).isFile()) {
posterImageView.setImage(new Image(new File(cacheData[20]).toURI().toString()));
} catch (Exception e) {
posterImageView.setImage(new Image("icons/Homeflix_Poster.png"));
LOGGER.error("No Poster found, useing default.");
} else {
posterImageView.setImage(new Image(cacheData[20]));
}
} else {
posterImageView.setImage(new Image(cacheData[20]));
} catch (Exception e) {
posterImageView.setImage(new Image("icons/Homeflix_Poster.png"));
LOGGER.error("No Poster found, useing default.");
}
}

View File

@ -219,13 +219,9 @@ public class DBController {
while (rs.next()) {
String[] cacheData = readCache(rs.getString("streamUrl")); // get from the cache table
System.out.println(rs.getString("streamUrl"));
System.out.println(":" + cacheData[20] + ":");
if(cacheData[20] != null && cacheData[20].length() > 0) {
posterElementsList.add(new PosterModeElement(rs.getString("streamUrl"), cacheData[0], new Image(new File(cacheData[20]).toURI().toString())));
} else {
System.out.println("adding default");
posterElementsList.add(new PosterModeElement(rs.getString("streamUrl"), cacheData[0], new Image("icons/Homeflix_Poster.png")));
}
}

View File

@ -1,10 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.text.TextFlow?>
<AnchorPane prefHeight="568.0" prefWidth="980.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="kellerkinder.HomeFlix.application.FilmDetailView">
<AnchorPane fx:id="filmDVPane" mouseTransparent="true" 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="kellerkinder.HomeFlix.application.FilmDetailView">
<children>
<Label fx:id="lblFilm" layoutX="461.0" layoutY="277.0" text="Test Pane" />
<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>
<Label fx:id="lblTitle" minHeight="-Infinity" prefHeight="29.0" text="Spider-Man: A New Universe" textFill="#ecebed">
<font>
<Font name="System Bold" size="24.0" />
</font>
</Label>
<Label fx:id="lblYear" maxHeight="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="29.0" prefWidth="71.0" text="(2018)" textFill="#ecebed">
<font>
<Font size="24.0" />
</font>
</Label>
</children>
</HBox>
<HBox alignment="CENTER_LEFT" layoutY="71.0" spacing="10.0" AnchorPane.leftAnchor="22.0" AnchorPane.topAnchor="80.0">
<children>
<HBox alignment="CENTER_LEFT">
<children>
<Label fx:id="lblScore" text="Wertung: 80%" textFill="#ecebed" />
</children>
<padding>
<Insets right="20.0" />
</padding>
</HBox>
<JFXButton fx:id="btnWhishlist" buttonType="RAISED" contentDisplay="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onAction="#btnWhishlistAction" prefHeight="40.0" prefWidth="40.0" style="-fx-background-color: #ffffff; -fx-background-radius: 40px;" />
<JFXButton fx:id="btnFavourite" buttonType="RAISED" contentDisplay="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onAction="#btnFavouriteAction" prefHeight="40.0" prefWidth="40.0" style="-fx-background-color: #ffffff; -fx-background-radius: 40px;" />
</children>
</HBox>
<TextFlow layoutX="22.0" layoutY="150.0" lineSpacing="1.0" prefHeight="200.0" AnchorPane.leftAnchor="22.0" AnchorPane.rightAnchor="300.0" AnchorPane.topAnchor="130.0">
<children>
<Text fx:id="textPlot" fill="#ecebed" strokeType="OUTSIDE" strokeWidth="0.0" text="Handlung Miles Morales wurde von einer genetisch veränderten Spinne gebissen. Das macht ihn schnell zum neuen Spider-Man mit den bekannten Fähigkeiten. Aber Miles ist ein Teenager ohne Ahnung von der verantwortungsvollen Nutzung seiner eigenen Kräfte. Doch Hilfe naht, denn durch eine scheinbar zufällig auftretende Verkettung mehrerer Paralleluniversen trifft Miles auf Spider-Man aka Peter Parker und dieser unterweist ihn in den neuen Superkräften und überträgt ihm Verantwortung. Während beide einen Reifeprozess durchmachen, der eine als Schüler, der andere als Lehrer, treffen immer mehr Superhelden mit ähnlichen Kräften ein - ihre bösen Gegenspieler aber auch ...">
<font>
<Font size="15.0" />
</font>
</Text>
</children>
</TextFlow>
<ImageView fitHeight="400.0" fitWidth="267.0" layoutX="849.0" layoutY="14.0" pickOnBounds="true" preserveRatio="true" AnchorPane.rightAnchor="22.0" AnchorPane.topAnchor="22.0">
<image>
<Image url="@../icons/spider-man.jpg" />
</image>
</ImageView>
<Label layoutX="29.0" layoutY="338.0" text="Crew:" textFill="#ecebed" />
<JFXButton buttonType="RAISED" layoutX="1016.0" layoutY="514.0" prefWidth="100.0" style="-fx-background-color: #456789;" text="Play" />
</children>
</AnchorPane>

View File

@ -74,9 +74,7 @@
</FlowPane>
</content>
</ScrollPane>
<AnchorPane>
<fx:include source="/fxml/FilmDetailView.fxml" fx:id="filmDetailView" />
</AnchorPane>
<fx:include fx:id="filmDetailView" source="FilmDetailView.fxml" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="32.0" />
<ScrollPane fx:id="settingsScrollPane" fitToHeight="true" fitToWidth="true" prefHeight="568.0" prefWidth="800.0" style="-fx-background: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="32.0">
<content>
<AnchorPane fx:id="settingsAnchorPane" style="-fx-background-color: white;">

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB