Added TimePicker to edit event, time is used

This commit is contained in:
Marco Kühn 2022-01-13 11:02:49 +01:00
parent f0405b5d86
commit ce309581ed
5 changed files with 15 additions and 50 deletions

View File

@ -7,9 +7,15 @@ import javafx.scene.Node;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.util.StringConverter;
import javafx.util.converter.LocalTimeStringConverter;
import res.DataController; import res.DataController;
import res.Event; import res.Event;
import java.time.LocalTime;
import java.time.format.FormatStyle;
import java.util.Locale;
public class CreateEventController { public class CreateEventController {
@FXML @FXML
@ -65,8 +71,8 @@ public class CreateEventController {
ComboBoxPriotity.getSelectionModel().getSelectedIndex(), ComboBoxPriotity.getSelectionModel().getSelectedIndex(),
checkBoxIsFullDay.isSelected(), checkBoxIsFullDay.isSelected(),
checkBoxIsPrivate.isSelected(), checkBoxIsPrivate.isSelected(),
timeStart.toString(), timeStart.getValue().toString(),
timeEnd.toString(), timeEnd.getValue().toString(),
datePickerDate.getValue().atStartOfDay(), datePickerDate.getValue().atStartOfDay(),
(int) DataController.USER_ID (int) DataController.USER_ID
); );

View File

@ -154,7 +154,7 @@ public class MainController {
MainApplication.class.getResource("edit-event.fxml")); MainApplication.class.getResource("edit-event.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 650, 650); Scene scene = new Scene(fxmlLoader.load(), 650, 650);
scene.getStylesheets().add(Objects.requireNonNull( scene.getStylesheets().add(Objects.requireNonNull(
MainApplication.class.getResource("edit-event.css")).toExternalForm()); MainApplication.class.getResource("create-event.css")).toExternalForm());
Stage stage = new Stage(); Stage stage = new Stage();
stage.setTitle("Termin bearbeiten"); stage.setTitle("Termin bearbeiten");
stage.setScene(scene); stage.setScene(scene);

View File

@ -43,4 +43,9 @@ Label{
-fx-max-height: 400px; -fx-max-height: 400px;
-fx-wrap-text: true; -fx-wrap-text: true;
-fx-font-size: 16px; -fx-font-size: 16px;
}
.timePicker{
-fx-background-color: white;
-fx-max-width: 150px;
} }

View File

@ -1,46 +0,0 @@
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;
}
.mainButton{
-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;
}

View File

@ -5,7 +5,7 @@
<?import javafx.collections.FXCollections?> <?import javafx.collections.FXCollections?>
<?import java.lang.String?> <?import java.lang.String?>
<GridPane fx:id="grid" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1" <GridPane fx:id="mainGrid" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="main.CreateEventController"> fx:controller="main.CreateEventController">
<columnConstraints> <columnConstraints>