浏览代码

Fixed moviesGrid size on resizing, add Edit window, GenreStats window.

Veloe 4 年之前
父节点
当前提交
cfd80d3469

+ 169 - 59
src/main/java/com/moviesdb/BrowserController.java

@@ -65,16 +65,37 @@ public class BrowserController extends Controller {
     Label editMovieButton;
 
     @FXML
-            TextField userTextBox;
+    TextField userTextBox;
     @FXML
-            TextField passTextBox;
+    TextField passTextBox;
     @FXML
-            TextFlow errorTextBox;
+    TextFlow errorTextBox;
     @FXML
-            Label userLabel;
+    Label userLabel;
     @FXML
     Polyline resizerPoly;
 
+    @FXML
+    TextField titleTextBox;
+    @FXML
+    TextField genreTextBox;
+    @FXML
+    TextArea descriptionTextBox;
+    @FXML
+    TextField yearTextBox;
+    @FXML
+    TextField timeTextBox;
+    @FXML
+    TextField studioTextBox;
+    @FXML
+    TextField directorTextBox;
+    @FXML
+    TextField rateTextBox;
+    @FXML
+            TextField actorTextBox;
+    @FXML
+            TextField roleTextBox;
+
     Map<Label, Movie> map;
     Label[] labelsMovies;
     Movie[] movies;
@@ -94,7 +115,7 @@ public class BrowserController extends Controller {
     int detailsWidth = 300;
     int filterWidth = 300;
 
-    public void initialize(Stage primaryStage){
+    public void initialize(Stage primaryStage) {
         prepare();
         stage = primaryStage;
 
@@ -126,7 +147,7 @@ public class BrowserController extends Controller {
             @Override
             public void handle(MouseEvent event) {
 
-                primaryStage.setWidth(event.getScreenX()  + xOffset);
+                primaryStage.setWidth(event.getScreenX() + xOffset);
                 primaryStage.setHeight(event.getScreenY() + yOffset);
             }
         });
@@ -149,8 +170,7 @@ public class BrowserController extends Controller {
 
     }
 
-    public void loadPosters()
-    {
+    public void loadPosters() {
         if (my_connector.initialized() & my_connector.granted("INSERT")) {
             addMenu.setDisable(false);
         } else
@@ -193,8 +213,46 @@ public class BrowserController extends Controller {
         }
     }
 
-    public void returnMessage()
-    {
+    public void loadPosters(Movie[] filteredMovies) {
+        //detailsPane.setMinWidth(300);
+        //get movies array
+        if (my_connector.initialized() & (my_connector.granted("USAGE") || my_connector.granted("SELECT"))) {
+            movies = filteredMovies;
+            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(imageHeight);
+                image.setFitWidth(imageWidth);
+                labelsMovies[i].setGraphic(image);
+                GridPane.setValignment(labelsMovies[i], VPos.TOP);
+                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) {
@@ -203,8 +261,8 @@ public class BrowserController extends Controller {
     }
 
     private int detailsViewingNow;
-    public void openDetails(Label e)
-    {
+
+    public void openDetails(Label e) {
         if (detailsPane.getMinWidth() < 1 || detailsViewingNow != map.get(e).id()) {
             //detailsInfoPane = new AnchorPane();
             //detailsPicPane.getChildren().clear();
@@ -219,10 +277,10 @@ public class BrowserController extends Controller {
 
             //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());
+                    "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);
@@ -237,7 +295,7 @@ public class BrowserController extends Controller {
             image.setFitHeight(imageHeight);
             image.setFitWidth(imageWidth);
 
-           //movie.
+            //movie.
 
 
             detailsPicPane.setImage(my_movie.cover());
@@ -251,7 +309,7 @@ public class BrowserController extends Controller {
                 double ratioY = detailsPicPane.getFitHeight() / img.getHeight();
 
                 double reducCoeff = 0;
-                if(ratioX >= ratioY) {
+                if (ratioX >= ratioY) {
                     reducCoeff = ratioY;
                 } else {
                     reducCoeff = ratioX;
@@ -285,6 +343,7 @@ public class BrowserController extends Controller {
                 editMovieButton.setOpacity(1);
                 editMovieButton.setOnMouseClicked(ed -> {
                     System.out.println("edit");
+                    openEditForm();
                 });
 
             } else {
@@ -294,14 +353,12 @@ public class BrowserController extends Controller {
             }
 
             if (isOpen)
-                gridResize(scrollPane.getWidth() , detailsPane.getMinWidth());
+                gridResize(scrollPane.getWidth(), detailsPane.getMinWidth());
             else
                 gridResize((scrollPane.getWidth() - detailsPane.getMinWidth()), detailsPane.getMinWidth());
             //button.setText(Double.toString(browserPane.getWidth()));
 
-        }
-        else
-        {
+        } else {
             //detailsPicPane.getChildren().clear();
             double oldDetailsWidth = detailsPane.getMinWidth();
             detailsPane.setMinWidth(0);
@@ -318,17 +375,14 @@ public class BrowserController extends Controller {
         }
     }
 
-    public void closeDetails()
-    {
+    public void closeDetails() {
         //detailsPicPane.getChildren().clear();
         detailsPane.setMinWidth(1);
         detailsPane.setPrefWidth(1);
     }
 
-    public void openFilter()
-    {
-        if (filterPane.getWidth() < 1)
-        {
+    public void openFilter() {
+        if (filterPane.getWidth() < 1) {
             //filterPane.maxWidth(300);
             filterPane.setMinWidth(filterWidth);
             filterPane.setPrefWidth(filterWidth);
@@ -341,9 +395,7 @@ public class BrowserController extends Controller {
             //moviesGrid.setPrefHeight(browserPane.getHeight());
             gridResize(scrollPane.getWidth() - filterPane.getWidth(), filterPane.getWidth());
 
-        }
-        else
-        {
+        } else {
             double oldFilterWidth = filterPane.getWidth();
             filterPane.setMinWidth(0);
             filterPane.setPrefWidth(0);
@@ -359,8 +411,7 @@ public class BrowserController extends Controller {
 
     }
 
-    public void gridResize(double scrollWidth, double influencePaneWidth)
-    {
+    public void gridResize(double scrollWidth, double influencePaneWidth) {
         if (!Objects.isNull(movies)) {
 
             moviesGrid.setAlignment(Pos.TOP_CENTER);
@@ -372,23 +423,21 @@ public class BrowserController extends Controller {
             int rows;
             try {
                 rows = movies.length / cols;
-            }
-            catch (ArithmeticException ex)
-            {
-                cols =  (((int) (scrollWidth + influencePaneWidth)) + (int) moviesGrid.getHgap()) / (imageWidth + (int) moviesGrid.getHgap());
+            } catch (ArithmeticException ex) {
+                cols = (((int) (scrollWidth + influencePaneWidth)) + (int) moviesGrid.getHgap()) / (imageWidth + (int) moviesGrid.getHgap());
                 rows = movies.length / cols;
 
             }
             if (movies.length % cols != 0)
                 rows++;
 
-            if (imageHeight * rows + (moviesGrid.getVgap()*(rows - 1)) < scrollPane.getHeight())
+            if (imageHeight * rows + (moviesGrid.getVgap() * (rows - 1)) < scrollPane.getHeight())
                 moviesGrid.setMinHeight(scrollPane.getHeight());
             else
-                moviesGrid.setMinHeight(imageHeight * rows + (moviesGrid.getVgap()*(rows - 1)));
+                moviesGrid.setMinHeight(imageHeight * rows + (moviesGrid.getVgap() * (rows - 1)));
 
-            System.out.println("grid height:" + moviesGrid.getHeight() );
-            System.out.println("scroll width:" + scrollWidth );
+            System.out.println("grid height:" + moviesGrid.getHeight());
+            System.out.println("scroll width:" + scrollWidth);
             System.out.println("cols: " + cols);
             System.out.println("rows: " + rows);
 
@@ -403,13 +452,12 @@ public class BrowserController extends Controller {
                 moviesGrid.getChildren().add(labelsMovies[i]);
 
             }
-            moviesGrid.autosize();
+            //moviesGrid.autosize();
 
         }
     }
 
-    public void gridResize( )
-    {
+    public void gridResize() {
         if (!Objects.isNull(movies)) {
 
             moviesGrid.setAlignment(Pos.TOP_CENTER);
@@ -421,21 +469,19 @@ public class BrowserController extends Controller {
             int rows;
             try {
                 rows = movies.length / cols;
-            }
-            catch (ArithmeticException ex)
-            {
+            } catch (ArithmeticException ex) {
                 //this is unreachable
-                cols =  (((int) scrollPane.getWidth() + 300) + (int) moviesGrid.getHgap()) / (imageWidth + (int) moviesGrid.getHgap());
+                cols = (((int) scrollPane.getWidth() + 300) + (int) moviesGrid.getHgap()) / (imageWidth + (int) moviesGrid.getHgap());
                 rows = movies.length / cols;
 
             }
             if (movies.length % cols != 0)
                 rows++;
 
-            if (imageHeight * rows + (moviesGrid.getVgap()*(rows - 1)) < scrollPane.getHeight())
+            if (imageHeight * rows + (moviesGrid.getVgap() * (rows - 1)) < scrollPane.getHeight())
                 moviesGrid.setMinHeight(scrollPane.getHeight());
             else
-                moviesGrid.setMinHeight(imageHeight * rows + (moviesGrid.getVgap()*(rows - 1)));
+                moviesGrid.setMinHeight(imageHeight * rows + (moviesGrid.getVgap() * (rows - 1)));
 
             //System.out.println("scroll width:" + scrollWidth );
             System.out.println("cols: " + cols);
@@ -458,6 +504,7 @@ public class BrowserController extends Controller {
     }
 
     LogInController logInWindow;
+
     public void openLoginForm() {
 
         try {
@@ -474,7 +521,9 @@ public class BrowserController extends Controller {
         }
 
     }
+
     AddMovieController addWindow;
+
     public void openAddForm() {
 
         try {
@@ -483,7 +532,7 @@ public class BrowserController extends Controller {
             addWindow = loader.getController();
             addWindow.stage = new Stage();
             addWindow.stage.setScene(new Scene(root, 629, 561));
-            addWindow.stage.initStyle(StageStyle.UNDECORATED );
+            addWindow.stage.initStyle(StageStyle.UNDECORATED);
             addWindow.stage.setMinWidth(629); //+16
             addWindow.stage.setMinHeight(561); //+31+16
             addWindow.stage.setUserData(loader);
@@ -523,6 +572,47 @@ public class BrowserController extends Controller {
         }
     }
 
+    EditMovieController editWindow;
+
+    public void openEditForm() {
+
+        try {
+            FXMLLoader loader = new FXMLLoader(getClass().getResource("../../EditMovieWindow.fxml"));
+            Parent root = loader.load();
+            editWindow = loader.getController();
+            editWindow.stage = new Stage();
+            editWindow.stage.setScene(new Scene(root, 629, 561));
+            editWindow.stage.initStyle(StageStyle.UNDECORATED);
+            editWindow.stage.setMinWidth(629); //+16
+            editWindow.stage.setMinHeight(561); //+31+16
+            editWindow.stage.setUserData(loader);
+            editWindow.open(this);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    GenreStatisticsController statsWindow;
+
+    public void openStatsForm() {
+
+        try {
+            FXMLLoader loader = new FXMLLoader(getClass().getResource("../../GenreStatisticsWindow.fxml"));
+            Parent root = loader.load();
+            statsWindow = loader.getController();
+            statsWindow.stage = new Stage();
+            statsWindow.stage.setScene(new Scene(root, 500, 500));
+            statsWindow.stage.setUserData(loader);
+            statsWindow.open(this);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+
     /*AdditionController altAddition;
     public void openAltAddForm(){
         try {
@@ -539,21 +629,19 @@ public class BrowserController extends Controller {
         }
     }
 */
-    public Boolean newArgLogin(String user, String pass){
+    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);
+            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)){
+        if (my_connector.tryConnection(temporalParams)) {
             workParams = temporalParams;
             my_connector.initConnection(workParams);
             setUserName(user);
@@ -562,7 +650,29 @@ public class BrowserController extends Controller {
         return false;
     }
 
-    public void setUserName(String name){
+    public void setUserName(String name) {
         userLabel.setText("Logged in as " + name);
     }
+
+    public int getDetailsViewingNow() {
+        return detailsViewingNow;
+    }
+
+    public void getFilterMovies()
+    {
+        Movie filterMovie = new Movie();
+
+        filterMovie.setName(titleTextBox.getText());
+        filterMovie.setGenre(genreTextBox.getText());
+        filterMovie.setYear(yearTextBox.getText());
+        filterMovie.setDuration(timeTextBox.getText());
+        filterMovie.setStudio(studioTextBox.getText());
+        filterMovie.setDirector(directorTextBox.getText());
+        filterMovie.setRating(rateTextBox.getText());
+        filterMovie.setDescription(descriptionTextBox.getText());
+
+        movies = my_connector.filterMovie(filterMovie, actorTextBox.getText(), roleTextBox.getText());
+        loadPosters(movies);
+
+    }
 }

+ 137 - 0
src/main/java/com/moviesdb/DataBaseConnector.java

@@ -1,5 +1,10 @@
 package com.moviesdb;
 
+import com.google.protobuf.Internal;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.scene.chart.PieChart;
+
 import java.sql.*;
 import java.util.ArrayList;
 import java.util.List;
@@ -355,4 +360,136 @@ public class DataBaseConnector {
         return connRights.contains(grantName);
     }
 
+    public Movie[] filterMovie(Movie filterMovie, String actor, String role) {
+        ResultSet rs = null;
+        try {
+            //Statement statement = conn.createStatement();
+            String req;
+
+            String intoPart = "";
+
+            if (!filterMovie.name().equals("Movie_name_undefined")) {
+                intoPart += "AND `name` LIKE '" + filterMovie.name() + "%' ";
+            }
+
+            if (!filterMovie.genre().equals("Movie_genre_undefined")) {
+                intoPart += "AND `genre` LIKE '" + filterMovie.genre() + "%' ";
+            }
+
+            if (!filterMovie.description().equals("Movie_description_undefined")) {
+                intoPart += "AND `description` LIKE '" + filterMovie.description() + "%' ";
+            }
+
+            if (!filterMovie.duration().equals("Movie_duration_undefined")) {
+                intoPart += "AND `duration` LIKE '" + filterMovie.duration() + "%' ";
+            }
+
+            if (!filterMovie.rating().equals("Movie_rating_undefined")) {
+                intoPart += "AND `user_rating` LIKE '" + filterMovie.rating() + "%' ";
+            }
+
+            if (!filterMovie.year().equals("Movie_year_undefined")) {
+                intoPart += "AND `year` LIKE '" + filterMovie.year() + "%' ";
+            }
+
+            if (!filterMovie.studio().equals("Movie_studio_undefined")) {
+                intoPart += "AND `studio` LIKE '" + filterMovie.studio() + "%' ";
+            }
+
+            if (!filterMovie.director().equals("Movie_director_undefined")) {
+                intoPart += "AND `director` LIKE '" + filterMovie.director() + "%' ";
+            }
+
+            if ((actor != "")) {
+                intoPart += "AND `actor` LIKE '" + actor + "%' ";
+            }
+
+            if ((role != "")) {
+                intoPart += "AND `role` LIKE '" + role + "%' ";
+            }
+
+            //if (intoPart.charAt(intoPart.length() - 1) == ',')
+            //    intoPart = intoPart.substring(0, intoPart.length() - 1);
+
+            //сборка текста запроса
+
+            req = "SELECT DISTINCT Movies.id FROM moviesdb.Roles, moviesdb.Movies";
+            if (actor != "" || role != "")
+                req += " WHERE (moviesdb.Movies.id = moviesdb.Roles.movie_id " + intoPart +  ")";
+            else
+
+                if(intoPart.length() > 3) {
+                    intoPart = intoPart.substring(3, intoPart.length());
+                    req += " WHERE (" + intoPart + ")";
+                }
+
+            req+=";";
+            System.out.println(req);
+            //выполнение запроса
+            Statement statement = conn.prepareStatement(req, ResultSet.TYPE_SCROLL_SENSITIVE,
+                    ResultSet.CONCUR_UPDATABLE);
+            rs = statement.executeQuery(req);
+        } catch (SQLException ex) {
+            ex.printStackTrace();
+        }
+
+        List<Integer> movies_id = new ArrayList<Integer>();
+        if (rs != null) {
+            try {
+                rs.first();
+                movies_id.add(rs.getInt("id"));
+                while (rs.next())
+                {
+                    movies_id.add(rs.getInt("id"));
+                }
+            }
+            catch (SQLException ex)
+            {
+                System.out.println(ex.getMessage());
+            }
+        }
+
+        Movie[] filteredMovies = new Movie[movies_id.size()];
+
+        for (int i = 0; i < movies_id.size(); i++) {
+            filteredMovies[i] = getMovieInfo(movies_id.get(i));
+        }
+        System.out.println(filteredMovies.length);
+        return filteredMovies;
+    }
+
+    public ObservableList<PieChart.Data> getGenreStats()
+    {
+        ObservableList<PieChart.Data> list = FXCollections.observableArrayList();
+
+        try
+        {
+            Statement statement = conn.prepareStatement("SELECT count(id) AS number, genre FROM moviesdb.Movies GROUP BY genre;", ResultSet.TYPE_SCROLL_SENSITIVE,
+                    ResultSet.CONCUR_UPDATABLE);
+            String req = "SELECT count(id) AS number, genre FROM moviesdb.Movies GROUP BY genre;";
+            ResultSet rs = statement.executeQuery(req);
+            rs.last();
+            int Count = rs.getRow();
+
+            rs.first();
+
+
+            for (int i = 0; i < Count; i++)
+            {
+                String name = rs.getString("genre");
+                if (name == null)
+                    name = "Empty";
+                list.add(new PieChart.Data(name, rs.getInt("number")));
+                rs.next();
+            }
+
+
+        }
+        catch (SQLException ex) {
+            //exception
+            ex.printStackTrace();
+        }
+        return  list;
+    }
+
 }

+ 294 - 0
src/main/java/com/moviesdb/EditMovieController.java

@@ -0,0 +1,294 @@
+package com.moviesdb;
+
+import javafx.event.EventHandler;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Node;
+import javafx.scene.control.*;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import javafx.stage.Modality;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+//For reading properties from .properties file
+
+public class EditMovieController extends Controller {
+
+    @FXML
+    Button addActorButton;
+
+    @FXML
+    AnchorPane borderTop;
+
+    @FXML
+    Pane borderLeft;
+    @FXML
+    Pane borderRight;
+    @FXML
+    Pane borderBottom;
+
+    @FXML
+    ScrollPane actorsGrid;
+    @FXML
+    VBox actorsGridAncor;
+
+    @FXML
+    TextField urlTextBox;
+    @FXML
+    TextField titleTextBox;
+    @FXML
+    TextField genreTextBox;
+    @FXML
+    TextArea descriptionTextBox;
+    @FXML
+    TextField yearTextBox;
+    @FXML
+    TextField timeTextBox;
+    @FXML
+    TextField studioTextBox;
+    @FXML
+    TextField directorTextBox;
+    @FXML
+    TextField rateTextBox;
+
+    @FXML
+    Label actorLabel;
+    @FXML
+    Pane actorUnderline;
+    @FXML
+    Label roleLabel;
+    @FXML
+    Pane roleUnderline;
+    @FXML
+    Label buttonRowAdd;
+    @FXML
+    Label buttonRowRem;
+
+
+    Object caller;
+    double xOffset;
+    double yOffset;
+
+    double basePos;
+    double baseWidth;
+
+    Movie editableMovie;
+
+
+    public void open(Object caller) {
+        prepare();
+        borderTop.setOnMousePressed(pressEvent -> {
+            borderTop.setOnMouseDragged(dragEvent -> {
+                stage.setX(dragEvent.getScreenX() - pressEvent.getSceneX());
+                stage.setY(dragEvent.getScreenY() - pressEvent.getSceneY());
+            });
+        });
+
+        borderLeft.setOnMousePressed(new EventHandler<MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+                xOffset = stage.getWidth() + event.getScreenX();
+                basePos = event.getScreenX();
+                baseWidth = stage.getWidth();
+            }
+        });
+
+        borderLeft.setOnMouseDragged(new EventHandler<MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+                if ((xOffset - event.getScreenX()) >= stage.getMinWidth()) {
+                    stage.setWidth(xOffset - event.getScreenX());
+                    stage.setX(event.getScreenX());
+                } else {
+                    stage.setX(xOffset - stage.getMinWidth());
+                    stage.setWidth(stage.getMinWidth());
+                }
+            }
+        });
+
+        borderBottom.setOnMousePressed(new EventHandler<MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+                yOffset = stage.getHeight() - event.getScreenY();
+            }
+        });
+
+
+        borderBottom.setOnMouseDragged(new EventHandler<MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+
+                //stage.setWidth(event.getScreenX()  + xOffset);
+                if (event.getScreenY() + yOffset >= stage.getMinHeight())
+                    stage.setHeight(event.getScreenY() + yOffset);
+                else
+                    stage.setHeight(stage.getMinHeight());
+            }
+        });
+
+        borderRight.setOnMousePressed(new EventHandler<MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+                xOffset = stage.getWidth() - event.getScreenX();
+            }
+        });
+
+        borderRight.setOnMouseDragged(new EventHandler<MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+                if (event.getScreenX()  + xOffset >= stage.getMinWidth())
+                    stage.setWidth(event.getScreenX()  + xOffset);
+                else
+                    stage.setWidth(stage.getMinWidth());
+            }
+        });
+
+
+        stage.initModality(Modality.WINDOW_MODAL);
+        stage.initOwner(((BrowserController) caller).stage.getScene().getWindow());
+        this.caller = caller;
+        stage.setTitle("Log in");
+        stage.show();
+        descriptionTextBox.setWrapText(true);
+
+        int id = ((BrowserController) caller).getDetailsViewingNow();
+        editableMovie = ((BrowserController) caller).my_connector.getMovieInfo(id);
+
+        urlTextBox.setText(editableMovie.getImageLink());
+        titleTextBox.setText(editableMovie.name());
+        genreTextBox.setText(editableMovie.genre());
+        yearTextBox.setText(editableMovie.year());
+        timeTextBox.setText(editableMovie.duration());
+        studioTextBox.setText(editableMovie.studio());
+        directorTextBox.setText(editableMovie.director());
+        rateTextBox.setText(editableMovie.rating());
+        descriptionTextBox.setText(editableMovie.description());
+
+        //TODO ADD ACTORS INFO
+        addActor();
+    }
+
+    public void addActor() {
+        try {
+            AnchorPane row = FXMLLoader.load(getClass().getResource("../../ActorRoleSegment.fxml"));
+            //row.setPrefWidth(actorsGrid.getWidth());
+            actorsGridAncor.getChildren().add(row);
+            actorsGrid.setMinHeight(actorsGrid.getMinHeight() + 35);
+            if ((long) actorsGridAncor.getChildren().size() > 1)
+                moveFloatingElements(35);
+        } catch (IOException ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    public void removeActor() {
+        int count = (actorsGridAncor.getChildren().size());
+        if (count > 1) {
+            actorsGridAncor.getChildren().remove(count - 1);
+            actorsGrid.setMinHeight(actorsGrid.getMinHeight() - 35);
+            moveFloatingElements(-35);
+        }
+    }
+
+    private void moveFloatingElements(int space) {
+        AnchorPane.setTopAnchor(actorLabel, actorLabel.getLayoutY() + space);
+        AnchorPane.setTopAnchor(actorUnderline, actorUnderline.getLayoutY() + space);
+        AnchorPane.setTopAnchor(roleLabel, roleLabel.getLayoutY() + space);
+        AnchorPane.setTopAnchor(roleUnderline, roleUnderline.getLayoutY() + space);
+        AnchorPane.setTopAnchor(buttonRowAdd, buttonRowAdd.getLayoutY() + space);
+        AnchorPane.setTopAnchor(buttonRowRem, buttonRowRem.getLayoutY() + space);
+    }
+
+
+    public void executeForm() {
+        //read all textboxes
+        Movie NewMovie = new Movie();
+        NewMovie.setCover(urlTextBox.getText());
+        NewMovie.setName(titleTextBox.getText());
+        NewMovie.setGenre(genreTextBox.getText());
+        NewMovie.setYear(yearTextBox.getText());
+        NewMovie.setDuration(timeTextBox.getText());
+        NewMovie.setStudio(studioTextBox.getText());
+        NewMovie.setDirector(directorTextBox.getText());
+        NewMovie.setRating(rateTextBox.getText());
+        NewMovie.setDescription(descriptionTextBox.getText());
+
+
+        //TODO Сheck on id (if addMovie(...) = -1 movie not added)
+        NewMovie.setId(((BrowserController)caller).my_connector.addMovie(NewMovie));
+        System.out.println("Added Movie with ID: " + NewMovie.id());
+
+        List<Role> newMovieRoles = fetchRoles(NewMovie);
+        if (newMovieRoles.size() > 0) {
+            System.out.println("had something to add");
+            int counter = 0;
+            StringBuilder addedIDs = new StringBuilder();
+            for (Role element : newMovieRoles) {
+                element.setRoleId(((BrowserController) caller).my_connector.addRole(element));
+                if (element.id() != -1) {
+                    addedIDs.append(" ").append(element.id()).append(",");
+                    counter++;
+                }
+            }
+            System.out.println("Added " + counter + " Roles with IDs:" + addedIDs);
+        } else {
+            System.out.println("nothing to add");
+        }
+    }
+
+
+    private List<Role> fetchRoles(Movie targetMovie) {
+        List<Role> roles = new ArrayList<Role>();
+        try {
+            //AnchorPane row = (AnchorPane) actorsGrid.getChildren().get(1);
+
+            for (Node row : actorsGridAncor.getChildren()) {
+                System.out.println("Type: " + row.toString());
+                if (row instanceof AnchorPane) {
+                    // clear
+                    String name = null;
+                    String role = null;
+                    for (Node hbox : ((AnchorPane) row).getChildren()) {
+                        System.out.println("\t-Type: " + hbox.toString());
+
+                        if (hbox instanceof HBox)
+                            for (Node halfrow : ((HBox) hbox).getChildren()) {
+                                System.out.println("\t\t-Type: " + halfrow.toString());
+
+                                if (halfrow instanceof AnchorPane)
+                                    for (Node part : ((AnchorPane) halfrow).getChildren()) {
+                                        System.out.println("\t\t\t-Type: " + part.toString());
+
+                                        if (part instanceof TextField) {
+                                            System.out.println("\t\t\t\t Text: " + ((TextField) part).getText());
+                                            if (part.getId().equals("actorName")) {
+                                                name = ((TextField) part).getText();
+                                            }
+                                            if (part.getId().equals("actorRole")) {
+                                                role = ((TextField) part).getText();
+                                            }
+                                        }
+                                    }
+                            }
+                    }
+                    if (name != "" || role != "") {
+                        Role rowRole = new Role(targetMovie.id(), name, role);
+                        roles.add(rowRole);
+                        System.out.println("Final: movieId=" + rowRole.movieId() + ", actorName=" + rowRole.actor() + ", actorRole=" + rowRole.role() + "\n");
+                        System.out.println(rowRole.movieId());
+                    }
+                }
+
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        return roles;
+    }
+}

+ 47 - 0
src/main/java/com/moviesdb/GenreStatisticsController.java

@@ -0,0 +1,47 @@
+package com.moviesdb;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.fxml.FXML;
+import javafx.scene.chart.PieChart;
+import javafx.scene.control.Label;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.text.Text;
+import javafx.scene.text.TextFlow;
+
+public class GenreStatisticsController extends Controller {
+
+    @FXML
+    PieChart genrePie;
+    @FXML
+    TextFlow statsTextBox;
+
+    public void open(Object caller)
+    {
+        //getStats
+        //get num of films
+
+        stage.setTitle("Log in");
+        stage.show();
+
+        ObservableList<PieChart.Data> list = ((BrowserController) caller).my_connector.getGenreStats();
+
+        genrePie.setData(list);
+        genrePie.setTitle("TestTitle");
+
+        String textValue = new String();
+
+        for (PieChart.Data sector:
+             list) {
+            textValue += sector.getName() + ": " + sector.getPieValue() + "\n";
+        }
+
+        Text text = new Text(textValue);
+        statsTextBox.getChildren().add(text);
+
+
+
+    }
+}

+ 2 - 2
src/main/java/com/moviesdb/Main.java

@@ -33,12 +33,12 @@ public class Main extends Application {
 
         primaryStage.widthProperty().addListener(new ChangeListener<Number>() {
             @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneWidth, Number newSceneWidth) {
-                browserController.gridResize((double) newSceneWidth - 46, 0);
+                browserController.gridResize();
             }
         });
         primaryStage.heightProperty().addListener(new ChangeListener<Number>() {
             @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneHeight, Number newSceneHeight) {
-                browserController.gridResize( primaryStage.getWidth() - 46, 0);
+                browserController.gridResize( );
 
             }
         });

+ 25 - 3
src/main/resources/AddMovieWindow.fxml

@@ -1,5 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<?import javafx.scene.Cursor?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.ScrollPane?>
+<?import javafx.scene.control.TextArea?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.BorderPane?>
+<?import javafx.scene.layout.Pane?>
+<?import javafx.scene.layout.VBox?>
+<?import javafx.scene.text.Font?>
 <?import javafx.scene.control.Label?>
 <?import javafx.scene.control.ScrollPane?>
 <?import javafx.scene.control.TextArea?>
@@ -12,10 +22,16 @@
 
 <BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="0.0" prefHeight="553.0" prefWidth="616.0" stylesheets="@AddMovieWindowStyle.css" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.AddMovieController">
    <right>
-      <Pane fx:id="borderRight" maxWidth="5.0" prefHeight="520.0" prefWidth="230.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER" />
+      <Pane fx:id="borderRight" maxWidth="5.0" prefHeight="520.0" prefWidth="230.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER">
+         <cursor>
+            <Cursor fx:constant="E_RESIZE" />
+         </cursor></Pane>
    </right>
    <bottom>
-      <Pane fx:id="borderBottom" prefHeight="5.0" prefWidth="755.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER" />
+      <Pane fx:id="borderBottom" prefHeight="5.0" prefWidth="755.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER">
+         <cursor>
+            <Cursor fx:constant="S_RESIZE" />
+         </cursor></Pane>
    </bottom>
    <center>
       <AnchorPane minHeight="0.0" minWidth="0.0" style="-fx-background-color: #212121;" BorderPane.alignment="CENTER">
@@ -185,7 +201,10 @@
 		</AnchorPane>
    </center>
    <left>
-      <Pane fx:id="borderLeft" maxWidth="5.0" prefWidth="10.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER" />
+      <Pane fx:id="borderLeft" maxWidth="5.0" prefWidth="10.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER">
+         <cursor>
+            <Cursor fx:constant="W_RESIZE" />
+         </cursor></Pane>
    </left>
    <top>
       <AnchorPane fx:id="borderTop" maxHeight="24.0" prefHeight="24.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER">
@@ -206,6 +225,9 @@
                </font>
             </Label>
          </children>
+         <cursor>
+            <Cursor fx:constant="MOVE" />
+         </cursor>
       </AnchorPane>
    </top>
 </BorderPane>

+ 12 - 11
src/main/resources/BrowserWindow.fxml

@@ -62,6 +62,7 @@
               <menus>
                 <Menu mnemonicParsing="false" text="File">
                   <items>
+                      <MenuItem fx:id="statsMenu" mnemonicParsing="false" onAction="#openStatsForm" text="Stats" />
                       <MenuItem fx:id="reloadMenu" mnemonicParsing="false" onAction="#loadPosters" text="Reload" />
                       <MenuItem mnemonicParsing="false" text="Close" />
                   </items>
@@ -100,66 +101,66 @@
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="48.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="titleTextBox" layoutX="82.0" layoutY="48.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="84.0" text="Genre" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="82.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="genreTextBox" layoutX="82.0" layoutY="82.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="118.0" text="Year" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="116.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="yearTextBox" layoutX="82.0" layoutY="116.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="152.0" text="Duration" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="150.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="timeTextBox" layoutX="82.0" layoutY="150.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="186.0" text="Studio" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="184.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="studioTextBox" layoutX="82.0" layoutY="184.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="220.0" text="Director" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="218.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="directorTextBox" layoutX="82.0" layoutY="218.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="254.0" text="Actor" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="252.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="actorTextBox" layoutX="82.0" layoutY="252.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="288.0" text="Role" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="286.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="roleTextBox" layoutX="82.0" layoutY="286.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="322.0" text="Rating" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextField layoutX="82.0" layoutY="320.0" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
+                  <TextField fx:id="rateTextBox" layoutX="82.0" layoutY="320.0" onKeyTyped="#getFilterMovies" prefHeight="25.0" prefWidth="205.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #121212;" />
                   <Label layoutX="24.0" layoutY="353.0" text="Desc" textFill="#9f9f9f">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </Label>
-                  <TextArea fx:id="descriptionTextBox" layoutX="80.0" layoutY="353.0" minHeight="70.0" prefHeight="162.0" prefWidth="209.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #212121;" stylesheets="@FilterBlockStyle.css" wrapText="true">
+                  <TextArea fx:id="descriptionTextBox" layoutX="80.0" layoutY="353.0" minHeight="70.0" onKeyTyped="#getFilterMovies" prefHeight="162.0" prefWidth="209.0" style="-fx-text-fill: #9f9f9f; -fx-background-color: #212121; -fx-border-color: #212121;" stylesheets="@FilterBlockStyle.css" wrapText="true" AnchorPane.bottomAnchor="36.0" AnchorPane.topAnchor="353.0">
                      <font>
                         <Font size="14.0" />
                      </font>
                   </TextArea>
-                  <Label fx:id="filterButton" alignment="CENTER" layoutX="252.0" layoutY="519.0" onMouseClicked="#openFilter" style="&#10;" text="Filter" textAlignment="CENTER" wrapText="false" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="15.0">
+                  <Label fx:id="filterButton" alignment="CENTER" layoutX="252.0" layoutY="519.0" onMouseClicked="#getFilterMovies" style="&#10;" text="Filter" textAlignment="CENTER" wrapText="false" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="15.0">
                      <font>
                         <Font size="16.0" fx:id="x1111" />
                      </font>

+ 233 - 0
src/main/resources/EditMovieWindow.fxml

@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.Cursor?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.ScrollPane?>
+<?import javafx.scene.control.TextArea?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.BorderPane?>
+<?import javafx.scene.layout.Pane?>
+<?import javafx.scene.layout.VBox?>
+<?import javafx.scene.text.Font?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.ScrollPane?>
+<?import javafx.scene.control.TextArea?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.BorderPane?>
+<?import javafx.scene.layout.Pane?>
+<?import javafx.scene.layout.VBox?>
+<?import javafx.scene.text.Font?>
+
+<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="0.0" prefHeight="553.0" prefWidth="616.0" stylesheets="@AddMovieWindowStyle.css" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.EditMovieController">
+   <right>
+      <Pane fx:id="borderRight" maxWidth="5.0" prefHeight="520.0" prefWidth="230.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER">
+         <cursor>
+            <Cursor fx:constant="E_RESIZE" />
+         </cursor></Pane>
+   </right>
+   <bottom>
+      <Pane fx:id="borderBottom" prefHeight="5.0" prefWidth="755.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER">
+         <cursor>
+            <Cursor fx:constant="S_RESIZE" />
+         </cursor></Pane>
+   </bottom>
+   <center>
+      <AnchorPane minHeight="0.0" minWidth="0.0" style="-fx-background-color: #212121;" BorderPane.alignment="CENTER">
+         <AnchorPane prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
+            <children>
+               <Label onMouseClicked="#executeForm" text="Add" textFill="#9f9f9f" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0">
+                  <font>
+                     <Font name="System Bold" size="16.0" />
+                  </font>
+               </Label>
+            </children>
+         </AnchorPane>
+         <ScrollPane fitToHeight="true" fitToWidth="true" minHeight="0.0" AnchorPane.BottomAnchor="0" AnchorPane.LeftAnchor="0" AnchorPane.RightAnchor="0" AnchorPane.TopAnchor="0" AnchorPane.bottomAnchor="53.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="42.0">
+            <content>
+               <VBox>
+                  <AnchorPane prefHeight="318.0" prefWidth="604.0" VBox.vgrow="NEVER">
+                     <Label layoutX="24.0" layoutY="65.0" text="Title" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="13.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane layoutX="24.0" layoutY="74.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="33.0" />
+                     <Pane layoutX="169.0" layoutY="96.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="33.0" />
+                     <TextField id="actorName" fx:id="titleTextBox" layoutX="175.0" layoutY="47.0" maxWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="7.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </TextField>
+                     <Label layoutX="23.0" layoutY="82.0" text="Cover Link" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="53.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane layoutX="29.0" layoutY="140.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="73.0" />
+                     <Pane layoutX="174.0" layoutY="162.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="73.0" />
+                     <TextField id="actorName" fx:id="urlTextBox" layoutX="180.0" layoutY="113.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="48.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </TextField>
+                     <Label layoutX="16.0" layoutY="176.0" text="Genre" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="93.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane layoutX="22.0" layoutY="234.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="113.0" />
+                     <Pane layoutX="167.0" layoutY="256.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="113.0" />
+                     <TextField id="actorName" fx:id="genreTextBox" layoutX="221.0" layoutY="134.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="88.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </TextField>
+                     <Label layoutX="26.0" layoutY="186.0" text="Year" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="133.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane layoutX="32.0" layoutY="244.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="153.0" />
+                     <Pane layoutX="177.0" layoutY="266.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="153.0" />
+                     <TextField id="actorName" fx:id="yearTextBox" layoutX="183.0" layoutY="217.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="128.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </TextField>
+                     <Label layoutX="26.0" layoutY="186.0" text="Duration" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="173.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane layoutX="32.0" layoutY="244.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="193.0" />
+                     <Pane layoutX="177.0" layoutY="266.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="193.0" />
+                     <TextField id="actorName" fx:id="timeTextBox" layoutX="183.0" layoutY="217.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="168.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </TextField>
+                     <Label layoutX="36.0" layoutY="196.0" text="Studio" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="213.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane layoutX="42.0" layoutY="254.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="233.0" />
+                     <Pane layoutX="187.0" layoutY="276.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="233.0" />
+                     <TextField id="actorName" fx:id="studioTextBox" layoutX="193.0" layoutY="227.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="208.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </TextField>
+                     <Label layoutX="6.0" layoutY="291.0" text="Director" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="253.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane layoutX="12.0" layoutY="349.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="273.0" />
+                     <Pane layoutX="157.0" layoutY="371.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="273.0" />
+                     <TextField id="actorName" fx:id="directorTextBox" layoutX="163.0" layoutY="322.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="248.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </TextField>
+                     <Label fx:id="actorLabel" layoutX="28.0" layoutY="333.0" text="Actor" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="293.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane layoutX="124.0" layoutY="370.0" minWidth="304.0" prefHeight="3.0" prefWidth="304.0" style="-fx-background-color: #9f9f9f;" visible="false" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="126.0" AnchorPane.topAnchor="313.0" />
+                     <Pane fx:id="actorUnderline" layoutX="22.0" layoutY="359.0" maxHeight="1.0" maxWidth="150.0" minHeight="1.0" minWidth="150.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="313.0" />
+                     <Label fx:id="roleLabel" layoutX="422.0" layoutY="378.0" text="Role" textFill="#9f9f9f" AnchorPane.rightAnchor="68.0" AnchorPane.topAnchor="293.0">
+                        <font>
+                           <Font size="14.0" />
+                        </font>
+                     </Label>
+                     <Pane fx:id="roleUnderline" layoutX="392.0" layoutY="369.0" maxHeight="1.0" maxWidth="64.0" minHeight="1.0" minWidth="64.0" prefHeight="1.0" prefWidth="64.0" style="-fx-background-color: #9f9f9f;" AnchorPane.rightAnchor="62.0" AnchorPane.topAnchor="313.0" />
+                     <Label fx:id="buttonRowAdd" alignment="CENTER" layoutX="555.0" layoutY="323.0" onMouseClicked="#addActor" prefHeight="17.0" prefWidth="24.0" text="+" textFill="#9f9f9f" AnchorPane.rightAnchor="38.0" AnchorPane.topAnchor="283.0">
+                        <font>
+                           <Font name="System Bold" size="24.0" />
+                        </font>
+                     </Label>
+                     <Label fx:id="buttonRowRem" alignment="CENTER" layoutX="495.0" layoutY="323.0" onMouseClicked="#removeActor" prefHeight="17.0" prefWidth="24.0" text="-" textFill="#9f9f9f" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="283.0">
+                        <font>
+                           <Font name="System Bold" size="24.0" />
+                        </font>
+                     </Label>
+                     <ScrollPane fx:id="actorsGrid" fitToHeight="true" fitToWidth="true" hbarPolicy="NEVER" layoutX="174.0" layoutY="362.0" minHeight="4.0" prefHeight="70.0" prefWidth="416.0" vbarPolicy="NEVER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="173.0" AnchorPane.rightAnchor="123.0" AnchorPane.topAnchor="287.0">
+                        <content>
+                           <VBox fx:id="actorsGridAncor" prefHeight="200.0" prefWidth="100.0" style="-fx-background-color: transparent;" />
+                        </content>
+                     </ScrollPane>
+                  </AnchorPane>
+                  <AnchorPane prefWidth="604.0" VBox.vgrow="SOMETIMES">
+                     <children>
+                        <Label text="User Rating" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="6.0">
+                           <font>
+                              <Font size="14.0" />
+                           </font>
+                        </Label>
+                        <Pane prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="26.0" />
+                        <Pane prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="26.0" />
+                        <TextField fx:id="rateTextBox" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="1.0">
+                           <font>
+                              <Font size="14.0" />
+                           </font>
+                        </TextField>
+                        <Label text="Description" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="46.0">
+                           <font>
+                              <Font size="14.0" />
+                           </font>
+                        </Label>
+                        <Pane prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="66.0" />
+                        <TextArea fx:id="descriptionTextBox" minHeight="70.0" prefHeight="70.0" prefWidth="200.0" style="-fx-text-fill: #9f9f9f;" wrapText="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="39.0">
+                           <font>
+                              <Font size="14.0" />
+                           </font>
+                        </TextArea>
+                        <Pane prefHeight="43.0" prefWidth="1.0" style="-fx-background-color: #9f9f9f;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="174.0" AnchorPane.topAnchor="66.0" />
+                        <Pane prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" />
+                     </children>
+                  </AnchorPane>
+               </VBox>
+            </content>
+         </ScrollPane>
+         <Label text="Add movie" textFill="#9f9f9f" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0">
+            <font>
+               <Font size="24.0" />
+            </font>
+         </Label>
+      </AnchorPane>
+   </center>
+   <left>
+      <Pane fx:id="borderLeft" maxWidth="5.0" prefWidth="10.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER">
+         <cursor>
+            <Cursor fx:constant="W_RESIZE" />
+         </cursor></Pane>
+   </left>
+   <top>
+      <AnchorPane fx:id="borderTop" maxHeight="24.0" prefHeight="24.0" style="-fx-background-color: #121212;" BorderPane.alignment="CENTER">
+         <children>
+            <Label fx:id="closeButton" onMouseClicked="#closeStage" prefHeight="16.0" prefWidth="16.0" AnchorPane.bottomAnchor="4.0" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="4.0">
+               <font>
+                  <Font name="Arimo" size="12.0" />
+               </font>
+            </Label>
+            <Label fx:id="minimizeButton" onMouseClicked="#minimizeStage" prefHeight="16.0" prefWidth="16.0" AnchorPane.bottomAnchor="4.0" AnchorPane.rightAnchor="24.0" AnchorPane.topAnchor="4.0">
+               <font>
+                  <Font name="Arimo" size="12.0" />
+               </font>
+            </Label>
+            <Label layoutX="10.0" layoutY="2.0" text="Title" textFill="#9f9f9f" visible="false" AnchorPane.bottomAnchor="2.0" AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="2.0">
+               <font>
+                  <Font size="14.0" />
+               </font>
+            </Label>
+         </children>
+         <cursor>
+            <Cursor fx:constant="MOVE" />
+         </cursor>
+      </AnchorPane>
+   </top>
+</BorderPane>

+ 21 - 0
src/main/resources/GenreStatisticsWindow.fxml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.chart.PieChart?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.VBox?>
+<?import javafx.scene.text.TextFlow?>
+
+<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="516.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.GenreStatisticsController">
+   <children>
+      <AnchorPane minHeight="20.0" prefHeight="20.0" prefWidth="200.0" />
+      <AnchorPane prefHeight="385.0" prefWidth="600.0">
+         <children>
+            <PieChart fx:id="genrePie" layoutX="50.0" prefHeight="250.0" prefWidth="600.0" style="-fx-max-height: 600; -fx-max-width: 600;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
+         </children>
+      </AnchorPane>
+      <AnchorPane minHeight="20.0" prefHeight="111.0" prefWidth="600.0">
+         <children>
+            <TextFlow fx:id="statsTextBox" prefHeight="111.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
+         </children></AnchorPane>
+   </children>
+</VBox>