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

Added loginbutton to the logobar, not functional yet

parent a2e01d93
No related branches found
No related tags found
No related merge requests found
Showing
with 70 additions and 15 deletions
package com.application.GUI.Panes;
import com.application.GUI.PopUpWindows.LoginPopup;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
......@@ -41,6 +44,13 @@ public class LogoBar {
Region region2 = new Region();
HBox.setHgrow(region2, Priority.ALWAYS);
return new HBox(imageViewM, region1, imageViewTitle, region2);
// Login button
Button login = new Button("Login");
login.setOnAction(event -> {
LoginPopup.login();
});
return new HBox(imageViewM, region1, imageViewTitle, region2, login);
}
}
\ No newline at end of file
package com.application.GUI.Panes;
import com.application.DB.Constants;
import com.application.GUI.PopUpWindows.InputPopUpWindow;
import com.application.GUI.PopUpWindows.OutputPopUpWindow;
import com.application.GUI.PopUpWindows.InputPopup;
import com.application.GUI.PopUpWindows.OutputPopup;
import com.application.GUI.ProgressBar.RingProgressIndicator;
import com.application.Main;
import javafx.application.Platform;
......@@ -72,11 +72,11 @@ public class SideBar {
Button inputParametersButton = new Button("Input Parameters");
inputParametersButton.setId("sideBarButtonInputParameters");
inputParametersButton.setOnAction(e -> InputPopUpWindow.display());
inputParametersButton.setOnAction(e -> InputPopup.display());
Button finishButton = new Button("Finish");
finishButton.setId("sideBarButtonFinish");
finishButton.setOnAction(e -> OutputPopUpWindow.displayOutputWindow());
finishButton.setOnAction(e -> OutputPopup.displayOutputWindow());
Button exitButton = new Button("Exit");
exitButton.setId("sideBarButtonExit");
......
......@@ -29,7 +29,7 @@ import static com.application.DB.DB.setInputParameters;
* @author Eilert Tunheim, Karin Pettersen, Mads Arnesen
* @version 1.0
*/
public class InputPopUpWindow {
public class InputPopup {
public static void display() {
......@@ -334,7 +334,7 @@ public class InputPopUpWindow {
layout.setAlignment(Pos.CENTER);
Scene scene = new Scene(layout, 600, 500);
scene.getStylesheets().add(InputPopUpWindow.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
scene.getStylesheets().add(InputPopup.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
window.setScene(scene);
window.showAndWait();
}
......
package com.application.GUI.PopUpWindows;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.scene.text.TextAlignment;
import javafx.stage.Modality;
import javafx.stage.Stage;
public class LoginPopup {
public static void login(){
Stage window = new Stage();
window.initModality(Modality.APPLICATION_MODAL);
window.setTitle("Login window");
Label userNameLabel = new Label("Username:");
Label passwordLabel = new Label("Password:");
TextField userNameTextField = new TextField();
TextField passwordTextField = new TextField();
userNameTextField.getText();
passwordTextField.getText();
Button loginButton = new Button("Login");
Button closeButton = new Button("Close");
loginButton.setOnAction(event -> {
});
closeButton.setOnAction(event -> window.close());
VBox layout = new VBox(10);
layout.setAlignment(Pos.CENTER);
layout.getChildren().addAll(userNameLabel, userNameTextField, passwordLabel, passwordTextField, loginButton, closeButton);
Scene scene = new Scene(layout, 500, 300);
scene.getStylesheets().add(InputPopup.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
window.setScene(scene);
window.showAndWait();
}
}
package com.application.GUI.PopUpWindows;
import com.application.GUI.PopUpWindows.InputPopUpWindow;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
......@@ -31,7 +30,7 @@ public class NotificationPopUp {
layout.getChildren().addAll(messageLabel,close);
Scene scene = new Scene(layout, 300, 200);
scene.getStylesheets().add(InputPopUpWindow.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
scene.getStylesheets().add(InputPopup.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
window.setScene(scene);
window.showAndWait();
}
......
......@@ -2,8 +2,6 @@ package com.application.GUI.PopUpWindows;
import com.application.DB.Constants;
import com.application.DB.DB;
import com.application.GUI.PopUpWindows.InputPopUpWindow;
import com.application.GUI.PopUpWindows.NotificationPopUp;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
......@@ -19,7 +17,7 @@ import java.time.format.DateTimeFormatter;
import static com.application.DB.Constants.IS_FINISHED;
import static com.application.DB.Constants.MAX_USER_INPUT_CHARACTERS;
public class OutputPopUpWindow {
public class OutputPopup {
public static void displayOutputWindow(){
......@@ -116,7 +114,7 @@ public class OutputPopUpWindow {
layout.getChildren().addAll(moistureCheckLabelHuge,moistureCheckTextField,countinueButton,finishButton);
Scene scene = new Scene(layout, 600, 500);
scene.getStylesheets().add(InputPopUpWindow.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
scene.getStylesheets().add(InputPopup.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
window.setScene(scene);
window.showAndWait();
}
......
package com.application;
import com.application.GUI.PopUpWindows.InputPopUpWindow;
import com.application.GUI.PopUpWindows.InputPopup;
import com.application.GUI.Panes.BottomBar;
import com.application.GUI.Panes.LogoBar;
import com.application.GUI.Panes.SideBar;
......@@ -137,7 +137,7 @@ public class Main extends Application {
primaryStage.show();
// Displays the input parameters popup window
InputPopUpWindow.display();
InputPopup.display();
}
public static void setTreeSpeciesText(String treeSpeciesText) {
......
No preview for this file type
No preview for this file type
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.
Finish editing this message first!
Please register or to comment