Formatted code

This commit is contained in:
Marco Kühn 2021-12-22 15:04:15 +01:00
parent 66edff8ed5
commit c754b77c81
11 changed files with 87 additions and 76 deletions

View File

@ -30,7 +30,6 @@ public class CreateEventController {
public Label labelError; public Label labelError;
public CreateEventController() { public CreateEventController() {
} }

View File

@ -15,13 +15,15 @@ public class MainApplication extends Application {
FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("main-view.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("main-view.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 1200, 700); Scene scene = new Scene(fxmlLoader.load(), 1200, 700);
scene.getStylesheets().add(Objects.requireNonNull(MainApplication.class.getResource("main-view.css")).toExternalForm()); scene.getStylesheets().add(Objects.requireNonNull(
MainApplication.class.getResource("main-view.css")).toExternalForm());
stage.setTitle("SharePlaner"); stage.setTitle("SharePlaner");
stage.setScene(scene); stage.setScene(scene);
FXMLLoader fxmlLoaderLogin = new FXMLLoader(MainApplication.class.getResource("../users/login.fxml")); FXMLLoader fxmlLoaderLogin = new FXMLLoader(MainApplication.class.getResource("../users/login.fxml"));
Scene sceneLogin = new Scene(fxmlLoaderLogin.load(), 650, 500); Scene sceneLogin = new Scene(fxmlLoaderLogin.load(), 650, 500);
sceneLogin.getStylesheets().add(Objects.requireNonNull(MainApplication.class.getResource("../users/login.css")).toExternalForm()); sceneLogin.getStylesheets().add(Objects.requireNonNull(
MainApplication.class.getResource("../users/login.css")).toExternalForm());
Stage stageLogin = new Stage(); Stage stageLogin = new Stage();
stageLogin.setTitle("Anmelden"); stageLogin.setTitle("Anmelden");
stageLogin.setScene(sceneLogin); stageLogin.setScene(sceneLogin);

View File

@ -89,9 +89,11 @@ public class MainController {
@FXML @FXML
protected void onAddBtnClick() { protected void onAddBtnClick() {
try { try {
FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("create-event.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(
MainApplication.class.getResource("create-event.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 650, 650); Scene scene = new Scene(fxmlLoader.load(), 650, 650);
scene.getStylesheets().add(Objects.requireNonNull(MainApplication.class.getResource("create-event.css")).toExternalForm()); scene.getStylesheets().add(Objects.requireNonNull(
MainApplication.class.getResource("create-event.css")).toExternalForm());
Stage stage = new Stage(); Stage stage = new Stage();
stage.setTitle("Termin erstellen"); stage.setTitle("Termin erstellen");
stage.setScene(scene); stage.setScene(scene);
@ -182,7 +184,8 @@ public class MainController {
LocalDateTime eventDate = event.getDate(); LocalDateTime eventDate = event.getDate();
int day = (int) Duration.between(weekStartDateTime.toLocalDate().atStartOfDay(), eventDate.toLocalDate().atStartOfDay()).toDays(); int day = (int) Duration.between(
weekStartDateTime.toLocalDate().atStartOfDay(), eventDate.toLocalDate().atStartOfDay()).toDays();
if (day >= 0 && day < 7) { if (day >= 0 && day < 7) {
dayVBoxes[day].getChildren().add(vBox); dayVBoxes[day].getChildren().add(vBox);

View File

@ -5,7 +5,8 @@
<?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" fx:controller="main.CreateEventController"> <GridPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="main.CreateEventController">
<columnConstraints> <columnConstraints>
<ColumnConstraints/> <ColumnConstraints/>

View File

@ -5,7 +5,8 @@
<?import javafx.scene.image.*?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<GridPane style="-fx-background-color: #424242;" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1" fx:controller="main.MainController"> <GridPane style="-fx-background-color: #424242;" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="main.MainController">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="NEVER" maxWidth="60.0" minWidth="60.0"/> <ColumnConstraints hgrow="NEVER" maxWidth="60.0" minWidth="60.0"/>
<ColumnConstraints hgrow="ALWAYS"/> <ColumnConstraints hgrow="ALWAYS"/>
@ -13,7 +14,8 @@
<rowConstraints> <rowConstraints>
<RowConstraints vgrow="SOMETIMES"/> <RowConstraints vgrow="SOMETIMES"/>
</rowConstraints> </rowConstraints>
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" spacing="5.0" style="-fx-background-color: #525E74;"> <VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" spacing="5.0"
style="-fx-background-color: #525E74;">
<ImageView fitHeight="50.0" fitWidth="50.0" pickOnBounds="true" preserveRatio="true"> <ImageView fitHeight="50.0" fitWidth="50.0" pickOnBounds="true" preserveRatio="true">
</ImageView> </ImageView>
@ -39,7 +41,8 @@
<RowConstraints/> <RowConstraints/>
<RowConstraints vgrow="ALWAYS"/> <RowConstraints vgrow="ALWAYS"/>
</rowConstraints> </rowConstraints>
<Label fx:id="LabelMonth" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" styleClass="labelMonth" textFill="WHITE" GridPane.columnIndex="0" GridPane.rowIndex="0"> <Label fx:id="LabelMonth" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
styleClass="labelMonth" textFill="WHITE" GridPane.columnIndex="0" GridPane.rowIndex="0">
Monat Monat
<padding> <padding>
<Insets left="5"/> <Insets left="5"/>
@ -49,9 +52,11 @@
<Button onAction="#onTodayClick" GridPane.columnIndex="2" maxHeight="1.7976931348623157E308">heute</Button> <Button onAction="#onTodayClick" GridPane.columnIndex="2" maxHeight="1.7976931348623157E308">heute</Button>
<Button onAction="#onNextClick" GridPane.columnIndex="3" maxHeight="1.7976931348623157E308">weiter</Button> <Button onAction="#onNextClick" GridPane.columnIndex="3" maxHeight="1.7976931348623157E308">weiter</Button>
<GridPane fx:id="calendarGrid" gridLinesVisible="true" styleClass="gridCalendar" GridPane.columnSpan="4" GridPane.columnIndex="0" GridPane.rowIndex="1"> <GridPane fx:id="calendarGrid" gridLinesVisible="true" styleClass="gridCalendar" GridPane.columnSpan="4"
GridPane.columnIndex="0" GridPane.rowIndex="1">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="ALWAYS" maxWidth="14.2857142857" minWidth="14.2857142857" percentWidth="14.2857142857" /> <ColumnConstraints hgrow="ALWAYS" maxWidth="14.2857142857" minWidth="14.2857142857"
percentWidth="14.2857142857"/>
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/> <ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/> <ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/> <ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>

View File

@ -73,7 +73,8 @@ public class Event {
Pattern pattern = Pattern.compile("[A-Za-zÄÖÜäöü0-9 =!?+*/$%€.:,;_<>()-]*"); Pattern pattern = Pattern.compile("[A-Za-zÄÖÜäöü0-9 =!?+*/$%€.:,;_<>()-]*");
Matcher matcher = pattern.matcher(name); Matcher matcher = pattern.matcher(name);
if (!matcher.matches()) { if (!matcher.matches()) {
throw new IllegalArgumentException("Der Name Darf nur aus Zahlen, Buchstaben und folgenden Sonderzeichen bestehen: =!?+*/$%€.:,;_ <>()-"); throw new IllegalArgumentException("Der Name Darf nur aus Zahlen, Buchstaben und " +
"folgenden Sonderzeichen bestehen: =!?+*/$%€.:,;_ <>()-");
} }
if (priority < 0) { if (priority < 0) {
throw new IllegalArgumentException("Bitte eine Priorit\u00e4t w\u00e4hlen."); throw new IllegalArgumentException("Bitte eine Priorit\u00e4t w\u00e4hlen.");