Skip to content
Snippets Groups Projects

New explore

Merged Stian Fjæran Mogen requested to merge new_explore into dev
All threads resolved!
1 file
+ 15
15
Compare changes
  • Side-by-side
  • Inline
@@ -65,22 +65,22 @@ public class Explore implements Initializable {
int row = (i-column)/3;
//Make vbox container for content
VBox v = new VBox();
v.setPrefHeight(400);
v.setPrefWidth(400);
v.setAlignment(Pos.TOP_LEFT);
//v.setStyle("-fx-background-color: #999999;");
VBox vBox = new VBox();
vBox.setPrefHeight(400);
vBox.setPrefWidth(400);
vBox.setAlignment(Pos.CENTER);
vBox.setStyle("-fx-background-color: #999999;");
//Image container
ImageView iV = new ImageView();
iV.setId(String.valueOf(images.get(i).getId()));
iV.setImage(ImageUtil.convertToFXImage(images.get(i)));
iV.setFitHeight(250);
iV.setFitWidth(400);
iV.pickOnBoundsProperty().setValue(true);
iV.setPreserveRatio(true);
ImageView imageView = new ImageView();
imageView.setId(String.valueOf(images.get(i).getId()));
imageView.setImage(ImageUtil.convertToFXImage(images.get(i)));
imageView.setFitHeight(250);
imageView.setFitWidth(400);
imageView.pickOnBoundsProperty().setValue(true);
imageView.setPreserveRatio(true);
//Link to view image page
iV.setOnMouseClicked(new EventHandler<MouseEvent>() {
imageView.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent e) {
try{
switchToPicture(e);
@@ -98,10 +98,10 @@ public class Explore implements Initializable {
tag.setFont(Font.font("System Bold", 18));
//Add elements to vbox
v.getChildren().addAll(iV, title, tag);
vBox.getChildren().addAll(imageView, title, tag);
//Add vbox to gridpane
gridPane.add(v, column, row);
gridPane.add(vBox, column, row);
}
}
Loading