diff --git a/src/main/java/com/application/GUI/PopUpWindows/InputPopup.java b/src/main/java/com/application/GUI/PopUpWindows/InputPopup.java index 6b7fa64e867a8c2f9a09119e053cfbe82708b802..62b2326d13fda3d8f17854e199ecbe2bf362d60a 100644 --- a/src/main/java/com/application/GUI/PopUpWindows/InputPopup.java +++ b/src/main/java/com/application/GUI/PopUpWindows/InputPopup.java @@ -32,6 +32,9 @@ import static com.application.DB.DB.setInputParameters; */ public class InputPopup { + /** + * This function displays the input parameter window + */ public static void display() { Stage window = new Stage(); @@ -127,10 +130,9 @@ public class InputPopup { Constants.MOISTURE_GOAL = moistureList.getValue(); } - - boolean err = false; + // If an account is not logged in, then the search is not started if(getLogin().getText().equals("Login")){ err = true; NotificationPopUp.displayNotificationWindow("Please login!"); @@ -150,29 +152,22 @@ public class InputPopup { Constants.MOISTURE_GOAL = ""; } - System.out.println(getLogin().getText()); - - System.out.println("TREE_SPECIES: "+ Constants.TREE_SPECIES); - System.out.println("DIMENSIONS: "+ Constants.DIMENSIONS); - System.out.println("SAWSET: "+ Constants.SAWSET); - System.out.println("MOISTURE_GOAL: "+ Constants.MOISTURE_GOAL); - // Validates inputs if(isValidInput(Constants.TREE_SPECIES) || isValidInput(Constants.DIMENSIONS) || isValidInput(Constants.SAWSET) || isValidInput(Constants.MOISTURE_GOAL)) { - err = true; - treeSpeciesList.setValue(""); dimensionsList.setValue(""); sawsetList.setValue(""); moistureList.setValue(""); } + // Checks if there is an error, if so the search is not started if (!err) { + // Sets the values in the text-fields setTreeSpeciesText(Constants.TREE_SPECIES); setDimensionsText(Constants.DIMENSIONS); setSawsetText(Constants.SAWSET); @@ -205,9 +200,7 @@ public class InputPopup { thread.setDaemon(true); thread.interrupt(); thread.join(); - //Platform.exit(); thread.start(); - } catch (Exception ex) { ex.printStackTrace(); } @@ -237,15 +230,14 @@ public class InputPopup { liveDataThread.setDaemon(true); liveDataThread.interrupt(); liveDataThread.join(); - //Platform.exit(); liveDataThread.start(); - } catch (Exception ex) { ex.printStackTrace(); } } }); + // Adds all the components to the VBox VBox layout = new VBox(10); layout.getChildren().addAll(inputLabel, treeSpeciesInputLabel, treeSpeciesList, dimensionsInputLabel, dimensionsList, sawsetInputLabel, sawsetList, moistureGoalInputLabel, moistureList, startButton);