|
@@ -13,6 +13,8 @@ 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 java.awt.event.MouseEvent;
|
|
|
import java.time.chrono.AbstractChronology;
|
|
@@ -29,15 +31,7 @@ public class Controller {
|
|
|
@FXML
|
|
|
AnchorPane detailsPane;
|
|
|
@FXML
|
|
|
- Label detailsNameContent;
|
|
|
- @FXML
|
|
|
- Label detailsYearContent;
|
|
|
- @FXML
|
|
|
- Label detailsDurContent;
|
|
|
- @FXML
|
|
|
- Label detailsGenreContent;
|
|
|
- @FXML
|
|
|
- Label detailsDescContent;
|
|
|
+ TextFlow detailsContent;
|
|
|
@FXML
|
|
|
AnchorPane detailsPicPane;
|
|
|
@FXML
|
|
@@ -48,7 +42,6 @@ public class Controller {
|
|
|
|
|
|
Movie my_movie;
|
|
|
|
|
|
-
|
|
|
public void loadPosters()
|
|
|
{
|
|
|
|
|
@@ -104,11 +97,19 @@ public class Controller {
|
|
|
|
|
|
detailsPane.setMinWidth(300);
|
|
|
|
|
|
- detailsNameContent.setText(my_movie.name());
|
|
|
- detailsYearContent.setText(my_movie.year());
|
|
|
- detailsDurContent.setText(my_movie.duration());
|
|
|
- detailsGenreContent.setText(my_movie.genre());
|
|
|
- detailsDescContent.setText(my_movie.description());
|
|
|
+ //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);
|
|
|
+ //detailsContent.setText(my_movie.year());
|
|
|
+ //detailsContent.setText(my_movie.duration());
|
|
|
+ //detailsContent.setText(my_movie.genre());
|
|
|
+ //detailsContent.setText(my_movie.description());
|
|
|
|
|
|
detailsPicPane.getChildren().clear();
|
|
|
//detailsPane.setMaxWidth(300);
|
|
@@ -125,12 +126,12 @@ public class Controller {
|
|
|
detailsImage.setY(0);
|
|
|
//movie.
|
|
|
detailsPicPane.getChildren().add(detailsImage);
|
|
|
-
|
|
|
- scrollPane.setMaxWidth(browserPane.getWidth()-26);
|
|
|
- scrollPane.setMaxHeight(browserPane.getHeight()-50);
|
|
|
- moviesGrid.setMaxWidth(browserPane.getWidth()-26);
|
|
|
- moviesGrid.setMaxHeight(browserPane.getHeight()-50);
|
|
|
- loadPosters();
|
|
|
+ // 300px is details window width
|
|
|
+ scrollPane.setMaxWidth(browserPane.getWidth()-300);
|
|
|
+ scrollPane.setMaxHeight(browserPane.getHeight());
|
|
|
+ moviesGrid.setMaxWidth(browserPane.getWidth() -300);
|
|
|
+ moviesGrid.setMaxHeight(browserPane.getHeight());
|
|
|
+ //loadPosters();
|
|
|
|
|
|
}
|
|
|
else
|
|
@@ -139,6 +140,11 @@ public class Controller {
|
|
|
detailsPane.setMinWidth(0);
|
|
|
detailsPane.setPrefWidth(0);
|
|
|
detailsPane.setMaxWidth(0);
|
|
|
+ // 300px is details window width
|
|
|
+ scrollPane.setMaxWidth(browserPane.getWidth()+300);
|
|
|
+ scrollPane.setMaxHeight(browserPane.getHeight());
|
|
|
+ moviesGrid.setMaxWidth(browserPane.getWidth()+300);
|
|
|
+ moviesGrid.setMaxHeight(browserPane.getHeight());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -158,6 +164,11 @@ public class Controller {
|
|
|
filterPane.setPrefWidth(300);
|
|
|
filterPane.setMaxWidth(300);
|
|
|
//loadPosters();
|
|
|
+ // 300px is filter window width
|
|
|
+ scrollPane.setMaxWidth(browserPane.getWidth()-300);
|
|
|
+ scrollPane.setMaxHeight(browserPane.getHeight());
|
|
|
+ moviesGrid.setMaxWidth(browserPane.getWidth()-300);
|
|
|
+ moviesGrid.setMaxHeight(browserPane.getHeight());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -165,6 +176,11 @@ public class Controller {
|
|
|
filterPane.setPrefWidth(0);
|
|
|
filterPane.setMaxWidth(0);
|
|
|
//loadPosters();
|
|
|
+ // 300px is filter window width
|
|
|
+ scrollPane.setMaxWidth(browserPane.getWidth()+300);
|
|
|
+ scrollPane.setMaxHeight(browserPane.getHeight());
|
|
|
+ moviesGrid.setMaxWidth(browserPane.getWidth()+300);
|
|
|
+ moviesGrid.setMaxHeight(browserPane.getHeight());
|
|
|
}
|
|
|
}
|
|
|
|