Skip to content
Snippets Groups Projects
Commit 3b520403 authored by Johan Martin Arntsen's avatar Johan Martin Arntsen
Browse files

refactor FileInputPage

parent d021f648
No related branches found
No related tags found
No related merge requests found
...@@ -76,17 +76,11 @@ public class FileInputPage { ...@@ -76,17 +76,11 @@ public class FileInputPage {
* @return the left menu of the file input page * @return the left menu of the file input page
*/ */
public VBox getLeftMenu(SceneController sceneController) { public VBox getLeftMenu(SceneController sceneController) {
VBox leftMenu = new VBox();
Text titleText = new Text("File Input"); Text titleText = new Text("File Input");
titleText.setFont(Font.font("", 20)); titleText.setFont(Font.font("", 20));
PageMenu pageMenu = new PageMenu(sceneController);
MenuButton menuButton = pageMenu.getMenuButton();
HBox filePathBox = new HBox(); HBox filePathBox = new HBox();
Label filePathLabel = new Label("File path:");
TextField filePathField = new TextField(); TextField filePathField = new TextField();
filePathField.setPromptText("Paste file path here"); filePathField.setPromptText("Paste file path here");
...@@ -121,7 +115,6 @@ public class FileInputPage { ...@@ -121,7 +115,6 @@ public class FileInputPage {
Button plus10000Button = new Button("+ 10 000"); Button plus10000Button = new Button("+ 10 000");
plus10000Button.setOnAction(e -> CanvasObserver.update(10000, canvas, chaosGame)); plus10000Button.setOnAction(e -> CanvasObserver.update(10000, canvas, chaosGame));
HBox iterationsBox = new HBox();
TextField iterationsField = new TextField(); TextField iterationsField = new TextField();
iterationsField.setPromptText("Iterations"); iterationsField.setPromptText("Iterations");
Button plusIterationsButton = new Button("+"); Button plusIterationsButton = new Button("+");
...@@ -135,6 +128,7 @@ public class FileInputPage { ...@@ -135,6 +128,7 @@ public class FileInputPage {
CanvasObserver.update(iterations, canvas, chaosGame); CanvasObserver.update(iterations, canvas, chaosGame);
}); });
iterationsField.setMaxWidth(70); iterationsField.setMaxWidth(70);
HBox iterationsBox = new HBox();
iterationsBox.getChildren().addAll(plusIterationsButton, iterationsField); iterationsBox.getChildren().addAll(plusIterationsButton, iterationsField);
HBox iterationsButtonsBox = new HBox(); HBox iterationsButtonsBox = new HBox();
...@@ -161,6 +155,10 @@ public class FileInputPage { ...@@ -161,6 +155,10 @@ public class FileInputPage {
Region spacer = new Region(); Region spacer = new Region();
VBox.setVgrow(spacer, Priority.ALWAYS); VBox.setVgrow(spacer, Priority.ALWAYS);
VBox leftMenu = new VBox();
PageMenu pageMenu = new PageMenu(sceneController);
MenuButton menuButton = pageMenu.getMenuButton();
Label filePathLabel = new Label("File path:");
leftMenu.getChildren().addAll( leftMenu.getChildren().addAll(
menuButton, menuButton,
titleText, titleText,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment