diff --git a/client/app/build.gradle.kts b/client/app/build.gradle.kts index 6a5a8cf..9661289 100644 --- a/client/app/build.gradle.kts +++ b/client/app/build.gradle.kts @@ -16,7 +16,12 @@ application { mainClassName = "client.MainApplication" } +repositories { + mavenCentral() +} + dependencies { + implementation("com.jfoenix:jfoenix:9.0.10") implementation(project(":data")) } diff --git a/client/app/src/main/java/main/CreateEventController.java b/client/app/src/main/java/main/CreateEventController.java index d77c407..1c61cbf 100644 --- a/client/app/src/main/java/main/CreateEventController.java +++ b/client/app/src/main/java/main/CreateEventController.java @@ -1,33 +1,41 @@ package main; +import com.jfoenix.controls.*; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.Node; import javafx.scene.control.*; +import javafx.scene.layout.GridPane; import javafx.stage.Stage; +import javafx.util.StringConverter; +import javafx.util.converter.LocalTimeStringConverter; import res.DataController; import res.Event; +import java.time.LocalTime; +import java.time.format.FormatStyle; +import java.util.Locale; + public class CreateEventController { @FXML - public DatePicker datePickerDate; + public GridPane mainGrid; @FXML - public TextField textName; + public JFXDatePicker datePickerDate; @FXML - public TextField textStart; + public JFXTextField textName; @FXML - public TextField textEnd; + public JFXComboBox ComboBoxPriotity; @FXML - public ComboBox ComboBoxTyp; + public JFXToggleButton toggleBtnIsFullDay; @FXML - public ComboBox ComboBoxPriotity; - @FXML - public CheckBox checkBoxIsFullDay; - @FXML - public CheckBox checkBoxIsPrivate; + public JFXToggleButton toggleBtnIsPrivate; @FXML public Label labelError; + @FXML + public JFXTimePicker timeStart; + @FXML + public JFXTimePicker timeEnd; public CreateEventController() { @@ -35,6 +43,13 @@ public class CreateEventController { @FXML public void initialize() { + + StringConverter defaultConverter = new LocalTimeStringConverter(FormatStyle.SHORT, Locale.GERMANY); + timeStart.set24HourView(true); + timeStart.setConverter(defaultConverter); + + timeEnd.set24HourView(true); + timeEnd.setConverter(defaultConverter); } @@ -48,10 +63,10 @@ public class CreateEventController { Event event = new Event( textName.getText(), ComboBoxPriotity.getSelectionModel().getSelectedIndex(), - checkBoxIsFullDay.isSelected(), - checkBoxIsPrivate.isSelected(), - textStart.getText(), - textEnd.getText(), + toggleBtnIsFullDay.isSelected(), + toggleBtnIsPrivate.isSelected(), + timeStart.getValue().toString(), + timeEnd.getValue().toString(), datePickerDate.getValue().atStartOfDay(), (int) DataController.USER_ID ); diff --git a/client/app/src/main/java/main/MainApplication.java b/client/app/src/main/java/main/MainApplication.java index 6efcaa1..e0cbbdd 100644 --- a/client/app/src/main/java/main/MainApplication.java +++ b/client/app/src/main/java/main/MainApplication.java @@ -12,10 +12,12 @@ import java.util.Objects; public class MainApplication extends Application { @Override public void start(Stage stage) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("main-view.fxml")); Scene scene = new Scene(fxmlLoader.load(), 1200, 700); scene.getStylesheets().add(Objects.requireNonNull( + MainApplication.class.getResource("main-view.css")).toExternalForm()); stage.setTitle("SharePlaner"); stage.setScene(scene); diff --git a/client/app/src/main/java/main/MainController.java b/client/app/src/main/java/main/MainController.java index f9b9a51..983b955 100644 --- a/client/app/src/main/java/main/MainController.java +++ b/client/app/src/main/java/main/MainController.java @@ -148,6 +148,23 @@ public class MainController { }); Button editBtn = new Button(); editBtn.setTextValue("edit"); + editBtn.setOnAction(event1 -> { + try { + FXMLLoader fxmlLoader = new FXMLLoader( + MainApplication.class.getResource("edit-event.fxml")); + Scene scene = new Scene(fxmlLoader.load(), 650, 650); + scene.getStylesheets().add(Objects.requireNonNull( + MainApplication.class.getResource("create-event.css")).toExternalForm()); + Stage stage = new Stage(); + stage.setTitle("Termin bearbeiten"); + stage.setScene(scene); + stage.initModality(Modality.APPLICATION_MODAL); + stage.setResizable(false); + stage.showAndWait(); + } catch (IOException e) { + e.printStackTrace(); + } + }); btnHBox.getChildren().add(editBtn); btnHBox.getChildren().add(deleteBtn); vBox.getChildren().add(btnHBox); diff --git a/client/app/src/main/java/users/CreateUserController.java b/client/app/src/main/java/users/CreateUserController.java new file mode 100644 index 0000000..e40cc43 --- /dev/null +++ b/client/app/src/main/java/users/CreateUserController.java @@ -0,0 +1,55 @@ +package users; + +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.Node; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.control.ToggleButton; +import javafx.stage.Stage; + +import java.util.Objects; + +public class CreateUserController { + + public TextField textName; + public TextField textPassword; + public TextField textPasswordSecond; + public ToggleButton checkButtonIsAdmin; + public TextField textLogin; + public TextField textForename; + public Label labelError; + + @FXML + protected void createUser(ActionEvent event) { + if (textLogin.getText().trim().isEmpty()){ + labelError.setText("Bitte Login Namen angeben"); + return; + } + if (textForename.getText().trim().isEmpty()) { + labelError.setText("Bitte Vornamen eingeben!"); + return; + } + if (textName.getText().trim().isEmpty()) { + labelError.setText("Bitte Nachnamen eingeben!"); + return; + } + if (textPassword.getText().trim().isEmpty()) { + labelError.setText("Bitte Passwort eingeben!"); + return; + } + if (!Objects.equals(textPassword.getText(), textPasswordSecond.getText())){ + labelError.setText("Passwörter stimmen nicht überein!"); + return; + } + + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.close(); + } + + @FXML + protected void abortBtnClick(ActionEvent event) { + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.close(); + } +} diff --git a/client/app/src/main/java/users/LoginController.java b/client/app/src/main/java/users/LoginController.java index 0350460..3bce950 100644 --- a/client/app/src/main/java/users/LoginController.java +++ b/client/app/src/main/java/users/LoginController.java @@ -1,18 +1,18 @@ package users; +import com.jfoenix.controls.*; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.Node; import javafx.scene.control.Label; -import javafx.scene.control.TextField; import javafx.stage.Stage; import res.DataController; public class LoginController { @FXML - public TextField userField; + public JFXTextField userField; @FXML - public TextField passField; + public JFXPasswordField passField; @FXML public Label userErrLabel; @FXML diff --git a/client/app/src/main/resources/main/create-event.css b/client/app/src/main/resources/main/create-event.css index 442c669..be03557 100644 --- a/client/app/src/main/resources/main/create-event.css +++ b/client/app/src/main/resources/main/create-event.css @@ -28,10 +28,16 @@ Label{ .inputField{ -fx-padding: 10px; + -fx-background-color: white; } .mainButton{ -fx-font-weight: bold; + -fx-background-color: white; +} + +JFXButton{ + -fx-background-color: white; } #labelError{ @@ -43,4 +49,16 @@ Label{ -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/create-event.fxml b/client/app/src/main/resources/main/create-event.fxml index c56066c..e2798db 100644 --- a/client/app/src/main/resources/main/create-event.fxml +++ b/client/app/src/main/resources/main/create-event.fxml @@ -5,7 +5,9 @@ - + + @@ -23,26 +25,25 @@ - - - + + - - - - - - - - - - + + + + + + + + + + @@ -50,14 +51,14 @@ - - - - diff --git a/client/app/src/main/resources/main/edit-event.fxml b/client/app/src/main/resources/main/edit-event.fxml index 029d566..9180344 100644 --- a/client/app/src/main/resources/main/edit-event.fxml +++ b/client/app/src/main/resources/main/edit-event.fxml @@ -5,7 +5,9 @@ - + + @@ -23,26 +25,25 @@ - - - + + - - - - - - - - - - + + + + + + + + + + @@ -50,14 +51,14 @@ - - - - diff --git a/client/app/src/main/resources/main/main-view.css b/client/app/src/main/resources/main/main-view.css index af0f292..684f7b7 100644 --- a/client/app/src/main/resources/main/main-view.css +++ b/client/app/src/main/resources/main/main-view.css @@ -72,3 +72,7 @@ Label{ -fx-max-height: 40px; } +.navBtn{ + -fx-background-color: white; +} + diff --git a/client/app/src/main/resources/main/main-view.fxml b/client/app/src/main/resources/main/main-view.fxml index aa1402c..758226a 100644 --- a/client/app/src/main/resources/main/main-view.fxml +++ b/client/app/src/main/resources/main/main-view.fxml @@ -4,6 +4,7 @@ + @@ -19,15 +20,15 @@ - - - + @@ -48,9 +49,9 @@ - - - + zurück + heute + weiter diff --git a/client/app/src/main/resources/main/edit-event.css b/client/app/src/main/resources/users/create-user.css similarity index 53% rename from client/app/src/main/resources/main/edit-event.css rename to client/app/src/main/resources/users/create-user.css index 442c669..6d2ca93 100644 --- a/client/app/src/main/resources/main/edit-event.css +++ b/client/app/src/main/resources/users/create-user.css @@ -1,3 +1,12 @@ +* { + -fx-base-background-color: #2B2D42; + -fx-base1-background-color: #525E74; + + -fx-main-border-color: #B0B0B0; + -fx-main-text-color: #ffffff; +} + + GridPane{ -fx-background-color: #3E415F; -fx-padding: 20px; @@ -11,36 +20,37 @@ GridPane{ -fx-effect: dropshadow(three-pass-box, rgba(100, 100, 100, 1), 24, 0.5, 0, 0); } +.mainLabel{ + -fx-padding: 10px; + -fx-max-width: 400px; + -fx-min-width: 400px; + -fx-font-weight: bold; + -fx-alignment: top-center; +} + + 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; +.textField{ + -fx-max-width: 400px; + -fx-min-width: 400px; } -.inputField{ - -fx-padding: 10px; +.errorMessage{ + -fx-max-width: 400px; + -fx-min-width: 400px; } -.mainButton{ +Button{ + -fx-max-width: 150px; + -fx-min-width: 150px; +} + +.btnLogin{ -fx-font-weight: bold; } -#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; -} \ No newline at end of file diff --git a/client/app/src/main/resources/users/create-user.fxml b/client/app/src/main/resources/users/create-user.fxml new file mode 100644 index 0000000..3a40ebd --- /dev/null +++ b/client/app/src/main/resources/users/create-user.fxml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/app/src/main/resources/users/login.css b/client/app/src/main/resources/users/login.css index 2efd649..687435b 100644 --- a/client/app/src/main/resources/users/login.css +++ b/client/app/src/main/resources/users/login.css @@ -34,4 +34,20 @@ Label{ -fx-max-height: 400px; -fx-wrap-text: true; -fx-font-size: 16px; +} + +.userField{ + -fx-background-color: white; +} + +.passField{ + -fx-background-color: white; +} + +.quitBtn{ + -fx-background-color: white; +} + +.loginBtn{ + -fx-background-color: white; } \ No newline at end of file diff --git a/client/app/src/main/resources/users/login.fxml b/client/app/src/main/resources/users/login.fxml index 1eddceb..9356f08 100644 --- a/client/app/src/main/resources/users/login.fxml +++ b/client/app/src/main/resources/users/login.fxml @@ -2,6 +2,8 @@ + + @@ -19,14 +21,14 @@ - +