From c08b0aece5143754a0bda6d88d140179cf4c20cb Mon Sep 17 00:00:00 2001 From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com> Date: Tue, 31 Jan 2023 07:18:37 +0100 Subject: [PATCH] fix: refactor --- .../ParentMenuController.java | 10 +-- .../WorkerMenuController.java | 5 +- .../hello-view.fxml | 30 ------- .../{parentMenu.fxml => parentMenu-view.fxml} | 73 +++++++++------- .../parentMenue.css | 26 ------ .../{workerMenu.fxml => workerMenu-view.fxml} | 86 +++++++++++-------- 6 files changed, 99 insertions(+), 131 deletions(-) delete mode 100644 src/main/resources/com/bib/essensbestellungsverwaltung/hello-view.fxml rename src/main/resources/com/bib/essensbestellungsverwaltung/{parentMenu.fxml => parentMenu-view.fxml} (52%) delete mode 100644 src/main/resources/com/bib/essensbestellungsverwaltung/parentMenue.css rename src/main/resources/com/bib/essensbestellungsverwaltung/{workerMenu.fxml => workerMenu-view.fxml} (56%) diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java index a50d7ae..87c5f37 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java @@ -3,16 +3,11 @@ 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; public class ParentMenuController { @@ -60,7 +55,7 @@ public class ParentMenuController { @FXML public void onAusloggenClick(MouseEvent mouseEvent) throws IOException { - Parent p = FXMLLoader.load(StartViewApplication.class.getResource("workerMenu.fxml")); + Parent p = FXMLLoader.load(StartViewApplication.class.getResource("workerMenu-view.fxml")); StartViewApplication.primary.getScene().setRoot(p); } @@ -72,7 +67,8 @@ public class ParentMenuController { throw new RuntimeException(e); } } - private void setButtonActive(Button b){ + + private void setButtonActive(Button b) { einstellungenButton.getStyleClass().remove("active"); kinderButton.getStyleClass().remove("active"); bestellungButton.getStyleClass().remove("active"); diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java index d552aea..1bc78ce 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java @@ -3,12 +3,9 @@ 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; @@ -72,7 +69,7 @@ public class WorkerMenuController { @FXML public void onAusloggenClick(MouseEvent mouseEvent) throws IOException { - Parent p = FXMLLoader.load(StartViewApplication.class.getResource("parentMenu.fxml")); + Parent p = FXMLLoader.load(StartViewApplication.class.getResource("parentMenu-view.fxml")); StartViewApplication.primary.getScene().setRoot(p); } diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/hello-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/hello-view.fxml deleted file mode 100644 index 4e58774..0000000 --- a/src/main/resources/com/bib/essensbestellungsverwaltung/hello-view.fxml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - -