"src/git@git.gvk.idi.ntnu.no:HermanDyrkorn/the-hurlers.git" did not exist on "de3be45ef7a596563efc5850d60c5b6da48c850e"
Newer
Older
package com.application.GUI;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.*;
import static com.application.DB.Constants.*;
import com.application.Main;
/**
* This class handles the popup input window
*
* @author Eilert Tunheim, Karin Pettersen, Mads Arnesen
* @version 1.0
public class InputPopUpWindow {
public static void display()
{
Eilert Tunheim
committed
Stage window = new Stage();
Eilert Tunheim
committed
window.initModality(Modality.APPLICATION_MODAL);
window.setTitle("Input Parameters");
Eilert Tunheim
committed
// Top
Label inputLabel= new Label("Input");
Eilert Tunheim
committed
inputLabel.setId("inputTop");
// Center - Input fields
Eilert Tunheim
committed
Label treeSpeciesInputLabel = new Label("Tree Species");
treeSpeciesInputLabel.setId("inputLabel");
TextField treeSpeciesInputText = new TextField();
treeSpeciesInputText.setId("inputLabelText");
treeSpeciesInputText.setPromptText("Bjørk");
treeSpeciesInputText.getText();
// Width
Label widthInputLabel = new Label("Width");
widthInputLabel.setId("inputLabel");
TextField widthInputText = new TextField();
widthInputText.setId("inputLabelText");
widthInputText.setPromptText("47");
// Height
Label heightInputLabel = new Label("Height");
heightInputLabel.setId("inputLabel");
TextField heightInputText = new TextField();
heightInputText.setId("inputLabelText");
heightInputText.setPromptText("200");
// Sawset
Eilert Tunheim
committed
Label sawsetInputLabel = new Label("Sawset");
sawsetInputLabel.setId("inputLabel");
TextField sawsetInputText = new TextField();
sawsetInputText.setId("inputLabelText");
sawsetInputText.setPromptText("4x");
Eilert Tunheim
committed
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 -> {
TREE_SPECIES = treeSpeciesInputText.getText();
WIDTH_DIMENTION = treeSpeciesInputText.getText();
HEIGHT_DIMENTION = heightInputText.getText();
SAWSET = sawsetInputText.getText();
MOISTURE_GOAL = moistureGoalInputText.getText();
// Call på getKwh()
try {
} catch (Exception ex) {
ex.printStackTrace();
}
Eilert Tunheim
committed
window.close();
});
VBox layout = new VBox(10);
layout.getChildren().addAll(inputLabel, treeSpeciesInputLabel, treeSpeciesInputText, widthInputLabel, widthInputText, heightInputLabel, heightInputText,
Eilert Tunheim
committed
sawsetInputLabel, sawsetInputText, moistureGoalInputLabel, moistureGoalInputText, startButton);
layout.setAlignment(Pos.CENTER);
Scene scene = new Scene(layout, 600, 500);
scene.getStylesheets().add(InputPopUpWindow.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
Eilert Tunheim
committed
window.setScene(scene);
window.showAndWait();