From 8a4deb32b501281ed7df3d25ec1f09501d27504a Mon Sep 17 00:00:00 2001
From: Eilert Tunheim <emtunhei@stud.ntnu.no>
Date: Mon, 28 Mar 2022 15:23:20 +0200
Subject: [PATCH] Added input-popup window, started filling in textfields,
 labels and buttons

---
 src/main/java/com/application/GUI/Input.java  |  81 +++++++++++-------
 src/main/java/com/application/Main.java       |   5 --
 .../com.application/CSS/styleSheet.css        |  52 ++++++++++-
 .../com.application/CSS/styleSheet.css        |  52 ++++++++++-
 .../classes/com/application/GUI/Input.class   | Bin 0 -> 3582 bytes
 .../com/application/Main$1WorkerThread.class  | Bin 2263 -> 2263 bytes
 target/classes/com/application/Main.class     | Bin 8974 -> 8974 bytes
 7 files changed, 152 insertions(+), 38 deletions(-)
 create mode 100644 target/classes/com/application/GUI/Input.class

diff --git a/src/main/java/com/application/GUI/Input.java b/src/main/java/com/application/GUI/Input.java
index 5f948f1..92a1612 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 73d3dfc..24c69f3 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 7265a69..c6d1365 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 7265a69..c6d1365 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
GIT binary patch
literal 3582
zcmX^0Z`VEs1_l#`(_9Re4AJZiF<cBx4AGnnu?%q_Ry+qo0*FpzXGr2;NakYTU`XL$
zNCnYp91Q6k3@+>p8C(qf4AC46nIJligCPq<XM>0w4u)I~hCB|2d=7>J4u(Pwh9Y)`
zVh)B9E(RHpIi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b0rPpcGjRFp2=RgW{E^!k1pIV`1h+8==?V#NV-V5Z#vmFFRw%Zefy;_T
zk_B0*6{{pGSg|ClkoYzR5wJoDkU};|HWY>IlI#$L>_U<-g;F4e9FiO;3OOY?AqqK#
zq`?YhB86nPGsszSNpcCvZ(~r9<kH&3pvb_mjX`NQgL0$@gUWUWH7jmO?rjX}0$h6;
zG$NU`gCkjVf+JaVgCp4_S%M?kC0T<bIV9PFBL&zb*@Ghm*d;lFBLz4lIfEkwI3>A)
zcQR-)F@#HUZ(`8e#-P2MK_^m@TZBPZgh6*ZgT57yB+oVm10h2pqiqbv+ZarCGMF+k
zglmCB&9t^Lm?L6o8iOhW1A`y~2ZJyJKZ6K^D1$hIJc9&-DuXnGK7$N{DT6G7ErT3`
zGlM*XCxZfmAA=G@B!e<T0)q-eCW9(N0fQPtIfDj66N4s0CxaHlBnEAUnG8A%3mEhm
zRx{``Y+^8A*v(+baEQT(;Ut3@!xaW|hT9C549^(s89p&MFq$$rG1@Y?F#0jLGA1*)
zF=jHjGv+dQf>TWk11|#yV;X}KgEIpIgFK@@gA0Qz10#bzqdkKggDWVVF&Z+sGk7pC
zGek0qGI%n$GO#dYGO{vwF?cYrGBh!~Ven>fWng2N#Bhhfhrxq^onbY@VFq6YR|XD-
z-3*%<{1`kKI2o=m%wq6o2w>o1_{31d5Xcb3z|H8#puiB!5W>JCzy&I0AgPtXmVuFh
z37pioF<2l15!8QSV6bLjVXy%^TnwTJ>Tm`IR)%nf2nI%wGr`#-is2Xo0|OTWBf}Af
X6AVWgBpJ$}nWUV7nW2KAlA#I!0`ABR

literal 0
HcmV?d00001

diff --git a/target/classes/com/application/Main$1WorkerThread.class b/target/classes/com/application/Main$1WorkerThread.class
index 9abb12eca1a252de3954b0675b49e8a0237e772b..6d7959dd02c2288d7396e77e03326f2aa0fbfcca 100644
GIT binary patch
delta 89
zcmcaEcwKOVAv^DG22O^Z415fG7=#)2PPSuTX?lo(jo~N*C&OU|E`}ovd<-WTL>SI6
vh%=mIkYG5)Aj5E)L66}qgE_-_21kYq3|<Tu8GIS8OqSuuVmv#!og)AMALtjz

delta 89
zcmcaEcwKOVAv^B@22O^3415d+8H5=QO}1lSX?mQ2jo}mnC&LK_E{2l~d<<t9L>MkI
vh%=mHkYG5^Aj5EhL66}QgE_+$21kag3|<V^7<?ISPL|=wV!SlDog)AMFZ&oL

diff --git a/target/classes/com/application/Main.class b/target/classes/com/application/Main.class
index 0d5b4b05146df4bdf444faab24858fda26ff690c..298f3b433ab54354bbd403aa498e2291efa2336a 100644
GIT binary patch
delta 353
zcmeBk>vP-SA+4Cnu$Uo>VHZOV!vTg|hNBF53}+bf87?yvFx+G)WVp*vG&xiHf^01V
z2SWpc5JMw_3_}xxIzt<S5kotJEkg%`Cqwt<Fqx^0^^+Mm7^X4^F-&8SV3^LJz%YYB
zjbSE(4#O-4LxwpFHVktaoEhdZ_%O_82xeHo5XG>FA(de<Lk`0dhEj&53^feP7@8SY
zF!V93WSGjZieVnZYKEl@YZ%rrtYg^Du%2Nb!v=;E44WA)GHhYE!LXI#F2i+(R}8lq
zbs6q5nlRjFn7cVk&Y02g9fKgldj=(jPYl`&pBYRUzA@M^d}nZE_`%@G@RPxx;SWOu
z!(WC3hW`wij0_Bgj7*!)$@?*Saxic(axw@oaxsW8@-Qec@-e6}3NUCh3N!dKiZDbo
ziZP@xiZiq_N;32?N-<1jlxCRCD8sOXQITOUqY}dbMrDRGjH(Rh8MQa3Dta+8ZkW75
GDGmVV=~*HG

delta 353
zcmeBk>vP-SA+4Cpu$Uo_VHZOI!vTguhNBEc3}+aM87?!FFx+G)Ww^^wHaS!Jf@~uL
z2SW>k5JM}23_}}(IztzO5kohFEkh53Cqw_{Fqx^0_0t(R7-lgDG0bL=V3@<8z%Z9V
zjbR>x4#Ru~LxzP6HVlgxoEa7~_%JMC2xeHy5XG>ZA(deTLk`1AhEj%A3^fd^8JZc^
zGW0R5W0=aYo?#xt28N{!8yVIxY-ZTbu!UhC!&Zh93_BPuGVE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