Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Team 14 - IDATT1002
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eirik Steira
Team 14 - IDATT1002
Commits
4389af74
Commit
4389af74
authored
5 years ago
by
Nicolay Schiøll-Johansen
Browse files
Options
Downloads
Patches
Plain Diff
Added code to extend the gridpane beyond 15 images
parent
66294f69
No related branches found
No related tags found
2 merge requests
!165
Weekly merge to Master
,
!144
Added code to extend the gridpane beyond 15 images
Pipeline
#80084
passed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/NTNU/IDATT1002/controllers/Explore.java
+11
-2
11 additions, 2 deletions
src/main/java/NTNU/IDATT1002/controllers/Explore.java
src/main/resources/NTNU/IDATT1002/explore.fxml
+1
-1
1 addition, 1 deletion
src/main/resources/NTNU/IDATT1002/explore.fxml
with
12 additions
and
3 deletions
src/main/java/NTNU/IDATT1002/controllers/Explore.java
+
11
−
2
View file @
4389af74
...
@@ -57,17 +57,26 @@ public class Explore implements Initializable {
...
@@ -57,17 +57,26 @@ public class Explore implements Initializable {
@Override
@Override
public
void
initialize
(
URL
url
,
ResourceBundle
resourceBundle
)
{
public
void
initialize
(
URL
url
,
ResourceBundle
resourceBundle
)
{
List
<
NTNU
.
IDATT1002
.
models
.
Image
>
images
=
new
ImageService
(
App
.
ex
.
getEntityManager
()).
getAllImages
();
List
<
NTNU
.
IDATT1002
.
models
.
Image
>
images
=
new
ImageService
(
App
.
ex
.
getEntityManager
()).
getAllImages
();
//Limited elements to 15 since grid pane since is 3x
1
5
//Limited elements to 15 since grid pane since is 3x5
//Can implement automatic row adding when this limit exceeded later
//Can implement automatic row adding when this limit exceeded later
for
(
int
i
=
0
;
i
<
images
.
size
()
&&
i
<
1
5
;
i
++)
{
for
(
int
i
=
0
;
i
<
images
.
size
()
&&
i
<
1
00
;
i
++)
{
//Row and column in gripdane
//Row and column in gripdane
int
column
=
i
%
3
;
int
column
=
i
%
3
;
int
row
=
(
i
-
column
)/
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
//Make vbox container for content
VBox
vBox
=
new
VBox
();
VBox
vBox
=
new
VBox
();
vBox
.
setPrefHeight
(
400
);
vBox
.
setPrefHeight
(
400
);
vBox
.
setPrefWidth
(
400
);
vBox
.
setPrefWidth
(
400
);
vBox
.
setMaxHeight
(
400
);
vBox
.
setAlignment
(
Pos
.
CENTER
);
vBox
.
setAlignment
(
Pos
.
CENTER
);
//vBox.setStyle("-fx-background-color: #999999;");
//vBox.setStyle("-fx-background-color: #999999;");
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/NTNU/IDATT1002/explore.fxml
+
1
−
1
View file @
4389af74
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</HBox>
</HBox>
</children>
</children>
</HBox>
</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>
<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"
>
<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>
<top>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment