Browse Source

Huge refactor

toomanysugar 4 years ago
parent
commit
15bccd4e5e

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+/out/

BIN
out/production/JavaFxApplication/com/moviesdb/Controller.class


BIN
out/production/JavaFxApplication/com/moviesdb/Main.class


+ 1 - 1
out/production/JavaFxApplication/com/moviesdb/sample.fxml

@@ -3,7 +3,7 @@
 
 <?import javafx.scene.control.Button?>
 <?import javafx.scene.control.Label?>
-<GridPane fx:controller="com.moviesdb.Controller"
+<GridPane fx:browserController="com.moviesdb.BrowserController"
           xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10">
     <Label fx:id="mainTitle" text="Hello world!"/>
 </GridPane>

+ 11 - 2
out/production/JavaFxApplication/com/moviesdb/test.fxml

@@ -40,8 +40,12 @@
 <?import javafx.scene.text.Font?>
 <?import javafx.scene.text.TextFlow?>
 
-<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="175.0" prefWidth="250.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.Controller">
+<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="175.0" prefWidth="250.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.BrowserController">
    <children>
+      <Label fx:id="closeButton" layoutX="221.0" layoutY="14.0" prefHeight="16.0" prefWidth="16.0" style="-fx-background-color: #FFFFFF;" text=" X" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="4.0">
+         <font>
+            <Font name="Arimo" size="12.0" />
+         </font></Label>
       <Label layoutX="14.0" layoutY="14.0" text="Log in" textFill="#9f9f9f">
          <font>
             <Font size="24.0" />
@@ -57,9 +61,14 @@
          <font>
             <Font size="14.0" />
          </font></Label>
-      <Button fx:id="logInButton2" layoutX="190.0" layoutY="141.0" mnemonicParsing="false" onMouseClicked="#closeLoginForm" style="-fx-background-color: #9f9f9f;" text="Sign in" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="15.0" />
+      <Button fx:id="logInButton2" layoutX="190.0" layoutY="141.0" mnemonicParsing="false" style="-fx-background-color: #9f9f9f;" text="Sign in" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="15.0" />
       <Pane layoutX="80.0" layoutY="75.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
       <Pane layoutX="80.0" layoutY="117.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
       <TextFlow fx:id="errorTextBox" layoutX="14.0" layoutY="134.0" prefHeight="25.0" prefWidth="159.0" />
+      <Label fx:id="minimizeButton" layoutX="201.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" style="-fx-background-color: #FFFFFF;" text=" -- " AnchorPane.rightAnchor="24.0" AnchorPane.topAnchor="4.0">
+         <font>
+            <Font name="Arimo" size="12.0" />
+         </font>
+      </Label>
    </children>
 </AnchorPane>

+ 4 - 4
out/production/JavaFxApplication/com/moviesdb/test2.fxml

@@ -50,7 +50,7 @@
 <?import javafx.scene.text.Font?>
 <?import javafx.scene.text.TextFlow?>
 
-<VBox prefHeight="600.0" prefWidth="900.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.Controller">
+<VBox prefHeight="600.0" prefWidth="900.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.BrowserController">
   <children>
       <AnchorPane prefHeight="25.0" prefWidth="900.0">
          <children>
@@ -73,9 +73,9 @@
                 </Menu>
               </menus>
             </MenuBar>
-            <Label fx:id="closeButton" layoutX="876.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="8.0" AnchorPane.topAnchor="4.0" />
-            <Label fx:id="maximizeButton" layoutX="854.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="30.0" AnchorPane.topAnchor="4.0" />
-            <Label fx:id="minimizeButton" layoutX="832.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="52.0" AnchorPane.topAnchor="4.0" />
+            <Label fx:id="closeButton" onMouseClicked="#closeStage" layoutX="876.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="8.0" AnchorPane.topAnchor="4.0" />
+            <Label fx:id="maximizeButton" onMouseClicked="#maximizeStageChange" layoutX="854.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="30.0" AnchorPane.topAnchor="4.0" />
+            <Label fx:id="minimizeButton" onMouseClicked="#minimizeStage" layoutX="832.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="52.0" AnchorPane.topAnchor="4.0" />
          </children>
       </AnchorPane>
     <SplitPane dividerPositions="0.3392857142857143, 0.9955357142857143" focusTraversable="true" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: #121212; -fx-border-color: #121212;" stylesheets="@style.css" VBox.vgrow="ALWAYS">

+ 373 - 0
src/com/moviesdb/BrowserController.java

