Skip to content
Snippets Groups Projects
Commit 09df61f1 authored by Eilert Tunheim's avatar Eilert Tunheim
Browse files

commented input window

parent 9014fe57
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,9 @@ import static com.application.DB.DB.setInputParameters; ...@@ -32,6 +32,9 @@ import static com.application.DB.DB.setInputParameters;
*/ */
public class InputPopup { public class InputPopup {
/**
* This function displays the input parameter window
*/
public static void display() { public static void display() {
Stage window = new Stage(); Stage window = new Stage();
...@@ -127,10 +130,9 @@ public class InputPopup { ...@@ -127,10 +130,9 @@ public class InputPopup {
Constants.MOISTURE_GOAL = moistureList.getValue(); Constants.MOISTURE_GOAL = moistureList.getValue();
} }
boolean err = false; boolean err = false;
// If an account is not logged in, then the search is not started
if(getLogin().getText().equals("Login")){ if(getLogin().getText().equals("Login")){
err = true; err = true;
NotificationPopUp.displayNotificationWindow("Please login!"); NotificationPopUp.displayNotificationWindow("Please login!");
...@@ -150,29 +152,22 @@ public class InputPopup { ...@@ -150,29 +152,22 @@ public class InputPopup {
Constants.MOISTURE_GOAL = ""; 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 // Validates inputs
if(isValidInput(Constants.TREE_SPECIES) || if(isValidInput(Constants.TREE_SPECIES) ||
isValidInput(Constants.DIMENSIONS) || isValidInput(Constants.DIMENSIONS) ||
isValidInput(Constants.SAWSET) || isValidInput(Constants.SAWSET) ||
isValidInput(Constants.MOISTURE_GOAL)) { isValidInput(Constants.MOISTURE_GOAL)) {
err = true; err = true;
treeSpeciesList.setValue(""); treeSpeciesList.setValue("");
dimensionsList.setValue(""); dimensionsList.setValue("");
sawsetList.setValue(""); sawsetList.setValue("");
moistureList.setValue(""); moistureList.setValue("");
} }
// Checks if there is an error, if so the search is not started
if (!err) { if (!err) {
// Sets the values in the text-fields
setTreeSpeciesText(Constants.TREE_SPECIES); setTreeSpeciesText(Constants.TREE_SPECIES);
setDimensionsText(Constants.DIMENSIONS); setDimensionsText(Constants.DIMENSIONS);
setSawsetText(Constants.SAWSET); setSawsetText(Constants.SAWSET);
...@@ -205,9 +200,7 @@ public class InputPopup { ...@@ -205,9 +200,7 @@ public class InputPopup {
thread.setDaemon(true); thread.setDaemon(true);
thread.interrupt(); thread.interrupt();
thread.join(); thread.join();
//Platform.exit();
thread.start(); thread.start();
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
...@@ -237,15 +230,14 @@ public class InputPopup { ...@@ -237,15 +230,14 @@ public class InputPopup {
liveDataThread.setDaemon(true); liveDataThread.setDaemon(true);
liveDataThread.interrupt(); liveDataThread.interrupt();
liveDataThread.join(); liveDataThread.join();
//Platform.exit();
liveDataThread.start(); liveDataThread.start();
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
} }
}); });
// Adds all the components to the VBox
VBox layout = new VBox(10); VBox layout = new VBox(10);
layout.getChildren().addAll(inputLabel, treeSpeciesInputLabel, treeSpeciesList, dimensionsInputLabel, dimensionsList, layout.getChildren().addAll(inputLabel, treeSpeciesInputLabel, treeSpeciesList, dimensionsInputLabel, dimensionsList,
sawsetInputLabel, sawsetList, moistureGoalInputLabel, moistureList, startButton); sawsetInputLabel, sawsetList, moistureGoalInputLabel, moistureList, startButton);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment