Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IDATT2003 Mappevurdering
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Håvard Johannes Versto Daleng
IDATT2003 Mappevurdering
Commits
668cb3df
Commit
668cb3df
authored
11 months ago
by
Magnus Eik
Browse files
Options
Downloads
Patches
Plain Diff
Add dummy buttons and text fields for changeable parameters
parent
8bc928ca
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/edu/ntnu/stud/chaosgame/view/ChaosGameGUIView.java
+44
-3
44 additions, 3 deletions
...n/java/edu/ntnu/stud/chaosgame/view/ChaosGameGUIView.java
with
44 additions
and
3 deletions
src/main/java/edu/ntnu/stud/chaosgame/view/ChaosGameGUIView.java
+
44
−
3
View file @
668cb3df
...
...
@@ -8,9 +8,9 @@ import edu.ntnu.stud.chaosgame.model.generators.ChaosGameDescriptionFactory;
import
javafx.animation.KeyFrame
;
import
javafx.animation.Timeline
;
import
javafx.application.Platform
;
import
javafx.geometry.Insets
;
import
javafx.scene.Scene
;
import
javafx.scene.control.ToggleGroup
;
import
javafx.scene.control.RadioButton
;
import
javafx.scene.control.*
;
import
javafx.scene.image.Image
;
import
javafx.scene.image.ImageView
;
import
javafx.scene.image.PixelWriter
;
...
...
@@ -19,7 +19,6 @@ import javafx.scene.layout.BorderPane;
import
javafx.scene.layout.VBox
;
import
javafx.scene.paint.Color
;
import
javafx.stage.Stage
;
import
javafx.scene.control.Button
;
import
javafx.util.Duration
;
import
java.io.IOException
;
...
...
@@ -134,6 +133,41 @@ public class ChaosGameGUIView {
game
=
new
ChaosGame
(
description
.
get
(),
canvasRef
.
get
());
});
// Load fractal file button
Button
loadFractalFromFileButton
=
new
Button
(
"Load Fractal"
);
// Write fractal to file button
Button
writeFractalToFileButton
=
new
Button
(
"Write to File"
);
// Parameters
VBox
parameterBox
=
new
VBox
();
// Step Count GUI
VBox
stepCountBox
=
new
VBox
();
Label
stepCountLabel
=
new
Label
(
"Step Count"
);
TextArea
stepCountTextArea
=
new
TextArea
();
stepCountTextArea
.
setPrefHeight
(
5
);
stepCountTextArea
.
setPrefWidth
(
50
);
Button
changeStepCountButton
=
new
Button
(
"Change Step Count"
);
stepCountBox
.
getChildren
().
addAll
(
stepCountLabel
,
stepCountTextArea
,
changeStepCountButton
);
// Minimum Coordinates GUI
VBox
minCoordinatesBox
=
new
VBox
();
Label
minCoordinatesLabel
=
new
Label
(
"Min. Coordinates"
);
TextArea
minimumCoordinatesTextArea
=
new
TextArea
();
minimumCoordinatesTextArea
.
setPrefHeight
(
5
);
minimumCoordinatesTextArea
.
setPrefWidth
(
50
);
Button
changeMinimumCoordinatesButton
=
new
Button
(
"Change Min. Coordinates"
);
minCoordinatesBox
.
getChildren
().
addAll
(
minCoordinatesLabel
,
minimumCoordinatesTextArea
,
changeMinimumCoordinatesButton
);
// Maximum Coordinates GUI
VBox
maxCoordinatesBox
=
new
VBox
();
Label
maxCoordinatesLabel
=
new
Label
(
"Max Coordinates"
);
TextArea
maximumCoordinatesTextArea
=
new
TextArea
();
maximumCoordinatesTextArea
.
setPrefHeight
(
5
);
maximumCoordinatesTextArea
.
setPrefWidth
(
50
);
Button
changeMaximumCoordinatesButton
=
new
Button
(
"Change Max Coordinates"
);
maxCoordinatesBox
.
getChildren
().
addAll
(
maxCoordinatesLabel
,
maximumCoordinatesTextArea
,
changeMaximumCoordinatesButton
);
// Fill parameter box
parameterBox
.
getChildren
().
addAll
(
stepCountBox
,
minCoordinatesBox
,
maxCoordinatesBox
);
parameterBox
.
setPadding
(
new
Insets
(
10
));
// Quit button
Button
quitButton
=
new
Button
(
"Quit"
);
quitButton
.
setOnAction
(
event
->
Platform
.
exit
());
...
...
@@ -142,8 +176,14 @@ public class ChaosGameGUIView {
sideMenu
.
getChildren
().
addAll
(
startButton
,
stopButton
,
newButton
,
clearButton
);
// Add fractal radio buttons
sideMenu
.
getChildren
().
addAll
(
sierpinskiRadioButton
,
barnsleyRadioButton
,
juliaRadioButton
);
// Add parameter VBox
sideMenu
.
getChildren
().
add
(
parameterBox
);
// Add file buttons
sideMenu
.
getChildren
().
addAll
(
loadFractalFromFileButton
,
writeFractalToFileButton
);
// Add quit button
sideMenu
.
getChildren
().
add
(
quitButton
);
// Add padding
sideMenu
.
setPadding
(
new
Insets
(
10
));
...
...
@@ -204,4 +244,5 @@ public class ChaosGameGUIView {
public
void
setImageViewFromImage
(
Image
inputView
)
{
this
.
imageView
.
setImage
(
inputView
);
}
}
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