|
@@ -9,6 +9,7 @@ import javafx.scene.control.*;
|
|
|
import javafx.scene.image.Image;
|
|
|
import javafx.scene.image.ImageView;
|
|
|
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;
|
|
@@ -30,7 +31,7 @@ public class Controller {
|
|
|
@FXML
|
|
|
MenuItem menuNew;
|
|
|
@FXML
|
|
|
- GridPane moviesGrid;
|
|
|
+ FlowPane moviesGrid;
|
|
|
@FXML
|
|
|
ScrollPane scrollPane;
|
|
|
@FXML
|
|
@@ -41,6 +42,8 @@ public class Controller {
|
|
|
AnchorPane detailsPicPane;
|
|
|
@FXML
|
|
|
AnchorPane filterPane;
|
|
|
+ @FXML
|
|
|
+ Label button;
|
|
|
|
|
|
@FXML
|
|
|
Label minimizeButton;
|
|
@@ -120,10 +123,10 @@ public class Controller {
|
|
|
moviesGrid.getChildren().clear();
|
|
|
//moviesGrid.setAlignment(Pos.CENTER);
|
|
|
//fill grid by movies
|
|
|
- moviesGrid.addRow(0, labelsMovies[0], labelsMovies[1]);
|
|
|
+ //moviesGrid.addRow(0, labelsMovies[0], labelsMovies[1]);
|
|
|
//moviesGrid.minHeight(moviesGrid.getMinHeight() + 222);
|
|
|
- moviesGrid.setPrefWidth(browserPane.getWidth()-26);
|
|
|
- moviesGrid.setMinHeight(scrollPane.getHeight());
|
|
|
+ //moviesGrid.setPrefWidth(browserPane.getWidth()-26);
|
|
|
+ //moviesGrid.setMinHeight(scrollPane.getHeight());
|
|
|
gridResize();
|
|
|
//moviesGrid.setPrefHeight(moviesGrid.getHeight());
|
|
|
|
|
@@ -175,12 +178,15 @@ public class Controller {
|
|
|
//movie.
|
|
|
detailsPicPane.getChildren().add(detailsImage);
|
|
|
// 300px is details window width
|
|
|
- scrollPane.setPrefWidth(browserPane.getWidth()-300);
|
|
|
- scrollPane.setPrefHeight(browserPane.getHeight());
|
|
|
- moviesGrid.setPrefWidth(browserPane.getWidth() -300);
|
|
|
+ //scrollPane.setPrefWidth(browserPane.getWidth()-300);
|
|
|
+ //scrollPane.setPrefHeight(browserPane.getHeight());
|
|
|
+ //moviesGrid.setPrefWidth(browserPane.getWidth());
|
|
|
//moviesGrid.setPrefHeight(browserPane.getHeight());
|
|
|
//loadPosters();
|
|
|
|
|
|
+ gridResize();
|
|
|
+ //button.setText(Double.toString(browserPane.getWidth()));
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -189,10 +195,13 @@ public class Controller {
|
|
|
detailsPane.setPrefWidth(0);
|
|
|
detailsPane.setMaxWidth(0);
|
|
|
// 300px is details window width
|
|
|
- scrollPane.setPrefWidth(browserPane.getWidth()+300);
|
|
|
- scrollPane.setPrefHeight(browserPane.getHeight());
|
|
|
- moviesGrid.setPrefWidth(browserPane.getWidth()+300);
|
|
|
+ //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()));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -213,11 +222,11 @@ public class Controller {
|
|
|
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();
|
|
|
+ //scrollPane.setPrefWidth(browserPane.getWidth()-300);
|
|
|
+ //scrollPane.setPrefHeight(browserPane.getHeight());
|
|
|
+ //moviesGrid.setPrefWidth(browserPane.getWidth() -300);
|
|
|
+ //moviesGrid.setPrefHeight(browserPane.getHeight());
|
|
|
+ gridResize();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -226,11 +235,11 @@ public class Controller {
|
|
|
filterPane.setMaxWidth(0);
|
|
|
//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();
|
|
|
+ //scrollPane.setPrefWidth(browserPane.getWidth()+300);
|
|
|
+ //scrollPane.setPrefHeight(browserPane.getHeight());
|
|
|
+ //moviesGrid.setPrefWidth(scrollPane.getWidth()+300);
|
|
|
+ //moviesGrid.setPrefHeight(browserPane.getHeight());
|
|
|
+ gridResize();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -246,13 +255,24 @@ public class Controller {
|
|
|
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++)
|
|
|
{
|
|
|
- moviesGrid.add(labelsMovies[k],j,i);
|
|
|
+ try {
|
|
|
+ moviesGrid.getChildren().add(labelsMovies[k]);
|
|
|
+ }
|
|
|
+ catch (Exception err)
|
|
|
+ {
|
|
|
+ k++;
|
|
|
+ }
|
|
|
if(k == movies.length - 1)
|
|
|
break;
|
|
|
k++;
|