Compare commits
6 Commits
646da71e8a
...
654f34e30e
Author | SHA1 | Date | |
---|---|---|---|
654f34e30e | |||
baeed584ab | |||
ce309581ed | |||
f0405b5d86 | |||
0d105be15c | |||
eb55d5c650 |
@ -16,7 +16,12 @@ application {
|
|||||||
mainClassName = "client.MainApplication"
|
mainClassName = "client.MainApplication"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation("com.jfoenix:jfoenix:9.0.10")
|
||||||
implementation(project(":data"))
|
implementation(project(":data"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,24 +1,30 @@
|
|||||||
package main;
|
package main;
|
||||||
|
|
||||||
|
import com.jfoenix.controls.JFXTimePicker;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
|
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
|
||||||
|
public GridPane mainGrid;
|
||||||
@FXML
|
@FXML
|
||||||
public DatePicker datePickerDate;
|
public DatePicker datePickerDate;
|
||||||
@FXML
|
@FXML
|
||||||
public TextField textName;
|
public TextField textName;
|
||||||
@FXML
|
@FXML
|
||||||
public TextField textStart;
|
|
||||||
@FXML
|
|
||||||
public TextField textEnd;
|
|
||||||
@FXML
|
|
||||||
public ComboBox<String> ComboBoxTyp;
|
public ComboBox<String> ComboBoxTyp;
|
||||||
@FXML
|
@FXML
|
||||||
public ComboBox<String> ComboBoxPriotity;
|
public ComboBox<String> ComboBoxPriotity;
|
||||||
@ -28,6 +34,10 @@ public class CreateEventController {
|
|||||||
public CheckBox checkBoxIsPrivate;
|
public CheckBox checkBoxIsPrivate;
|
||||||
@FXML
|
@FXML
|
||||||
public Label labelError;
|
public Label labelError;
|
||||||
|
@FXML
|
||||||
|
public JFXTimePicker timeStart;
|
||||||
|
@FXML
|
||||||
|
public JFXTimePicker timeEnd;
|
||||||
|
|
||||||
|
|
||||||
public CreateEventController() {
|
public CreateEventController() {
|
||||||
@ -35,6 +45,22 @@ public class CreateEventController {
|
|||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
|
||||||
|
StringConverter<LocalTime> defaultConverter = new LocalTimeStringConverter(FormatStyle.SHORT, Locale.GERMANY);
|
||||||
|
|
||||||
|
JFXTimePicker timePickerStart = new JFXTimePicker();
|
||||||
|
timeStart = timePickerStart;
|
||||||
|
timePickerStart.set24HourView(true);
|
||||||
|
timePickerStart.setConverter(defaultConverter);
|
||||||
|
timePickerStart.getStyleClass().add("timePicker");
|
||||||
|
mainGrid.add(timePickerStart, 1 , 3);
|
||||||
|
|
||||||
|
JFXTimePicker timePickerEnd = new JFXTimePicker();
|
||||||
|
timeEnd = timePickerEnd;
|
||||||
|
timePickerEnd.set24HourView(true);
|
||||||
|
timePickerEnd.setConverter(defaultConverter);
|
||||||
|
timePickerEnd.getStyleClass().add("timePicker");
|
||||||
|
mainGrid.add(timePickerEnd, 1 , 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -50,8 +76,8 @@ public class CreateEventController {
|
|||||||
ComboBoxPriotity.getSelectionModel().getSelectedIndex(),
|
ComboBoxPriotity.getSelectionModel().getSelectedIndex(),
|
||||||
checkBoxIsFullDay.isSelected(),
|
checkBoxIsFullDay.isSelected(),
|
||||||
checkBoxIsPrivate.isSelected(),
|
checkBoxIsPrivate.isSelected(),
|
||||||
textStart.getText(),
|
timeStart.getValue().toString(),
|
||||||
textEnd.getText(),
|
timeEnd.getValue().toString(),
|
||||||
datePickerDate.getValue().atStartOfDay(),
|
datePickerDate.getValue().atStartOfDay(),
|
||||||
(int) DataController.USER_ID
|
(int) DataController.USER_ID
|
||||||
);
|
);
|
||||||
|
@ -148,6 +148,23 @@ public class MainController {
|
|||||||
});
|
});
|
||||||
Button editBtn = new Button();
|
Button editBtn = new Button();
|
||||||
editBtn.setTextValue("edit");
|
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(editBtn);
|
||||||
btnHBox.getChildren().add(deleteBtn);
|
btnHBox.getChildren().add(deleteBtn);
|
||||||
vBox.getChildren().add(btnHBox);
|
vBox.getChildren().add(btnHBox);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<?import javafx.collections.FXCollections?>
|
<?import javafx.collections.FXCollections?>
|
||||||
<?import java.lang.String?>
|
<?import java.lang.String?>
|
||||||
<GridPane 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>
|
||||||
@ -39,8 +39,6 @@
|
|||||||
|
|
||||||
<DatePicker fx:id="datePickerDate" GridPane.columnIndex="1" GridPane.rowIndex="1" maxWidth="400" minWidth="400"/>
|
<DatePicker fx:id="datePickerDate" GridPane.columnIndex="1" GridPane.rowIndex="1" maxWidth="400" minWidth="400"/>
|
||||||
<TextField fx:id="textName" GridPane.columnIndex="1" GridPane.rowIndex="2" maxWidth="400" minWidth="400"/>
|
<TextField fx:id="textName" GridPane.columnIndex="1" GridPane.rowIndex="2" maxWidth="400" minWidth="400"/>
|
||||||
<TextField fx:id="textStart" GridPane.columnIndex="1" GridPane.rowIndex="3" maxWidth="400" minWidth="400"/>
|
|
||||||
<TextField fx:id="textEnd" GridPane.columnIndex="1" GridPane.rowIndex="4" maxWidth="400" minWidth="400"/>
|
|
||||||
<ComboBox fx:id="ComboBoxTyp" GridPane.columnIndex="1" GridPane.rowIndex="5" maxWidth="400" minWidth="400"/>
|
<ComboBox fx:id="ComboBoxTyp" GridPane.columnIndex="1" GridPane.rowIndex="5" maxWidth="400" minWidth="400"/>
|
||||||
<ComboBox fx:id="ComboBoxPriotity" GridPane.columnIndex="1" GridPane.rowIndex="6" maxWidth="200" minWidth="200">
|
<ComboBox fx:id="ComboBoxPriotity" GridPane.columnIndex="1" GridPane.rowIndex="6" maxWidth="200" minWidth="200">
|
||||||
<items>
|
<items>
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
<?import javafx.collections.FXCollections?>
|
<?import javafx.collections.FXCollections?>
|
||||||
<?import java.lang.String?>
|
<?import java.lang.String?>
|
||||||
<GridPane 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>
|
||||||
@ -39,8 +39,6 @@
|
|||||||
|
|
||||||
<DatePicker fx:id="datePickerDate" GridPane.columnIndex="1" GridPane.rowIndex="1" maxWidth="400" minWidth="400"/>
|
<DatePicker fx:id="datePickerDate" GridPane.columnIndex="1" GridPane.rowIndex="1" maxWidth="400" minWidth="400"/>
|
||||||
<TextField fx:id="textName" GridPane.columnIndex="1" GridPane.rowIndex="2" maxWidth="400" minWidth="400"/>
|
<TextField fx:id="textName" GridPane.columnIndex="1" GridPane.rowIndex="2" maxWidth="400" minWidth="400"/>
|
||||||
<TextField fx:id="textStart" GridPane.columnIndex="1" GridPane.rowIndex="3" maxWidth="400" minWidth="400"/>
|
|
||||||
<TextField fx:id="textEnd" GridPane.columnIndex="1" GridPane.rowIndex="4" maxWidth="400" minWidth="400"/>
|
|
||||||
<ComboBox fx:id="ComboBoxTyp" GridPane.columnIndex="1" GridPane.rowIndex="5" maxWidth="400" minWidth="400"/>
|
<ComboBox fx:id="ComboBoxTyp" GridPane.columnIndex="1" GridPane.rowIndex="5" maxWidth="400" minWidth="400"/>
|
||||||
<ComboBox fx:id="ComboBoxPriotity" GridPane.columnIndex="1" GridPane.rowIndex="6" maxWidth="200" minWidth="200">
|
<ComboBox fx:id="ComboBoxPriotity" GridPane.columnIndex="1" GridPane.rowIndex="6" maxWidth="200" minWidth="200">
|
||||||
<items>
|
<items>
|
||||||
|
Loading…
Reference in New Issue
Block a user