Browse Source

Finished Details panel.

Veloe 4 years ago
parent
commit
9bd9aadf2a

+ 25 - 10
src/main/java/com/moviesdb/BrowserController.java

@@ -276,11 +276,26 @@ public class BrowserController extends Controller {
             //my_movie= my_connector.getMovieInfo(1);
 
             //detailsContent.Text(my_movie.name() + "\n" + my_movie.year() + "\n" + my_movie.duration() + "\n" +  my_movie.genre() + "\n" + my_movie.description());
-            Text info = new Text("Name:\n    " + my_movie.name() + "\n" +
+            String textValue = "Name:\n    " + my_movie.name() + "\n" +
+                    "Genre: \n    " + my_movie.genre() + "\n" +
                     "Year: \n    " + my_movie.year() + "\n" +
                     "Duration: \n    " + my_movie.duration() + "\n" +
-                    "Genre: \n    " + my_movie.genre() + "\n" +
-                    "Description: \n    " + my_movie.description());
+                    "Studio: \n    " + my_movie.studio() + "\n" +
+                    "Director: \n    " + my_movie.director() + "\n" +
+                    "Artists: \n";
+
+            List<Role> Artists = my_connector.getRoles(my_movie.id());
+            for (Role Artist: Artists) {
+                textValue += "    " + Artist.actor() + " - " + Artist.role() + "\n";
+
+            }
+            if (Artists.size() == 0)
+                textValue += "    " + "No artists added.\n";
+
+
+            textValue += "Rate: \n    " + my_movie.rating() + "\n" +
+                        "Description: \n    " + my_movie.description();
+            Text info = new Text(textValue);
             info.setStyle("-fx-font-size: 14; -fx-fill: #9f9f9f;");
             detailsContent.getChildren().clear();
             detailsContent.getChildren().add(info);
@@ -288,7 +303,7 @@ public class BrowserController extends Controller {
             detailsPicPane.setImage(null);
             //detailsPane.setMaxWidth(300);
             //Label movie = e;
-            ImageView detailsImage = new ImageView();
+            //ImageView detailsImage = new ImageView();
 
 
             ImageView image = new ImageView((my_movie.cover()));
@@ -436,10 +451,10 @@ public class BrowserController extends Controller {
             else
                 moviesGrid.setMinHeight(imageHeight * rows + (moviesGrid.getVgap() * (rows - 1)));
 
-            System.out.println("grid height:" + moviesGrid.getHeight());
-            System.out.println("scroll width:" + scrollWidth);
-            System.out.println("cols: " + cols);
-            System.out.println("rows: " + rows);
+            //System.out.println("grid height:" + moviesGrid.getHeight());
+            //System.out.println("scroll width:" + scrollWidth);
+            //System.out.println("cols: " + cols);
+            //System.out.println("rows: " + rows);
 
             //System.out.println("flow height:" + moviesGrid.getHeight() );
             moviesGrid.setMaxWidth(scrollWidth);
@@ -484,8 +499,8 @@ public class BrowserController extends Controller {
                 moviesGrid.setMinHeight(imageHeight * rows + (moviesGrid.getVgap() * (rows - 1)));
 
             //System.out.println("scroll width:" + scrollWidth );
-            System.out.println("cols: " + cols);
-            System.out.println("rows: " + rows);
+            //System.out.println("cols: " + cols);
+            //System.out.println("rows: " + rows);
 
             //System.out.println("flow height:" + moviesGrid.getHeight() );
             moviesGrid.setMaxWidth(scrollPane.getWidth());

+ 7 - 5
src/main/resources/BrowserWindow.fxml

@@ -193,7 +193,7 @@
                         </AnchorPane>
                      </content>
                   </ScrollPane>
-                  <Label alignment="CENTER" layoutX="11.0" layoutY="520.0" onMouseClicked="#openFilter" style="&#10;" text="Advanced search?" textAlignment="CENTER" wrapText="false" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="11.0">
+                  <Label alignment="CENTER" layoutX="11.0" layoutY="520.0" onMouseClicked="#openFilter" style="&#10;" text="Search" textAlignment="CENTER" wrapText="false" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="11.0">
                      <font>
                         <Font size="16.0" fx:id="x111" />
                      </font>
@@ -201,11 +201,9 @@
                         <Color red="0.624" green="0.624" blue="0.624" fx:id="x211" />
                      </textFill>
                   </Label>
-                  <TextField layoutX="514.0" layoutY="14.0" prefHeight="27.0" prefWidth="302.0" style="-fx-background-color: #212121; -fx-border-color: #121212; -fx-text-fill: #9f9f9f;" AnchorPane.rightAnchor="64.0" AnchorPane.topAnchor="14.0" />
-                  <Label layoutX="822.0" layoutY="19.0" text="Button" textFill="#9f9f9f" AnchorPane.rightAnchor="22.0" AnchorPane.topAnchor="19.0" />
                </children>
             </AnchorPane>
-        <AnchorPane fx:id="detailsPane" maxWidth="0.0" minWidth="0.0" prefHeight="550.0" prefWidth="318.0" style="-fx-background-color: #212121;" SplitPane.resizableWithParent="false">
+        <AnchorPane fx:id="detailsPane" maxWidth="0.0" minWidth="300.0" prefHeight="550.0" prefWidth="318.0" style="-fx-background-color: #212121;" SplitPane.resizableWithParent="false">
           <children>
               <Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style="&#10;" text="Details" textAlignment="CENTER" textFill="#9f9f9f" wrapText="false" />
               <ImageView fx:id="detailsPicPane" fitHeight="222.0" fitWidth="150.0" layoutX="14.0" layoutY="41.0" pickOnBounds="true" AnchorPane.bottomAnchor="287.0" AnchorPane.leftAnchor="75.0" AnchorPane.rightAnchor="75.0" AnchorPane.topAnchor="41.0" />
@@ -214,7 +212,6 @@
                     <Font size="16.0" />
                  </font>
               </Label>
-              <TextFlow fx:id="detailsContent" layoutX="14.0" layoutY="287.0" prefHeight="255.0" prefWidth="277.0" />
               <Label fx:id="deleteMovieButton" layoutX="-14.0" layoutY="528.0" onMouseClicked="#openDeleteForm" text="Delete" textFill="#9f9f9f" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="14.0">
                  <font>
                     <Font size="16.0" />
@@ -225,6 +222,11 @@
                     <Font size="16.0" />
                  </font>
               </Label>
+                  <ScrollPane fitToHeight="true" fitToWidth="true" layoutX="14.0" layoutY="290.0" prefHeight="222.0" prefWidth="277.0" style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="39.0" AnchorPane.topAnchor="290.0">
+                     <content>
+                    <TextFlow fx:id="detailsContent" prefHeight="222.0" prefWidth="277.0" style="-fx-background-color: #212121;" />
+                     </content>
+                  </ScrollPane>
 
 
           </children>