Skip to content
Snippets Groups Projects
Commit cd377dfd authored by Eirik Steira's avatar Eirik Steira
Browse files

Merge branch 'extendExplore' into 'dev'

Added code to extend the gridpane beyond 15 images

See merge request !144
parents c4bdab6b 4389af74
No related branches found
No related tags found
2 merge requests!165Weekly merge to Master,!144Added code to extend the gridpane beyond 15 images
Pipeline #80123 passed
......@@ -57,17 +57,26 @@ public class Explore implements Initializable {
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
List<NTNU.IDATT1002.models.Image> images = new ImageService(App.ex.getEntityManager()).getAllImages();
//Limited elements to 15 since grid pane since is 3x15
//Limited elements to 15 since grid pane since is 3x5
//Can implement automatic row adding when this limit exceeded later
for(int i = 0; i < images.size() && i < 15; i++) {
for(int i = 0; i < images.size() && i < 100; i++) {
//Row and column in gripdane
int column = i%3;
int row = (i-column)/3;
//Add rows
if(images.size() > 15){
gridPane.setMinHeight(1600 + (((i-15)*160)));
for (int j = 0; j < ((i-15)/3); j++){
gridPane.addRow(j);
}
}
//Make vbox container for content
VBox vBox = new VBox();
vBox.setPrefHeight(400);
vBox.setPrefWidth(400);
vBox.setMaxHeight(400);
vBox.setAlignment(Pos.CENTER);
//vBox.setStyle("-fx-background-color: #999999;");
......
......@@ -54,7 +54,7 @@
</HBox>
</children>
</HBox>
<ScrollPane fx:id="scrollPane" fitToWidth="true" hbarPolicy="NEVER" prefHeight="980.0" prefWidth="1920.0" VBox.vgrow="ALWAYS" styleClass="scroll-pane" stylesheets="@style.css">
<ScrollPane fx:id="scrollPane" fitToWidth="true" hbarPolicy="NEVER" prefHeight="980.0" prefWidth="1920.0" styleClass="scroll-pane" stylesheets="@style.css" VBox.vgrow="ALWAYS">
<content>
<BorderPane prefHeight="2000.0" prefWidth="1920.0" styleClass="bodybg" stylesheets="@style.css" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<top>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment