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

Added input-popup window, started filling in textfields, labels and buttons

parent c2e4f346
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
......
......@@ -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");
......
/* 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;
}
/* 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;
}
File added
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment