|
@@ -15,6 +15,7 @@ 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 java.awt.event.MouseEvent;
|
|
|
import java.time.chrono.AbstractChronology;
|
|
@@ -39,16 +40,18 @@ public class Controller {
|
|
|
|
|
|
|
|
|
Label[] movies;
|
|
|
-
|
|
|
Movie my_movie;
|
|
|
+ DataBaseConnector my_connector;
|
|
|
+
|
|
|
+
|
|
|
+ public void initialize(){
|
|
|
+ my_connector = new DataBaseConnector();
|
|
|
+ my_connector.initConnection("d","1");
|
|
|
+ }
|
|
|
|
|
|
public void loadPosters()
|
|
|
{
|
|
|
- my_movie = new Movie();
|
|
|
- my_movie.setName("Back to the Future");
|
|
|
- my_movie.setDuration("1:20");
|
|
|
- my_movie.setDescription("The CSS styles for text input controls such as TextField for JavaFX 8 are defined in the modena.css stylesheet as below. Create a custom CSS stylesheet and modify the colors as you wish. Use the CSS reference guide if you need help understanding the syntax and available attributes and values.");
|
|
|
- //my_movie.setCover("https://m.media-amazon.com/images/M/MV5BZmU0M2Y1OGUtZjIxNi00ZjBkLTg1MjgtOWIyNThiZWIwYjRiXkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_UX182_CR0,0,182,268_AL_.jpg");
|
|
|
+ detailsPane.setMinWidth(300);
|
|
|
//get movies array
|
|
|
movies = new Label[10];
|
|
|
//change grid size for number of movies
|
|
@@ -63,7 +66,7 @@ public class Controller {
|
|
|
GridPane.setHalignment(movies[i], HPos.CENTER);
|
|
|
Label movie = movies[i];
|
|
|
movies[i].setOnMouseClicked(e-> {
|
|
|
- openDetails(movie);
|
|
|
+ openDetails(movie);
|
|
|
});
|
|
|
}
|
|
|
//moviesGrid.setPrefWidth(scrollPane.getWidth());
|
|
@@ -98,6 +101,8 @@ public class Controller {
|
|
|
|
|
|
detailsPane.setMinWidth(300);
|
|
|
|
|
|
+ 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" +
|
|
@@ -107,10 +112,6 @@ public class Controller {
|
|
|
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);
|