@@ -0,0 +1,373 @@
+package com.moviesdb;
+
+import javafx.event.EventHandler;
+import javafx.fxml.FXML;
+import javafx.geometry.HPos;
+import javafx.geometry.Pos;
+import javafx.geometry.VPos;
+import javafx.scene.control.*;
+import javafx.scene.image.ImageView;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.FlowPane;
+import javafx.scene.layout.GridPane;
+import javafx.scene.control.Alert.AlertType;
+
+import javafx.scene.text.Text;
+import javafx.scene.text.TextFlow;
+
+import javafx.stage.Stage;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.fxml.FXMLLoader;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.*;
+//For reading properties from .properties file
+
+
+public class BrowserController extends Controller {
+    @FXML
+    AnchorPane browserPane;
+    @FXML
+    MenuItem menuNew;
+    @FXML
+    FlowPane moviesGrid;
+    @FXML
+    ScrollPane scrollPane;
+    @FXML
+    AnchorPane detailsPane;
+    @FXML
+    TextFlow detailsContent;
+    @FXML
+    AnchorPane detailsPicPane;
+    @FXML
+    AnchorPane filterPane;
+    @FXML
+    Label button;
+    @FXML
+    Label logInButton;
+    @FXML
+    Button logInButton2;
+    @FXML
+    MenuBar menuPane;
+
+    @FXML
+    Label deleteMovieButton;
+    @FXML
+    Label editMovieButton;
+
+    @FXML
+            TextField userTextBox;
+    @FXML
+            TextField passTextBox;
+    @FXML
+            TextFlow errorTextBox;
+    @FXML
+            Label userLabel;
+
+    Map<Label, Movie> map;
+    Label[] labelsMovies;
+    Movie[] movies;
+    Movie my_movie;
+    public DataBaseConnector my_connector;
+    ConnectionParams workParams;
+
+    double xOffset;
+    double yOffset;
+
+    public void initialize(Stage primaryStage){
+        prepare();
+        stage = primaryStage;
+
+        menuPane.setOnMousePressed(new EventHandler<javafx.scene.input.MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+                xOffset = primaryStage.getX() - event.getScreenX();
+                yOffset = primaryStage.getY() - event.getScreenY();
+            }
+        });
+
+        menuPane.setOnMouseDragged(new EventHandler<MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+                primaryStage.setX(event.getScreenX() + xOffset);
+                primaryStage.setY(event.getScreenY() + yOffset);
+            }
+        });
+
+
+        workParams = new ConnectionParams("connection.properties");
+        if (!workParams.initilized())
+            //TODO this is temporal handler
+            System.out.println(workParams.getInitilizeErrCause().toString());
+        else {
+            my_connector = new DataBaseConnector();
+            my_connector.initConnection(workParams);
+        }
+
+        System.out.println(my_connector.granted("USAGE"));
+        System.out.println(my_connector.granted("INSERT"));
+        System.out.println(my_connector.granted("UPDATE"));
+        System.out.println(my_connector.granted("DELETE"));
+
+
+    }
+
+    public void loadPosters()
+    {
+        //detailsPane.setMinWidth(300);
+        //get movies array
+        if (my_connector.initialized() & my_connector.granted("USAGE")) {
+            movies = my_connector.getMovies();
+            labelsMovies = new Label[movies.length];
+
+            map = new LinkedHashMap<Label, Movie>();
+            //
+            for (int i = 0; i < movies.length; i++) {
+                labelsMovies[i] = new Label();
+                ImageView image = new ImageView(movies[i].cover());
+
+                map.put(labelsMovies[i], movies[i]);
+
+                image.setFitHeight(222);
+                image.setFitWidth(150);
+                labelsMovies[i].setGraphic(image);
+                GridPane.setValignment(labelsMovies[i], VPos.CENTER);
+                GridPane.setHalignment(labelsMovies[i], HPos.CENTER);
+                Label movie = labelsMovies[i];
+                labelsMovies[i].setOnMouseClicked(e -> {
+                    openDetails(movie);
+                });
+            }
+            //moviesGrid.setPrefWidth(scrollPane.getWidth());
+            //clear old data in grid
+            moviesGrid.getChildren().clear();
+            //moviesGrid.setAlignment(Pos.CENTER);
+            //fill grid by movies
+            //moviesGrid.addRow(0, labelsMovies[0], labelsMovies[1]);
+            //moviesGrid.minHeight(moviesGrid.getMinHeight() + 222);
+            //moviesGrid.setPrefWidth(browserPane.getWidth()-26);
+            //moviesGrid.setMinHeight(scrollPane.getHeight());
+            gridResize();
+            //moviesGrid.setPrefHeight(moviesGrid.getHeight());
+        }
+    }
+
+    public void returnMessage()
+    {
+        Alert alert = new Alert(AlertType.CONFIRMATION, "Are you sure you want to format your system?");
+        alert.showAndWait().ifPresent(response -> {
+            if (response == ButtonType.OK) {
+            }
+        });
+    }
+
+    public void openDetails(Label e)
+    {
+        if (detailsPane.getMinWidth() < 1) {
+            //detailsInfoPane = new AnchorPane();
+            //detailsPicPane.getChildren().clear();
+
+            detailsPane.setMinWidth(300);
+            my_movie = map.get(e);
+            //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" +
+                                    "Year: \n    " + my_movie.year() + "\n" +
+                                    "Duration: \n    " + my_movie.duration() + "\n" +
+                                    "Genre: \n    " + my_movie.genre() + "\n" +
+                                    "Description: \n    " + my_movie.description());
+            info.setStyle("-fx-font-size: 14; -fx-fill: #9f9f9f;");
+            detailsContent.getChildren().clear();
+            detailsContent.getChildren().add(info);
+
+            detailsPicPane.getChildren().clear();
+            //detailsPane.setMaxWidth(300);
+            //Label movie = e;
+            ImageView detailsImage = new ImageView();
+
+
+            ImageView image = new ImageView((my_movie.cover()));
+            image.setFitHeight(222);
+            image.setFitWidth(150);
+
+            detailsImage = ((ImageView) image);
+            detailsImage.setX((detailsPane.getWidth() - detailsImage.getFitWidth()) / 2 + 100);
+            detailsImage.setY(0);
+            //movie.
+            detailsPicPane.getChildren().add(detailsImage);
+            // 300px is details window width
+            //scrollPane.setPrefWidth(browserPane.getWidth()-300);
+            //scrollPane.setPrefHeight(browserPane.getHeight());
+            //moviesGrid.setPrefWidth(browserPane.getWidth());
+            //moviesGrid.setPrefHeight(browserPane.getHeight());
+            //loadPosters();
+            if (my_connector.granted("DELETE")) {
+                deleteMovieButton.setDisable(false);
+                deleteMovieButton.setOpacity(1);
+                deleteMovieButton.setOnMouseClicked(ed -> {
+                    System.out.println("delete");
+                });
+
+            } else {
+                deleteMovieButton.setDisable(true);
+                deleteMovieButton.setOpacity(0);
+                deleteMovieButton.setOnMouseClicked(null);
+            }
+
+            if (my_connector.granted("UPDATE")) {
+                editMovieButton.setDisable(false);
+                editMovieButton.setOpacity(1);
+                editMovieButton.setOnMouseClicked(ed -> {
+                    System.out.println("edit");
+                });
+
+            } else {
+                editMovieButton.setDisable(true);
+                editMovieButton.setOpacity(0);
+                editMovieButton.setOnMouseClicked(null);
+            }
+
+
+            gridResize();
+            //button.setText(Double.toString(browserPane.getWidth()));
+
+        }
+        else
+        {
+            detailsPicPane.getChildren().clear();
+            detailsPane.setMinWidth(0);
+            detailsPane.setPrefWidth(0);
+            detailsPane.setMaxWidth(0);
+            // 300px is details window width
+            //scrollPane.setPrefWidth(browserPane.getWidth()+300);
+            //scrollPane.setPrefHeight(browserPane.getHeight());
+            //moviesGrid.setPrefWidth(scrollPane.getWidth()+300);
+            //moviesGrid.setPrefHeight(browserPane.getHeight());
+            //browserPane.setPrefWidth(browserPane.getWidth()+300);
+            gridResize();
+            //button.setText(Double.toString(browserPane.getWidth()));
+        }
+    }
+
+    public void closeDetails()
+    {
+        detailsPicPane.getChildren().clear();
+        detailsPane.setMinWidth(1);
+        detailsPane.setPrefWidth(1);
+    }
+
+    public void openFilter()
+    {
+        if (filterPane.getWidth() < 1)
+        {
+            //filterPane.maxWidth(300);
+            filterPane.setMinWidth(300);
+            filterPane.setPrefWidth(300);
+            filterPane.setMaxWidth(300);
+            //loadPosters();
+            // 300px is filter window width
+            //scrollPane.setPrefWidth(browserPane.getWidth()-300);
+            //scrollPane.setPrefHeight(browserPane.getHeight());
+            //moviesGrid.setPrefWidth(browserPane.getWidth() -300);
+            //moviesGrid.setPrefHeight(browserPane.getHeight());
+
+        }
+        else
+        {
+            filterPane.setMinWidth(0);
+            filterPane.setPrefWidth(0);
+            filterPane.setMaxWidth(0);
+            //loadPosters();
+            // 300px is filter window width
+            //scrollPane.setPrefWidth(browserPane.getWidth()+300);
+            //scrollPane.setPrefHeight(browserPane.getHeight());
+            //moviesGrid.setPrefWidth(scrollPane.getWidth()+300);
+            //moviesGrid.setPrefHeight(browserPane.getHeight());
+        }
+        gridResize();
+    }
+
+    public void gridResize()
+    {
+        if (!Objects.isNull(movies)) {
+            int colsAdd = ((int) scrollPane.getWidth()) / 200 - 2;
+            int cols = colsAdd + 2;
+
+            int rows = movies.length / cols + 1;
+            if (242 * rows < scrollPane.getHeight())
+                moviesGrid.setMinHeight(scrollPane.getHeight());
+            else
+                moviesGrid.setMinHeight(242 * rows);
+            moviesGrid.setMaxWidth(scrollPane.getWidth());
+            moviesGrid.setPrefWidth(scrollPane.getWidth());
+
+            moviesGrid.setAlignment(Pos.CENTER);
+            moviesGrid.setHgap(75);
+            moviesGrid.setVgap(25);
+
+            moviesGrid.getChildren().clear();
+            int k = 0;
+            for (int i = 0; i < rows; i++) {
+                for (int j = 0; j < cols; j++) {
+                    try {
+                        moviesGrid.getChildren().add(labelsMovies[k]);
+                    } catch (Exception err) {
+                        k++;
+                    }
+                    if (k == movies.length - 1)
+                        break;
+                    k++;
+                }
+            }
+        }
+    }
+
+    LogInController logInWindow;
+    public void openLoginForm() {
+
+        try {
+            FXMLLoader loader = new FXMLLoader(getClass().getResource("LogInController.fxml"));
+            Parent root = loader.load();
+            logInWindow = loader.getController();
+            logInWindow.stage = new Stage();
+            logInWindow.stage.setScene(new Scene(root, 250, 175));
+            logInWindow.stage.setUserData(loader);
+            logInWindow.open(this);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    public Boolean newArgLogin(String user, String pass){
+
+        Properties property = new Properties();
+        ConnectionParams temporalParams;
+        try {
+            FileInputStream fis = new FileInputStream("connection.properties");
+            property.load(fis);
+            temporalParams  = new ConnectionParams(property.getProperty("CONFIG_DEFAULT_HOST"), user, pass);
+        }
+        catch (IOException ex)
+        {
+            temporalParams  = new ConnectionParams("127.0.0.1/moviesdb", user, pass);
+        }
+
+        if (my_connector.tryConnection(temporalParams)){
+            workParams = temporalParams;
+            my_connector.initConnection(workParams);
+            setUserName(user);
+            return my_connector.initialized();
+        }
+        return false;
+    }
+
+    public void setUserName(String name){
+        userLabel.setText("Logged in as " + name);
+    }
+}

+ 26 - 415
src/com/moviesdb/Controller.java

@@ -1,448 +1,59 @@
 package com.moviesdb;
 
-import com.sun.javafx.collections.MappingChange;
-import javafx.event.EventHandler;
 import javafx.fxml.FXML;
-import javafx.geometry.HPos;
-import javafx.geometry.Pos;
-import javafx.geometry.VPos;
-import javafx.scene.Node;
 import javafx.scene.control.*;
 import javafx.scene.image.Image;
 import javafx.scene.image.ImageView;
-import javafx.scene.input.MouseEvent;
-import javafx.scene.layout.AnchorPane;
-import javafx.scene.layout.FlowPane;
-import javafx.scene.layout.GridPane;
-import javafx.scene.layout.Pane;
-import javafx.scene.control.Alert.AlertType;
-
-import com.moviesdb.Movie;
-import javafx.scene.text.Text;
-import javafx.scene.text.TextFlow;
-import com.moviesdb.DataBaseConnector;
-import javafx.stage.Modality;
 import javafx.stage.Stage;
-import javafx.scene.Parent;
-import javafx.scene.Scene;
-import javafx.fxml.FXMLLoader;
 
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.time.chrono.AbstractChronology;
-import java.util.*;
-//For reading properties from .properties file
-import com.moviesdb.ConnectionParams;
+import java.util.Objects;
 
 
 public class Controller {
-    @FXML
-    AnchorPane browserPane;
-    @FXML
-    MenuItem menuNew;
-    @FXML
-    FlowPane moviesGrid;
-    @FXML
-    ScrollPane scrollPane;
-    @FXML
-    AnchorPane detailsPane;
-    @FXML
-    TextFlow detailsContent;
-    @FXML
-    AnchorPane detailsPicPane;
-    @FXML
-    AnchorPane filterPane;
-    @FXML
-    Label button;
+
     @FXML
     Label minimizeButton;
-    @FXML
-    Label maximizeButton;
-    @FXML
-    Label closeButton;
-    @FXML
-    Label logInButton;
-    @FXML
-    Button logInButton2;
-    @FXML
-    MenuBar menuPane;
 
     @FXML
-    Label deleteMovieButton;
-    @FXML
-    Label editMovieButton;
+    Label maximizeButton;
 
     @FXML
-            TextField userTextBox;
-    @FXML
-            TextField passTextBox;
-    @FXML
-            TextFlow errorTextBox;
-    @FXML
-            Label userLabel;
-
-    Map<Label, Movie> map;
-    Label[] labelsMovies;
-    Movie[] movies;
-    Movie my_movie;
-    public DataBaseConnector my_connector;
-    ConnectionParams workParams;
-
-    double xOffset;
-    double yOffset;
-
-    public void initialize(Stage primaryStage){
-
-        ImageView minimizeImageView = new ImageView(new Image(getClass().getResourceAsStream("media\\minimize.png")));
-        minimizeImageView.setFitHeight(16);
-        minimizeImageView.setFitWidth(16);
-        minimizeButton.setGraphic(minimizeImageView);
-        minimizeButton.setOnMouseClicked(e-> {
-            primaryStage.setIconified(true);
-        });
-
-        ImageView maximizeImageView = new ImageView(new Image(getClass().getResourceAsStream("media\\maximize.png")));
-        maximizeImageView.setFitHeight(16);
-        maximizeImageView.setFitWidth(16);
-        maximizeButton.setGraphic(maximizeImageView);
-        maximizeButton.setOnMouseClicked(e-> {
-            primaryStage.setMaximized(!primaryStage.isMaximized());
-        });
-
-        ImageView CloseImageView = new ImageView(new Image(getClass().getResourceAsStream("media\\cancel.png")));
-        CloseImageView.setFitHeight(16);
-        CloseImageView.setFitWidth(16);
-        closeButton.setGraphic(CloseImageView);
-        closeButton.setOnMouseClicked(e-> {
-            primaryStage.close();
-        });
-
-        //Log in window open event
-        logInButton.setOnMouseClicked(e-> {
-            openLoginForm();
-        });
-
-        menuPane.setOnMousePressed(new EventHandler<javafx.scene.input.MouseEvent>() {
-            @Override
-            public void handle(MouseEvent event) {
-                xOffset = primaryStage.getX() - event.getScreenX();
-                yOffset = primaryStage.getY() - event.getScreenY();
-            }
-        });
-
-        menuPane.setOnMouseDragged(new EventHandler<MouseEvent>() {
-            @Override
-            public void handle(MouseEvent event) {
-                primaryStage.setX(event.getScreenX() + xOffset);
-                primaryStage.setY(event.getScreenY() + yOffset);
-            }
-        });
-
-
-        workParams = new ConnectionParams("connection.properties");
-        if (!workParams.initilized())
-            //TODO this is temporal handler
-            System.out.println(workParams.getInitilizeErrCause().toString());
-        else {
-            my_connector = new DataBaseConnector();
-            my_connector.initConnection(workParams);
-        }
-
-        System.out.println(my_connector.granted("USAGE"));
-        System.out.println(my_connector.granted("INSERT"));
-        System.out.println(my_connector.granted("UPDATE"));
-        System.out.println(my_connector.granted("DELETE"));
-
-
-    }
-
-    public void loadPosters()
-    {
-        //detailsPane.setMinWidth(300);
-        //get movies array
-        if (my_connector.initialized() & my_connector.granted("USAGE")) {
-            movies = my_connector.getMovies();
-            labelsMovies = new Label[movies.length];
-
-            map = new LinkedHashMap<Label, Movie>();
-            //
-            for (int i = 0; i < movies.length; i++) {
-                labelsMovies[i] = new Label();
-                ImageView image = new ImageView(movies[i].cover());
-
-                map.put(labelsMovies[i], movies[i]);
-
-                image.setFitHeight(222);
-                image.setFitWidth(150);
-                labelsMovies[i].setGraphic(image);
-                GridPane.setValignment(labelsMovies[i], VPos.CENTER);
-                GridPane.setHalignment(labelsMovies[i], HPos.CENTER);
-                Label movie = labelsMovies[i];
-                labelsMovies[i].setOnMouseClicked(e -> {
-                    openDetails(movie);
-                });
-            }
-            //moviesGrid.setPrefWidth(scrollPane.getWidth());
-            //clear old data in grid
-            moviesGrid.getChildren().clear();
-            //moviesGrid.setAlignment(Pos.CENTER);
-            //fill grid by movies
-            //moviesGrid.addRow(0, labelsMovies[0], labelsMovies[1]);
-            //moviesGrid.minHeight(moviesGrid.getMinHeight() + 222);
-            //moviesGrid.setPrefWidth(browserPane.getWidth()-26);
-            //moviesGrid.setMinHeight(scrollPane.getHeight());
-            gridResize();
-            //moviesGrid.setPrefHeight(moviesGrid.getHeight());
-        }
-    }
-
-    public void returnMessage()
-    {
-        Alert alert = new Alert(AlertType.CONFIRMATION, "Are you sure you want to format your system?");
-        alert.showAndWait().ifPresent(response -> {
-            if (response == ButtonType.OK) {
-            }
-        });
-    }
-
-    public void openDetails(Label e)
-    {
-        if (detailsPane.getMinWidth() < 1) {
-            //detailsInfoPane = new AnchorPane();
-            //detailsPicPane.getChildren().clear();
-
-            detailsPane.setMinWidth(300);
-            my_movie = map.get(e);
-            //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" +
-                                    "Year: \n    " + my_movie.year() + "\n" +
-                                    "Duration: \n    " + my_movie.duration() + "\n" +
-                                    "Genre: \n    " + my_movie.genre() + "\n" +
-                                    "Description: \n    " + my_movie.description());
-            info.setStyle("-fx-font-size: 14; -fx-fill: #9f9f9f;");
-            detailsContent.getChildren().clear();
-            detailsContent.getChildren().add(info);
-
-            detailsPicPane.getChildren().clear();
-            //detailsPane.setMaxWidth(300);
-            //Label movie = e;
-            ImageView detailsImage = new ImageView();
-
-
-            ImageView image = new ImageView((my_movie.cover()));
-            image.setFitHeight(222);
-            image.setFitWidth(150);
-
-            detailsImage = ((ImageView) image);
-            detailsImage.setX((detailsPane.getWidth() - detailsImage.getFitWidth()) / 2 + 100);
-            detailsImage.setY(0);
-            //movie.
-            detailsPicPane.getChildren().add(detailsImage);
-            // 300px is details window width
-            //scrollPane.setPrefWidth(browserPane.getWidth()-300);
-            //scrollPane.setPrefHeight(browserPane.getHeight());
-            //moviesGrid.setPrefWidth(browserPane.getWidth());
-            //moviesGrid.setPrefHeight(browserPane.getHeight());
-            //loadPosters();
-            if (my_connector.granted("DELETE")) {
-                deleteMovieButton.setDisable(false);
-                deleteMovieButton.setOpacity(1);
-                deleteMovieButton.setOnMouseClicked(ed -> {
-                    System.out.println("delete");
-                });
-
-            } else {
-                deleteMovieButton.setDisable(true);
-                deleteMovieButton.setOpacity(0);
-                deleteMovieButton.setOnMouseClicked(null);
-            }
-
-            if (my_connector.granted("UPDATE")) {
-                editMovieButton.setDisable(false);
-                editMovieButton.setOpacity(1);
-                editMovieButton.setOnMouseClicked(ed -> {
-                    System.out.println("edit");
-                });
-
-            } else {
-                editMovieButton.setDisable(true);
-                editMovieButton.setOpacity(0);
-                editMovieButton.setOnMouseClicked(null);
-            }
+    Label closeButton;
 
+    public Stage stage;
 
-            gridResize();
-            //button.setText(Double.toString(browserPane.getWidth()));
 
-        }
-        else
-        {
-            detailsPicPane.getChildren().clear();
-            detailsPane.setMinWidth(0);
-            detailsPane.setPrefWidth(0);
-            detailsPane.setMaxWidth(0);
-            // 300px is details window width
-            //scrollPane.setPrefWidth(browserPane.getWidth()+300);
-            //scrollPane.setPrefHeight(browserPane.getHeight());
-            //moviesGrid.setPrefWidth(scrollPane.getWidth()+300);
-            //moviesGrid.setPrefHeight(browserPane.getHeight());
-            //browserPane.setPrefWidth(browserPane.getWidth()+300);
-            gridResize();
-            //button.setText(Double.toString(browserPane.getWidth()));
-        }
+    public void prepare() {
+        setWindowControlImage(minimizeButton, "media\\minimize.png");
+        setWindowControlImage(maximizeButton, "media\\maximize.png");
+        setWindowControlImage(closeButton, "media\\cancel.png");
     }
 
-    public void closeDetails()
-    {
-        detailsPicPane.getChildren().clear();
-        detailsPane.setMinWidth(1);
-        detailsPane.setPrefWidth(1);
+    @FXML
+    private void closeStage(){
+        stage.close();
     }
 
-    public void openFilter()
-    {
-        if (filterPane.getWidth() < 1)
-        {
-            //filterPane.maxWidth(300);
-            filterPane.setMinWidth(300);
-            filterPane.setPrefWidth(300);
-            filterPane.setMaxWidth(300);
-            //loadPosters();
-            // 300px is filter window width
-            //scrollPane.setPrefWidth(browserPane.getWidth()-300);
-            //scrollPane.setPrefHeight(browserPane.getHeight());
-            //moviesGrid.setPrefWidth(browserPane.getWidth() -300);
-            //moviesGrid.setPrefHeight(browserPane.getHeight());
-            gridResize();
-        }
-        else
-        {
-            filterPane.setMinWidth(0);
-            filterPane.setPrefWidth(0);
-            filterPane.setMaxWidth(0);
-            //loadPosters();
-            // 300px is filter window width
-            //scrollPane.setPrefWidth(browserPane.getWidth()+300);
-            //scrollPane.setPrefHeight(browserPane.getHeight());
-            //moviesGrid.setPrefWidth(scrollPane.getWidth()+300);
-            //moviesGrid.setPrefHeight(browserPane.getHeight());
-            gridResize();
-        }
+    @FXML
+    private void maximizeStageChange(){
+        stage.setMaximized(!stage.isMaximized());
     }
 
-    public void gridResize()
-    {
-        int colsAdd = ((int)scrollPane.getWidth())/200 - 2;
-        int cols = colsAdd + 2;
-
-        int rows = movies.length / cols + 1;
-        if (242*rows<scrollPane.getHeight())
-            moviesGrid.setMinHeight(scrollPane.getHeight());
-        else
-            moviesGrid.setMinHeight(242*rows);
-        moviesGrid.setMaxWidth(scrollPane.getWidth());
-        moviesGrid.setPrefWidth(scrollPane.getWidth());
-
-        moviesGrid.setAlignment(Pos.CENTER);
-        moviesGrid.setHgap( 75);
-        moviesGrid.setVgap( 25);
-
-        moviesGrid.getChildren().clear();
-        int k = 0;
-        for(int i = 0; i < rows; i++)
-        {
-            for (int j = 0; j < cols; j++)
-            {
-                try {
-                    moviesGrid.getChildren().add(labelsMovies[k]);
-                }
-                catch (Exception err)
-                {
-                    k++;
-                }
-                if(k == movies.length - 1)
-                    break;
-                k++;
-            }
-        }
+    @FXML
+    private void minimizeStage(){
+        stage.setIconified(true);
     }
 
-    public void openLoginForm(){
-
-        Parent root;
+    private void setWindowControlImage(Label target, String imagePath){
         try {
-            FXMLLoader loader = new FXMLLoader();
-            loader.setLocation(getClass().getResource("test.fxml"));
-            root = loader.load();
-            //root = FXMLLoader.load(getClass().getClassLoader().getResource("test.fxml"));
-            Stage stage = new Stage();
-            stage.initModality(Modality.WINDOW_MODAL);
-            stage.initOwner(browserPane.getScene().getWindow());
-            stage.setTitle("Log in");
-            stage.setScene(new Scene(root, 250, 175));
-            stage.show();
-            // Hide this current window (if this is what you want)
-            //((Node)(event.getSource())).getScene().getWindow().hide();
-        }
-        catch (IOException e) {
+            if (!Objects.isNull(target)) {
+                ImageView CloseImageView = new ImageView(new Image(Objects.requireNonNull(getClass().getResourceAsStream(imagePath))));
+                CloseImageView.setFitHeight(16);
+                CloseImageView.setFitWidth(16);
+                target.setGraphic(CloseImageView);
+            }
+        } catch (NullPointerException e) {
             e.printStackTrace();
         }
-
-        //if (!newArgLogin())
-        //    System.out.println("Login error!");
-        //else
-        //    closeLoginForm();
-    }
-
-    public void closeLoginForm(){
-
-        Stage stage = (Stage) logInButton2.getScene().getWindow();
-        Stage parent = (Stage) stage.getOwner();
-        Controller controller = new Controller();
-        FXMLLoader loader = (FXMLLoader) parent.getUserData();
-        controller = loader.getController();
-         //controller.initialize(parent);
-        if(controller.newArgLogin(userTextBox.getText(), passTextBox.getText())) {
-            controller.loadPosters();
-            controller.closeDetails();
-            stage.close();
-        }
-        else
-        {
-            Text errorMessage = new Text("Incorrect login or password!");
-            errorMessage.setStyle("-fx-font-size: 14; -fx-fill: #FF0000;");
-            errorTextBox.getChildren().clear();
-            errorTextBox.getChildren().add(errorMessage);
-        }
-        //System.out.println("LoginForm closed");
-    }
-
-    private Boolean newArgLogin(String user, String pass){
-
-        Properties property = new Properties();
-        ConnectionParams temporalParams;
-        try {
-            FileInputStream fis = new FileInputStream("connection.properties");
-            property.load(fis);
-            temporalParams  = new ConnectionParams(property.getProperty("CONFIG_DEFAULT_HOST"), user, pass);
-        }
-        catch (IOException ex)
-        {
-            temporalParams  = new ConnectionParams("127.0.0.1/moviesdb", user, pass);
-        }
-
-        if (my_connector.tryConnection(temporalParams)){
-            workParams = temporalParams;
-            my_connector.initConnection(workParams);
-            setUserName(user);
-            return my_connector.initialized();
-        }
-        return false;
-    }
-
-    public void setUserName(String name){
-        userLabel.setText("Logged in as " + name);
     }
 }

+ 77 - 0
src/com/moviesdb/LogInController.fxml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Copyright (c) 2015, 2019, Gluon and/or its affiliates.
+  All rights reserved. Use is subject to license terms.
+
+  This file is available and licensed under the following license:
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  - Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+  - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the distribution.
+  - Neither the name of Oracle Corporation nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.Pane?>
+<?import javafx.scene.text.Font?>
+<?import javafx.scene.text.TextFlow?>
+
+<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="175.0" prefWidth="250.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.LogInController">
+   <children>
+      <Label layoutX="14.0" layoutY="14.0" text="Log in" textFill="#9f9f9f">
+         <font>
+            <Font size="24.0" />
+         </font>
+      </Label>
+      <TextField fx:id="userTextBox1" layoutX="80.0" layoutY="49.0" style="-fx-background-color: #121212; -fx-text-fill: #9f9f9f;" />
+      <TextField fx:id="passTextBox1" layoutX="80.0" layoutY="92.0" style="-fx-background-color: #121212; -fx-text-fill: #9f9f9f;" />
+      <Label layoutX="14.0" layoutY="55.0" text="Username" textFill="#9f9f9f">
+         <font>
+            <Font size="14.0" />
+         </font></Label>
+      <Label layoutX="14.0" layoutY="96.0" text="Password" textFill="#9f9f9f">
+         <font>
+            <Font size="14.0" />
+         </font></Label>
+      <Button fx:id="logInButton21" layoutX="190.0" layoutY="141.0" mnemonicParsing="false" onMouseClicked="#closeLoginForm" style="-fx-background-color: #9f9f9f;" text="Sign in" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="15.0" />
+      <Pane layoutX="80.0" layoutY="75.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
+      <Pane layoutX="80.0" layoutY="117.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
+      <TextFlow fx:id="errorTextBox" layoutX="14.0" layoutY="134.0" prefHeight="25.0" prefWidth="159.0" />
+      <Label fx:id="closeButton" layoutX="221.0" layoutY="14.0" onMouseClicked="#closeStage" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="4.0">
+         <font>
+            <Font name="Arimo" size="12.0" />
+         </font>
+      </Label>
+
+      <Label fx:id="minimizeButton" layoutX="201.0" layoutY="4.0" onMouseClicked="#minimizeStage" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="24.0" AnchorPane.topAnchor="4.0">
+         <font>
+            <Font name="Arimo" size="12.0" />
+         </font>
+      </Label>
+
+   </children>
+</AnchorPane>

+ 50 - 0
src/com/moviesdb/LogInController.java

@@ -0,0 +1,50 @@
+package com.moviesdb;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.*;
+
+import javafx.scene.text.Text;
+import javafx.scene.text.TextFlow;
+
+import javafx.stage.Modality;
+
+//For reading properties from .properties file
+
+public class LogInController extends Controller {
+
+    @FXML
+    Button logInButton21;
+    @FXML
+    TextField userTextBox1;
+    @FXML
+    TextField passTextBox1;
+    @FXML
+    TextFlow errorTextBox;
+
+    Object caller;
+
+    public void open(Object caller) {
+        prepare();
+        stage.initModality(Modality.WINDOW_MODAL);
+        stage.initOwner(((BrowserController)caller).stage.getScene().getWindow());
+        this.caller = caller;
+        stage.setTitle("Log in");
+        stage.show();
+    }
+
+    public void closeLoginForm(){
+        if(((BrowserController)caller).newArgLogin(userTextBox1.getText(), passTextBox1.getText())) {
+            ((BrowserController)caller).loadPosters();
+            ((BrowserController)caller).closeDetails();
+            stage.close();
+        }
+        else
+        {
+            Text errorMessage = new Text("Incorrect login or password!");
+            errorMessage.setStyle("-fx-font-size: 14; -fx-fill: #FF0000;");
+            errorTextBox.getChildren().clear();
+            errorTextBox.getChildren().add(errorMessage);
+        }
+        //System.out.println("LoginForm closed");
+    }
+}

+ 5 - 7
src/com/moviesdb/Main.java

@@ -7,8 +7,6 @@ import javafx.event.EventHandler;
 import javafx.fxml.FXMLLoader;
 import javafx.scene.Parent;
 import javafx.scene.Scene;
-import javafx.scene.input.MouseEvent;
-import javafx.scene.layout.GridPane;
 import javafx.stage.Stage;
 import javafx.stage.StageStyle;
 import javafx.stage.WindowEvent;
@@ -25,23 +23,23 @@ public class Main extends Application {
         primaryStage.setUserData(loader);
         primaryStage.setTitle("Hello World");
         primaryStage.setScene(new Scene(root, 1280, 720));
-        Controller controller = loader.getController();
+        BrowserController browserController = loader.getController();
         primaryStage.setOnShown(new EventHandler<WindowEvent>() {
             @Override
             public void handle(WindowEvent event) {
-                controller.initialize(primaryStage);
-                controller.loadPosters();
+                browserController.initialize(primaryStage);
+                browserController.loadPosters();
             }
         });
 
         primaryStage.widthProperty().addListener(new ChangeListener<Number>() {
             @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneWidth, Number newSceneWidth) {
-                controller.gridResize();
+                browserController.gridResize();
             }
         });
         primaryStage.heightProperty().addListener(new ChangeListener<Number>() {
             @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneHeight, Number newSceneHeight) {
-                controller.gridResize();
+                browserController.gridResize();
             }
         });
 

+ 1 - 1
src/com/moviesdb/sample.fxml

@@ -3,7 +3,7 @@
 
 <?import javafx.scene.control.Button?>
 <?import javafx.scene.control.Label?>
-<GridPane fx:controller="com.moviesdb.Controller"
+<GridPane fx:browserController="com.moviesdb.BrowserController"
           xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10">
     <Label fx:id="mainTitle" text="Hello world!"/>
 </GridPane>

+ 11 - 2
src/com/moviesdb/test.fxml

@@ -40,8 +40,12 @@
 <?import javafx.scene.text.Font?>
 <?import javafx.scene.text.TextFlow?>
 
-<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="175.0" prefWidth="250.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.Controller">
+<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="175.0" prefWidth="250.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.BrowserController">
    <children>
+      <Label fx:id="closeButton" layoutX="221.0" layoutY="14.0" prefHeight="16.0" prefWidth="16.0" style="-fx-background-color: #FFFFFF;" text=" X" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="4.0">
+         <font>
+            <Font name="Arimo" size="12.0" />
+         </font></Label>
       <Label layoutX="14.0" layoutY="14.0" text="Log in" textFill="#9f9f9f">
          <font>
             <Font size="24.0" />
@@ -57,9 +61,14 @@
          <font>
             <Font size="14.0" />
          </font></Label>
-      <Button fx:id="logInButton2" layoutX="190.0" layoutY="141.0" mnemonicParsing="false" onMouseClicked="#closeLoginForm" style="-fx-background-color: #9f9f9f;" text="Sign in" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="15.0" />
+      <Button fx:id="logInButton2" layoutX="190.0" layoutY="141.0" mnemonicParsing="false" style="-fx-background-color: #9f9f9f;" text="Sign in" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="15.0" />
       <Pane layoutX="80.0" layoutY="75.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
       <Pane layoutX="80.0" layoutY="117.0" prefHeight="3.0" prefWidth="149.0" style="-fx-background-color: #9f9f9f;" />
       <TextFlow fx:id="errorTextBox" layoutX="14.0" layoutY="134.0" prefHeight="25.0" prefWidth="159.0" />
+      <Label fx:id="minimizeButton" layoutX="201.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" style="-fx-background-color: #FFFFFF;" text=" -- " AnchorPane.rightAnchor="24.0" AnchorPane.topAnchor="4.0">
+         <font>
+            <Font name="Arimo" size="12.0" />
+         </font>
+      </Label>
    </children>
 </AnchorPane>

+ 4 - 4
src/com/moviesdb/test2.fxml

@@ -50,7 +50,7 @@
 <?import javafx.scene.text.Font?>
 <?import javafx.scene.text.TextFlow?>
 
-<VBox prefHeight="600.0" prefWidth="900.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.Controller">
+<VBox prefHeight="600.0" prefWidth="900.0" style="-fx-background-color: #121212;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.BrowserController">
   <children>
       <AnchorPane prefHeight="25.0" prefWidth="900.0">
          <children>
@@ -73,9 +73,9 @@
                 </Menu>
               </menus>
             </MenuBar>
-            <Label fx:id="closeButton" layoutX="876.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="8.0" AnchorPane.topAnchor="4.0" />
-            <Label fx:id="maximizeButton" layoutX="854.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="30.0" AnchorPane.topAnchor="4.0" />
-            <Label fx:id="minimizeButton" layoutX="832.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="52.0" AnchorPane.topAnchor="4.0" />
+            <Label fx:id="closeButton" onMouseClicked="#closeStage" layoutX="876.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="8.0" AnchorPane.topAnchor="4.0" />
+            <Label fx:id="maximizeButton" onMouseClicked="#maximizeStageChange" layoutX="854.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="30.0" AnchorPane.topAnchor="4.0" />
+            <Label fx:id="minimizeButton" onMouseClicked="#minimizeStage" layoutX="832.0" layoutY="4.0" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="52.0" AnchorPane.topAnchor="4.0" />
          </children>
       </AnchorPane>
     <SplitPane dividerPositions="0.3392857142857143, 0.9955357142857143" focusTraversable="true" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: #121212; -fx-border-color: #121212;" stylesheets="@style.css" VBox.vgrow="ALWAYS">