diff --git a/src/main/java/com/application/GUI/Input.java b/src/main/java/com/application/GUI/Input.java index 5f948f1745dd6ed893d8aa28eecba15979332ecc..92a1612e2b5abcb173bc89804e01876f47d33206 100644 --- a/src/main/java/com/application/GUI/Input.java +++ b/src/main/java/com/application/GUI/Input.java @@ -14,38 +14,61 @@ public class Input { public static void display() { - Stage popupwindow=new Stage(); - - popupwindow.initModality(Modality.APPLICATION_MODAL); - popupwindow.setTitle("Input Parameters"); + Stage window = new Stage(); + window.initModality(Modality.APPLICATION_MODAL); + window.setTitle("Input Parameters"); + // Top Label inputLabel= new Label("Input"); - inputLabel.setAlignment(Pos.TOP_CENTER); - - - Button close= new Button("Close this pop up window"); - close.setAlignment(Pos.BOTTOM_CENTER); - - close.setOnAction(e -> popupwindow.close()); - - - - BorderPane layout= new BorderPane(); - //layout.set(inputLabel); - //layout.setCenter(); - //layout.setBottom(close); - - - - layout.getChildren().addAll(inputLabel, close); - - - Scene scene1= new Scene(layout, 300, 250); - - popupwindow.setScene(scene1); - - popupwindow.showAndWait(); + inputLabel.setId("inputTop"); + + // Center - Input fields + Label treeSpeciesInputLabel = new Label("Tree Species"); + treeSpeciesInputLabel.setId("inputLabel"); + TextField treeSpeciesInputText = new TextField(); + treeSpeciesInputText.setId("inputLabelText"); + treeSpeciesInputText.setPromptText("Bjørk"); + treeSpeciesInputText.getText(); + + Label dimensionsInputLabel = new Label("Width x Height"); + dimensionsInputLabel.setId("inputLabel"); + TextField dimensionsInputText = new TextField(); + dimensionsInputText.setId("inputLabelText"); + dimensionsInputText.setPromptText("47 x 150"); + + Label sawsetInputLabel = new Label("Sawset"); + sawsetInputLabel.setId("inputLabel"); + TextField sawsetInputText = new TextField(); + sawsetInputText.setId("inputLabelText"); + sawsetInputText.setPromptText("4x"); + + Label moistureGoalInputLabel = new Label("Moisture Goal"); + moistureGoalInputLabel.setId("inputLabel"); + TextField moistureGoalInputText = new TextField(); + moistureGoalInputText.setId("inputLabelText"); + moistureGoalInputText.setPromptText("12%"); + + + // Bottom - start button + Button startButton = new Button("Start"); + startButton.setId("inputButtonStart"); + + startButton.setOnAction(e -> { + + window.close(); + }); + + + VBox layout = new VBox(10); + layout.getChildren().addAll(inputLabel, treeSpeciesInputLabel, treeSpeciesInputText, dimensionsInputLabel, dimensionsInputText, + sawsetInputLabel, sawsetInputText, moistureGoalInputLabel, moistureGoalInputText, startButton); + layout.setAlignment(Pos.CENTER); + + Scene scene = new Scene(layout, 600, 600); + scene.getStylesheets().add(Input.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm()); + window.setScene(scene); + window.showAndWait(); } diff --git a/src/main/java/com/application/Main.java b/src/main/java/com/application/Main.java index 73d3dfc5d5a202bb73c4bbe5e1fd759a1d3e6881..24c69f3c004573f7c57534d91b257b8fcee0be01 100644 --- a/src/main/java/com/application/Main.java +++ b/src/main/java/com/application/Main.java @@ -101,11 +101,7 @@ public class Main extends Application { VBox.setVgrow(this.logoBar, Priority.ALWAYS); - //DB.getName(); - //System.out.println(DB.getKwh()); - // Sets the scene and defines boundaries - //Scene scene = new Scene(root, 1200, 600); Scene scene = new Scene(root, 1200, 600); scene.getStylesheets().add(getClass().getResource("/com.application/CSS/styleSheet.css").toExternalForm()); @@ -149,7 +145,6 @@ public class Main extends Application { // Creating a vbox VBox sideBarVBox = new VBox(); - //sideBarVBox.prefHeight(500); Label treeSpeciesLabel = new Label("Tree Species"); treeSpeciesLabel.setId("sideBarLabelText"); diff --git a/src/main/resources/com.application/CSS/styleSheet.css b/src/main/resources/com.application/CSS/styleSheet.css index 7265a693ae83ab88b3a4d320a376d17e25f0575d..c6d1365567c3d9198418fef1bf0089ac70e7ca2e 100644 --- a/src/main/resources/com.application/CSS/styleSheet.css +++ b/src/main/resources/com.application/CSS/styleSheet.css @@ -1,6 +1,7 @@ -/* General css for alle the main windows */ +/* + Css for main window styling +*/ -/*noinspection CssUnusedSymbol*/ .root { -fx-pref-width: 1150; -fx-pref-height: 600; @@ -48,6 +49,53 @@ -fx-background-color: rgba(104, 229, 59, 1); } +/* + Input popup window + */ +#inputTop { + -fx-alignment: top-center; + -fx-font-size: 24; + -fx-font-family: Arial; + -fx-background-color: rgba(12, 76, 81, 1); + -fx-text-fill: white; + -fx-pref-width: 200; +} + +#inputCenter { + -fx-alignment: center; +} + +#inputBottom { + -fx-alignment: bottom-center; +} + +#inputLabel { + -fx-pref-height: 17; + -fx-translate-x: 10; + -fx-pref-width: 100; + -fx-max-height: infinity; + -fx-max-width: infinity; + -fx-font-size: 16; + -fx-font-family: Arial; +} + +#inputLabelText { + -fx-pref-height: 17; + -fx-translate-x: 5; + -fx-max-height: infinity; + -fx-max-width: infinity; + -fx-font-size: 16; + -fx-font-family: Arial; +} + +#inputButtonStart { + -fx-pref-width: infinity; + -fx-pref-height: 25; + -fx-font-size: 20; + -fx-font-family: Arial; + -fx-background-color: rgba(12, 76, 81, 1); + -fx-text-fill: white; +} diff --git a/target/classes/com.application/CSS/styleSheet.css b/target/classes/com.application/CSS/styleSheet.css index 7265a693ae83ab88b3a4d320a376d17e25f0575d..c6d1365567c3d9198418fef1bf0089ac70e7ca2e 100644 --- a/target/classes/com.application/CSS/styleSheet.css +++ b/target/classes/com.application/CSS/styleSheet.css @@ -1,6 +1,7 @@ -/* General css for alle the main windows */ +/* + Css for main window styling +*/ -/*noinspection CssUnusedSymbol*/ .root { -fx-pref-width: 1150; -fx-pref-height: 600; @@ -48,6 +49,53 @@ -fx-background-color: rgba(104, 229, 59, 1); } +/* + Input popup window + */ +#inputTop { + -fx-alignment: top-center; + -fx-font-size: 24; + -fx-font-family: Arial; + -fx-background-color: rgba(12, 76, 81, 1); + -fx-text-fill: white; + -fx-pref-width: 200; +} + +#inputCenter { + -fx-alignment: center; +} + +#inputBottom { + -fx-alignment: bottom-center; +} + +#inputLabel { + -fx-pref-height: 17; + -fx-translate-x: 10; + -fx-pref-width: 100; + -fx-max-height: infinity; + -fx-max-width: infinity; + -fx-font-size: 16; + -fx-font-family: Arial; +} + +#inputLabelText { + -fx-pref-height: 17; + -fx-translate-x: 5; + -fx-max-height: infinity; + -fx-max-width: infinity; + -fx-font-size: 16; + -fx-font-family: Arial; +} + +#inputButtonStart { + -fx-pref-width: infinity; + -fx-pref-height: 25; + -fx-font-size: 20; + -fx-font-family: Arial; + -fx-background-color: rgba(12, 76, 81, 1); + -fx-text-fill: white; +} diff --git a/target/classes/com/application/GUI/Input.class b/target/classes/com/application/GUI/Input.class new file mode 100644 index 0000000000000000000000000000000000000000..5d8812b5162c21667866f0f8fab98ff082e8610b Binary files /dev/null and b/target/classes/com/application/GUI/Input.class differ diff --git a/target/classes/com/application/Main$1WorkerThread.class b/target/classes/com/application/Main$1WorkerThread.class index 9abb12eca1a252de3954b0675b49e8a0237e772b..6d7959dd02c2288d7396e77e03326f2aa0fbfcca 100644 Binary files a/target/classes/com/application/Main$1WorkerThread.class and b/target/classes/com/application/Main$1WorkerThread.class differ diff --git a/target/classes/com/application/Main.class b/target/classes/com/application/Main.class index 0d5b4b05146df4bdf444faab24858fda26ff690c..298f3b433ab54354bbd403aa498e2291efa2336a 100644 Binary files a/target/classes/com/application/Main.class and b/target/classes/com/application/Main.class differ