Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Bacheloroppgave_2022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eilert Tunheim
Bacheloroppgave_2022
Commits
09df61f1
Commit
09df61f1
authored
3 years ago
by
Eilert Tunheim
Browse files
Options
Downloads
Patches
Plain Diff
commented input window
parent
9014fe57
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/application/GUI/PopUpWindows/InputPopup.java
+7
-15
7 additions, 15 deletions
...ain/java/com/application/GUI/PopUpWindows/InputPopup.java
with
7 additions
and
15 deletions
src/main/java/com/application/GUI/PopUpWindows/InputPopup.java
+
7
−
15
View file @
09df61f1
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment