From 1a4d45aed479c8d69ae996dbcf4840f90aa8f3fe Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Tue, 31 Jan 2023 04:30:09 +0100
Subject: [PATCH 1/6] add: parent menu
---
.../ParentMenuController.java | 78 ++++++++++++++++++
.../bib/essensbestellungsverwaltung/menue.css | 30 ++-----
.../parentMenu.fxml | 81 +++++++++++++++++++
3 files changed, 166 insertions(+), 23 deletions(-)
create mode 100644 src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
create mode 100644 src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
new file mode 100644
index 0000000..f42f378
--- /dev/null
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
@@ -0,0 +1,78 @@
+package com.bib.essensbestellungsverwaltung;
+
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.control.Button;
+import javafx.scene.input.ContextMenuEvent;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.Background;
+import javafx.scene.layout.BorderPane;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+public class ParentMenuController {
+
+ @FXML
+ BorderPane contentView;
+ @FXML
+ Button essensplanButton;
+ @FXML
+ Button kinderButton;
+ @FXML
+ Button bestellungButton;
+ @FXML
+ Button einstellungenButton;
+
+ @FXML
+ public void initialize() {
+ changePage("menue-view.fxml");
+ setButtonActive(essensplanButton);
+ }
+
+
+ @FXML
+ public void onEssensplanClick(MouseEvent mouseEvent) {
+ setButtonActive(essensplanButton);
+ changePage("menue-view.fxml");
+ }
+
+ @FXML
+ public void onKinderClick(MouseEvent mouseEvent) {
+ setButtonActive(kinderButton);
+ changePage("child-view.fxml");
+ }
+
+ @FXML
+ public void onBestellungClick(MouseEvent mouseEvent) {
+ setButtonActive(bestellungButton);
+ changePage("dailyOrder-view.fxml");
+ }
+
+ @FXML
+ public void onEinstellungenClick(MouseEvent mouseEvent) {
+ setButtonActive(einstellungenButton);
+ changePage("menue-view.fxml");
+ }
+
+ @FXML
+ public void onAusloggenClick(MouseEvent mouseEvent) {
+ }
+
+ private void changePage(String page) {
+ try {
+ Parent root = FXMLLoader.load(getClass().getResource(page));
+ contentView.setCenter(root);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ private void setButtonActive(Button b){
+ einstellungenButton.getStyleClass().remove("active");
+ kinderButton.getStyleClass().remove("active");
+ bestellungButton.getStyleClass().remove("active");
+ essensplanButton.getStyleClass().remove("active");
+ b.getStyleClass().add("active");
+ }
+}
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css b/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
index 1ed99ac..8ea9a07 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
@@ -1,25 +1,9 @@
-#btFoodChoice{
- -fx-background-color: transparent;
-
+.sidebar-nav_button {
+ -fx-background-color: #69b6ff;
+ -fx-text-fill: #123;
+ -fx-border-color: #000;
+ -fx-border-radius: 20;
}
-
-#btFoodChoice:hover{
- -fx-underline: true;
- -fx-text-fill: black;
-}
-#btPlaceOrder{
- -fx-background-color: lightblue;
- -fx-text-fill: white;
- -fx-background-radius: 25;
-}
-
-
-#btPlaceOrder:hover{
- -fx-border-width: 0;
- -fx-text-fill: black;
- -fx-underline: true;
-}
-
-#cbChooseChild{
- -fx-background-color: lightgray;
+.sidebar-nav_button.active {
+ -fx-background-color: #4e92b4;
}
\ No newline at end of file
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
new file mode 100644
index 0000000..40a5e8b
--- /dev/null
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
2.39.5
From 2b5839f0eaf638b5329d85f8a42a525260c7c249 Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Tue, 31 Jan 2023 04:30:25 +0100
Subject: [PATCH 2/6] add: workerMenu
---
.../WorkerMenuController.java | 93 +++++++++++++++
.../workerMenu.fxml | 111 ++++++++++++++++++
2 files changed, 204 insertions(+)
create mode 100644 src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
create mode 100644 src/main/resources/com/bib/essensbestellungsverwaltung/workerMenu.fxml
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
new file mode 100644
index 0000000..5d5ddcd
--- /dev/null
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
@@ -0,0 +1,93 @@
+package com.bib.essensbestellungsverwaltung;
+
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.control.Button;
+import javafx.scene.input.ContextMenuEvent;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.BorderPane;
+
+import java.io.IOException;
+
+public class WorkerMenuController {
+ @FXML
+ public BorderPane contentView;
+
+ @FXML
+ Button tagesbestellungButton;
+ @FXML
+ Button wochenplanButton;
+ @FXML
+ Button monatsabrechnungButton;
+ @FXML
+ Button mitarbeiterButton;
+ @FXML
+ Button mahlzeitButton;
+ @FXML
+ Button einstellungenButton;
+
+ @FXML
+ public void initialize() {
+ changePage("menue-view.fxml");
+ setButtonActive(tagesbestellungButton);
+ }
+
+ @FXML
+ public void onTagesbestellungenClick(MouseEvent mouseEvent) {
+ changePage("menue-view.fxml");
+ setButtonActive(tagesbestellungButton);
+ }
+
+ @FXML
+ public void onWochenplanClick(MouseEvent mouseEvent) {
+ setButtonActive(wochenplanButton);
+ }
+
+ @FXML
+ public void onMonatsabrechnungClick(MouseEvent mouseEvent) {
+ changePage("invoice-view.fxml");
+ setButtonActive(monatsabrechnungButton);
+ }
+
+
+ @FXML
+ public void onMitarbeiterClick(MouseEvent mouseEvent) {
+ changePage("createCoworker-view.fxml");
+ setButtonActive(mitarbeiterButton);
+ }
+
+
+ @FXML
+ public void onMahlzeitClick(MouseEvent mouseEvent) {
+ setButtonActive(mahlzeitButton);
+ }
+
+
+ public void onEinstellungenClick(MouseEvent mouseEvent) {
+ setButtonActive(einstellungenButton);
+ }
+
+ @FXML
+ public void onAusloggenClick(MouseEvent mouseEvent) {
+ }
+
+ private void changePage(String page) {
+ try {
+ Parent root = FXMLLoader.load(getClass().getResource(page));
+ contentView.setCenter(root);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void setButtonActive(Button b) {
+ tagesbestellungButton.getStyleClass().remove("active");
+ monatsabrechnungButton.getStyleClass().remove("active");
+ wochenplanButton.getStyleClass().remove("active");
+ mahlzeitButton.getStyleClass().remove("active");
+ mitarbeiterButton.getStyleClass().remove("active");
+ einstellungenButton.getStyleClass().remove("active");
+ b.getStyleClass().add("active");
+ }
+}
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/workerMenu.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/workerMenu.fxml
new file mode 100644
index 0000000..92368ad
--- /dev/null
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/workerMenu.fxml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
2.39.5
From c981fbca197e59367f410b5373631ffa78404444 Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Tue, 31 Jan 2023 06:01:53 +0100
Subject: [PATCH 3/6] add: Rechnung View
---
.../InvoiceController.java | 67 +++++++++++++++++++
.../ParentMenuController.java | 6 +-
.../StartViewApplication.java | 4 +-
.../WorkerMenuController.java | 6 +-
.../invoice-view.fxml | 66 +++++++++++++++---
5 files changed, 137 insertions(+), 12 deletions(-)
create mode 100644 src/main/java/com/bib/essensbestellungsverwaltung/InvoiceController.java
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/InvoiceController.java b/src/main/java/com/bib/essensbestellungsverwaltung/InvoiceController.java
new file mode 100644
index 0000000..aebd7ba
--- /dev/null
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/InvoiceController.java
@@ -0,0 +1,67 @@
+package com.bib.essensbestellungsverwaltung;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.control.Spinner;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.text.Text;
+
+import java.util.Calendar;
+
+public class InvoiceController {
+ @FXML
+ Text responseText;
+ @FXML
+ ChoiceBox monatChoiceBox;
+
+ @FXML
+ Spinner jahrSpinner;
+
+ @FXML
+ public void initialize() {
+ monatChoiceBox.setValue(intToMonth(Calendar.getInstance().get(Calendar.MONTH) + 1));
+ jahrSpinner.getValueFactory().setValue(Calendar.getInstance().get(Calendar.YEAR));
+ }
+
+ @FXML
+ void onRechnungErstellenClick(MouseEvent mouseEvent) {
+ responseText.setText(monatChoiceBox.getValue().toString() + jahrSpinner.getValue());
+ // hier rechnung erstellen
+ }
+
+ private int monthToInt(String month) {
+ return switch (month) {
+ case "Januar" -> 1;
+ case "Februar" -> 2;
+ case "März" -> 3;
+ case "April" -> 4;
+ case "Mai" -> 5;
+ case "Juni" -> 6;
+ case "Juli" -> 7;
+ case "August" -> 8;
+ case "September" -> 9;
+ case "Oktober" -> 10;
+ case "November" -> 11;
+ case "Dezember" -> 12;
+ default -> -1;
+ };
+ }
+
+ private String intToMonth(int month) {
+ return switch (month) {
+ case 1 -> "Januar";
+ case 2 -> "Februar";
+ case 3 -> "März";
+ case 4 -> "April";
+ case 5 -> "Mai";
+ case 6 -> "Juni";
+ case 7 -> "Juli";
+ case 8 -> "August";
+ case 9 -> "September";
+ case 10 -> "Oktober";
+ case 11 -> "November";
+ case 12 -> "Dezember";
+ default -> "";
+ };
+ }
+}
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
index f42f378..a50d7ae 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
@@ -3,11 +3,13 @@ package com.bib.essensbestellungsverwaltung;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
+import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.ContextMenuEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Background;
import javafx.scene.layout.BorderPane;
+import javafx.stage.Stage;
import java.io.IOException;
import java.util.Arrays;
@@ -57,7 +59,9 @@ public class ParentMenuController {
}
@FXML
- public void onAusloggenClick(MouseEvent mouseEvent) {
+ public void onAusloggenClick(MouseEvent mouseEvent) throws IOException {
+ Parent p = FXMLLoader.load(StartViewApplication.class.getResource("workerMenu.fxml"));
+ StartViewApplication.primary.getScene().setRoot(p);
}
private void changePage(String page) {
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java b/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
index fe03394..8e64c57 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
@@ -17,8 +17,8 @@ public class StartViewApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("login-view.fxml"));
- Scene scene = new Scene(fxmlLoader.load(), 950,480);
- //stage = primary;
+ Scene scene = new Scene(fxmlLoader.load(), 1200,900);
+ primary = stage;
stage.setTitle("Essen Bestellung im Kindergarten");
stage.setScene(scene);
stage.show();
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
index 5d5ddcd..d552aea 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
@@ -3,10 +3,12 @@ package com.bib.essensbestellungsverwaltung;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
+import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.ContextMenuEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
+import javafx.stage.Stage;
import java.io.IOException;
@@ -69,7 +71,9 @@ public class WorkerMenuController {
}
@FXML
- public void onAusloggenClick(MouseEvent mouseEvent) {
+ public void onAusloggenClick(MouseEvent mouseEvent) throws IOException {
+ Parent p = FXMLLoader.load(StartViewApplication.class.getResource("parentMenu.fxml"));
+ StartViewApplication.primary.getScene().setRoot(p);
}
private void changePage(String page) {
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
index 1087a44..399a6bd 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
@@ -1,14 +1,64 @@
-
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
2.39.5
From c890819be7caeb497dae49c5f37d7dc171dac18d Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Tue, 31 Jan 2023 07:03:11 +0100
Subject: [PATCH 4/6] fix: changed window size
---
.../StartViewApplication.java | 2 +-
.../invoice-view.fxml | 2 +-
.../menue-view.fxml | 22 ++++++++-----------
.../parentMenu.fxml | 6 ++---
.../workerMenu.fxml | 6 ++---
5 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java b/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
index 8e64c57..1d7a126 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
@@ -17,7 +17,7 @@ public class StartViewApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("login-view.fxml"));
- Scene scene = new Scene(fxmlLoader.load(), 1200,900);
+ Scene scene = new Scene(fxmlLoader.load(), 1200,750);
primary = stage;
stage.setTitle("Essen Bestellung im Kindergarten");
stage.setScene(scene);
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
index 399a6bd..5b2a05c 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
@@ -7,7 +7,7 @@
-
+
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
index 43deb3c..fae1559 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
@@ -1,17 +1,13 @@
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
+
@@ -315,9 +311,9 @@
-
-
-
+
+
+
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
index 40a5e8b..96aff03 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
@@ -6,9 +6,9 @@
-
+
-
+
-
+