From 057c4504d4b4c517ddfaf98fa92962a819b9a72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20K=C3=BChn?= Date: Mon, 24 Jan 2022 13:42:11 +0100 Subject: [PATCH] First view draft and create user connected --- .gitignore | 2 + .../src/main/java/main/MainController.java | 16 ++++- .../src/main/java/main/OptionController.java | 62 ++++++++++++++++++ .../src/main/resources/main/option-view.css | 64 +++++++++++++++++++ .../src/main/resources/main/option-view.fxml | 54 ++++++++++++++++ client/config.json | 1 - 6 files changed, 197 insertions(+), 2 deletions(-) create mode 100644 client/app/src/main/java/main/OptionController.java create mode 100644 client/app/src/main/resources/main/option-view.css create mode 100644 client/app/src/main/resources/main/option-view.fxml delete mode 100644 client/config.json diff --git a/.gitignore b/.gitignore index f0ded7c..2532936 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,5 @@ crashlytics-build.properties .gradle/ build/ + +/client/config.json \ No newline at end of file diff --git a/client/app/src/main/java/main/MainController.java b/client/app/src/main/java/main/MainController.java index 2fb1398..39a2f77 100644 --- a/client/app/src/main/java/main/MainController.java +++ b/client/app/src/main/java/main/MainController.java @@ -120,7 +120,21 @@ public class MainController { } protected void onSettingBtnClick(){ - + try{ + FXMLLoader fxmlLoader = new FXMLLoader( + MainApplication.class.getResource("option-view.fxml")); + Scene scene = new Scene(fxmlLoader.load(), 650, 650); + scene.getStylesheets().add(Objects.requireNonNull( + MainApplication.class.getResource("option-view.css")).toExternalForm()); + Stage stage = new Stage(); + stage.setTitle("Einstellungen"); + stage.setScene(scene); + stage.initModality(Modality.APPLICATION_MODAL); + stage.setResizable(false); + stage.showAndWait(); + } catch (IOException e) { + e.printStackTrace(); + } } protected void onLogoutBtnClick(){ diff --git a/client/app/src/main/java/main/OptionController.java b/client/app/src/main/java/main/OptionController.java new file mode 100644 index 0000000..8ca0b93 --- /dev/null +++ b/client/app/src/main/java/main/OptionController.java @@ -0,0 +1,62 @@ +package main; + +import com.jfoenix.controls.*; +import javafx.collections.FXCollections; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Node; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.stage.Modality; +import javafx.stage.Stage; + +import java.io.IOException; +import java.util.Objects; + +public class OptionController { + + @FXML + public JFXButton updateUserBtn; + @FXML + public JFXButton deleteUserBtn; + @FXML + public JFXButton createUserBtn; + @FXML + public JFXToggleButton saveLoginTBtn; + @FXML + public Label labelError; + @FXML + public JFXComboBox userCmb; + + public void onBackBtnClick(ActionEvent actionEvent) { + Stage stage = (Stage) ((Node) actionEvent.getSource()).getScene().getWindow(); + stage.close(); + } + + public void onCreateBtnClick(ActionEvent actionEvent) { + try{ + FXMLLoader fxmlLoader = new FXMLLoader( + MainApplication.class.getResource("../users/create-user.fxml")); + Scene scene = new Scene(fxmlLoader.load(), 800, 650); + scene.getStylesheets().add(Objects.requireNonNull( + MainApplication.class.getResource("../users/create-user.css")).toExternalForm()); + Stage stage = new Stage(); + stage.setTitle("User erstellen"); + stage.setScene(scene); + stage.initModality(Modality.APPLICATION_MODAL); + stage.setResizable(false); + stage.showAndWait(); + Stage stageOld = (Stage) ((Node) actionEvent.getSource()).getScene().getWindow(); + stageOld.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void onUpdateBtnClick(ActionEvent actionEvent) { + } + + public void onDeleteBtnClick(ActionEvent actionEvent) { + } +} diff --git a/client/app/src/main/resources/main/option-view.css b/client/app/src/main/resources/main/option-view.css new file mode 100644 index 0000000..be03557 --- /dev/null +++ b/client/app/src/main/resources/main/option-view.css @@ -0,0 +1,64 @@ +GridPane{ + -fx-background-color: #3E415F; + -fx-padding: 20px; + -fx-font-size: 20px; + -fx-font-family: Segoe UI; + + -fx-border-insets: 1; + -fx-border-color: #B0B0B0; + -fx-border-style: solid; + -fx-border-width: 2; + -fx-effect: dropshadow(three-pass-box, rgba(100, 100, 100, 1), 24, 0.5, 0, 0); +} + +Label{ + -fx-text-fill: white; + -fx-max-width: 150px; + -fx-min-width: 150px; +} + +.mainLabel{ + -fx-background-color: #8D99AE; + -fx-padding: 10px; + -fx-max-width: 200px; + -fx-min-width: 200px; + -fx-font-weight: bold; + -fx-alignment: center; +} + +.inputField{ + -fx-padding: 10px; + -fx-background-color: white; +} + +.mainButton{ + -fx-font-weight: bold; + -fx-background-color: white; +} + +JFXButton{ + -fx-background-color: white; +} + +#labelError{ + -fx-font-weight: bold; + -fx-max-width: 1000px; + -fx-text-fill: #ff5555; + -fx-padding: 16px; + -fx-min-height: 140px; + -fx-max-height: 400px; + -fx-wrap-text: true; + -fx-font-size: 16px; +} + +.inputDate{ + -fx-background-color: white; +} + +.comboBox{ + -fx-background-color: white; +} + +.timePicker{ + -fx-background-color: white; +} \ No newline at end of file diff --git a/client/app/src/main/resources/main/option-view.fxml b/client/app/src/main/resources/main/option-view.fxml new file mode 100644 index 0000000..eba5db6 --- /dev/null +++ b/client/app/src/main/resources/main/option-view.fxml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + User bearbeiten + User löschen + User anlegen + + + + + diff --git a/client/config.json b/client/config.json deleted file mode 100644 index e80bf9d..0000000 --- a/client/config.json +++ /dev/null @@ -1 +0,0 @@ -{"saveLogin":true,"id":1,"token":"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtYXJjIn0.NdOMxKKgH4ZNZ84uA81L57vJtR9OhTVyKwtNsOuZhFQ"} \ No newline at end of file