diff options
Diffstat (limited to 'src')
10 files changed, 94 insertions, 20 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/ArchiveOperationController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/ArchiveOperationController.java index 80d9fc4..98616bd 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/ArchiveOperationController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/ArchiveOperationController.java @@ -24,6 +24,8 @@ import org.springframework.stereotype.Controller; @Controller public class ArchiveOperationController { + + public AnchorPane archiveOperationAP; @FXML private AnchorPane apDetails; @FXML private Label lblCodeHeader; @FXML private Hyperlink hypBack; @@ -34,10 +36,13 @@ public class ArchiveOperationController { @FXML private FlowPane fpVehicles; private final OperationService operationService; @FXML private FlowPane archiveOperationFlowPane; + private final CreateOperationController createOperationController; private LinkedList<Operation> list = new LinkedList<>(); - public ArchiveOperationController(OperationService operationService) { + public ArchiveOperationController(OperationService operationService, + CreateOperationController createOperationController) { this.operationService = operationService; + this.createOperationController = createOperationController; } @FXML @@ -124,4 +129,8 @@ public class ArchiveOperationController { fpVehicles.getChildren().clear(); setDetailsVisible(false); } + + public void setVisible(boolean b){ + archiveOperationAP.setVisible(b); + } } diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateCarController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateCarController.java index ce795da..0d5d13f 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateCarController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateCarController.java @@ -23,6 +23,7 @@ import javafx.scene.control.Button; import javafx.scene.control.ButtonType; import javafx.scene.control.CheckBox; import javafx.scene.control.ChoiceBox; +import javafx.scene.layout.AnchorPane; import javafx.scene.layout.FlowPane; import javafx.stage.Stage; import org.slf4j.Logger; @@ -32,19 +33,24 @@ import org.springframework.stereotype.Controller; @Controller public class CreateCarController { + @FXML private AnchorPane createCarAP; @FXML private ChoiceBox<String> cmb_Ctyp; @FXML private ChoiceBox<String> cmb_typ; @FXML private Button btn_cancel; @FXML private Button btn_create; @FXML private CheckBox cbx_NEF; @FXML private FlowPane fp_vehicleList; + private final CreateOperationController createOperationController; private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final VehicleService vehicleService; private boolean update = false; private long vid = -1; - public CreateCarController(VehicleService vehicleService) { + public CreateCarController( + CreateOperationController createOperationController, + VehicleService vehicleService) { + this.createOperationController = createOperationController; this.vehicleService = vehicleService; } @@ -203,4 +209,13 @@ public class CreateCarController { public void cancelAction(ActionEvent actionEvent) { setToStart(); } + + public void setVisible(boolean b){ + createCarAP.setVisible(b); + } + + public void cancel(){ + this.setVisible(false); + createOperationController.setVisible(false); + } } diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateOperationController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateOperationController.java index 57759e3..e3b64c6 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateOperationController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/CreateOperationController.java @@ -58,6 +58,10 @@ public class CreateOperationController { @FXML private Label lblChosenVehicles; @FXML private AnchorPane apInvisible; @FXML private OperationDetailsController operationDetailsController; + @FXML private ListEmployeesController listEmployeesController; + @FXML private CreateCarController createCarController; + @FXML private RegistrationWindowController registrationWindowController; + @FXML private ArchiveOperationController archiveOperationController; @FXML private FlowPane fpVehicles; private LinkedList<Vehicle> chosenVehicles = new LinkedList<>(); @@ -291,23 +295,23 @@ public class CreateOperationController { } public void onRegistrationLinkClicked(ActionEvent actionEvent) { - openNewWindow("RegistrationWindow.fxml"); + openRegistrationWindow(); } public void onEmployeeLinkClicked(ActionEvent actionEvent) { - openNewWindow("listEmployees.fxml"); + openCreateNewEmployeeWindow(); } public void onVehicleLinkClicked(ActionEvent actionEvent) { - openNewWindow("createCar.fxml"); + openCreateCarWindow(); } public void onArchivLinkClicked() { - openNewArchivWindow(); + openArchivWindow(); } - private void openNewArchivWindow() { - Stage stage = new Stage(); + private void openArchivWindow() { + /*Stage stage = new Stage(); try { stage.setScene( new Scene( @@ -322,7 +326,9 @@ public class CreateOperationController { stage.setTitle("Einsatz erstellen"); stage.centerOnScreen(); stage.show(); - updateList(); + */ + archiveOperationController.setVisible(true); + this.setVisible(false); } private void openNewWindow(String fxmlFileName) { @@ -349,6 +355,7 @@ public class CreateOperationController { void setVisible(boolean b) { apInvisible.setVisible(!b); + updateList(); } private void openDetailsWindow(Operation operation) { @@ -356,6 +363,21 @@ public class CreateOperationController { this.setVisible(false); } + private void openCreateNewEmployeeWindow(){ + this.setVisible(false); + listEmployeesController.setVisible(true); + } + + private void openCreateCarWindow(){ + this.setVisible(false); + createCarController.setVisible(true); + } + + private void openRegistrationWindow(){ + this.setVisible(false); + registrationWindowController.setVisible(true); + } + @FXML public void onOperationCodeChanged(KeyEvent keyEvent) { if (keyEvent.getCode() == KeyCode.ENTER) { diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/ListEmployeesController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/ListEmployeesController.java index 25f1263..2e46003 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/ListEmployeesController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/ListEmployeesController.java @@ -19,6 +19,7 @@ import org.springframework.stereotype.Controller; public class ListEmployeesController { private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + @FXML private AnchorPane listEmployeesAP; @FXML private AnchorPane containerHeader; @FXML private FlowPane flowPaneEmployeeList; @@ -26,9 +27,13 @@ public class ListEmployeesController { private final EmployeeService employeeService; private final SpringFXMLLoader fxmlLoader; - public ListEmployeesController(EmployeeService employeeService, SpringFXMLLoader fxmlLoader) { + private final CreateOperationController createOperationController; + + public ListEmployeesController(EmployeeService employeeService, SpringFXMLLoader fxmlLoader, + CreateOperationController createOperationController) { this.employeeService = employeeService; this.fxmlLoader = fxmlLoader; + this.createOperationController = createOperationController; } @FXML @@ -114,4 +119,13 @@ public class ListEmployeesController { LOG.error("Could not create a new EmployeeListItem: {}", e); } } + + public void setVisible(boolean b){ + listEmployeesAP.setVisible(b); + } + + public void close(){ + this.setVisible(false); + createOperationController.setVisible(true); + } } diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java index 4653663..a55b1d5 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/RegistrationWindowController.java @@ -30,6 +30,7 @@ import javafx.scene.control.Label; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.TextField; +import javafx.scene.layout.VBox; import javafx.stage.Stage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,14 +45,19 @@ public class RegistrationWindowController { private final VehicleService vehicleService; + private final CreateOperationController createOperationController; + private final RegistrationService registrationService; + @FXML private VBox registrationWindowVB; public RegistrationWindowController( EmployeeService employeeService, VehicleService vehicleService, + CreateOperationController createOperationController, RegistrationService registrationService) { this.employeeService = employeeService; this.vehicleService = vehicleService; + this.createOperationController = createOperationController; this.registrationService = registrationService; } @@ -142,7 +148,9 @@ public class RegistrationWindowController { public void cancel() { LOG.debug("Cancel Button clicked"); chosenEmployees.clear(); - ((Stage) lVehicles.getScene().getWindow()).close(); + // ((Stage) lVehicles.getScene().getWindow()).close(); + this.setVisible(false); + createOperationController.setVisible(true); } public void create() { @@ -210,4 +218,8 @@ public class RegistrationWindowController { chosenEmployees.clear(); } } + + public void setVisible(boolean b){ + this.registrationWindowVB.setVisible(b); + } } diff --git a/src/main/resources/fxml/ArchiveOperation.fxml b/src/main/resources/fxml/ArchiveOperation.fxml index 88b5b39..7eace12 100644 --- a/src/main/resources/fxml/ArchiveOperation.fxml +++ b/src/main/resources/fxml/ArchiveOperation.fxml @@ -7,15 +7,14 @@ <?import javafx.scene.layout.FlowPane?> <?import javafx.scene.text.Font?> -<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="650.0" prefWidth="1200.0" style="-fx-background-color: BLACK;" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.ArchiveOperationController"> +<AnchorPane fx:id="archiveOperationAP" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="650.0" prefWidth="800.0" style="-fx-background-color: BLACK;" visible="false" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.ArchiveOperationController"> <children> - <AnchorPane prefHeight="650.0" prefWidth="800.0" style="-fx-background-color: rgba(239,235,232,1);" AnchorPane.leftAnchor="200.0" /> - <ScrollPane prefHeight="650.0" prefWidth="800.0" AnchorPane.leftAnchor="200.0"> + <ScrollPane prefHeight="650.0" prefWidth="800.0" AnchorPane.leftAnchor="0.0"> <content> <FlowPane fx:id="archiveOperationFlowPane" prefHeight="650.0" prefWidth="800.0" /> </content> </ScrollPane> - <AnchorPane fx:id="apDetails" layoutX="201.0" prefHeight="650.0" prefWidth="800.0" style="-fx-background-color: rgba(239,235,232,1);" visible="false" AnchorPane.leftAnchor="201.0" AnchorPane.topAnchor="0.0"> + <AnchorPane fx:id="apDetails" layoutX="201.0" prefHeight="650.0" prefWidth="800.0" style="-fx-background-color: rgba(239,235,232,1);" visible="false" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0"> <children> <AnchorPane prefHeight="170.0" prefWidth="800.0" style="-fx-background-color: rgba(191,144,0,1);"> <children> diff --git a/src/main/resources/fxml/CreateOperationController.fxml b/src/main/resources/fxml/CreateOperationController.fxml index 0a09611..ba27f53 100644 --- a/src/main/resources/fxml/CreateOperationController.fxml +++ b/src/main/resources/fxml/CreateOperationController.fxml @@ -66,7 +66,6 @@ styleClass="text-small" textFill="WHITE"> </Hyperlink> - <!--<AnchorPane fx:id="apActiveOperations" layoutX="968.0" layoutY="71.0" prefHeight="315.0" prefWidth="207.0" style="-fx-background-color: white; -fx-effect: dropshadow(gaussian, rgba(0.5,0.5,0.5,0.8), 5, 0, 0, 3);">--> <AnchorPane fx:id="apActiveOperations" layoutX="968.0" layoutY="71.0" prefHeight="315.0" prefWidth="207.0" styleClass="bg-white, shadowed"> @@ -85,4 +84,8 @@ style="-fx-background-color: rgba(0,0,0,0.7);" visible="false"/> <fx:include fx:id="operationDetails" source="/fxml/OperationDetails.fxml" AnchorPane.leftAnchor="54.0" AnchorPane.topAnchor="50.0"/> + <fx:include AnchorPane.leftAnchor="192.0" AnchorPane.topAnchor="57.0" fx:id="listEmployees" source="/fxml/listEmployees.fxml"/> + <fx:include AnchorPane.leftAnchor="300" AnchorPane.topAnchor="135.4" source="/fxml/RegistrationWindow.fxml" fx:id="registrationWindow"/> + <fx:include AnchorPane.leftAnchor="300.0" AnchorPane.topAnchor="125.0" source="/fxml/createCar.fxml" fx:id="createCar"/> + <fx:include AnchorPane.leftAnchor="200.0" source="/fxml/ArchiveOperation.fxml" fx:id="archiveOperation"/> </AnchorPane> diff --git a/src/main/resources/fxml/RegistrationWindow.fxml b/src/main/resources/fxml/RegistrationWindow.fxml index 0394ca7..a138d02 100644 --- a/src/main/resources/fxml/RegistrationWindow.fxml +++ b/src/main/resources/fxml/RegistrationWindow.fxml @@ -12,7 +12,7 @@ <?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.VBox?> -<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="600.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.RegistrationWindowController"> +<VBox fx:id="registrationWindowVB" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="600.0" style="-fx-background-color: WHITE;" visible="false" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.RegistrationWindowController"> <children> <AnchorPane prefHeight="135.0" prefWidth="600.0"> <children> diff --git a/src/main/resources/fxml/createCar.fxml b/src/main/resources/fxml/createCar.fxml index cefac82..99cd7b0 100644 --- a/src/main/resources/fxml/createCar.fxml +++ b/src/main/resources/fxml/createCar.fxml @@ -6,11 +6,11 @@ <?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.FlowPane?> -<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.CreateCarController"> +<AnchorPane fx:id="createCarAP" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: WHITE;" visible="false" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.CreateCarController"> <children> <ChoiceBox fx:id="cmb_Ctyp" layoutX="14.0" layoutY="14.0" prefWidth="150.0" /> <ChoiceBox fx:id="cmb_typ" layoutX="191.0" layoutY="14.0" prefWidth="150.0" /> - <Button fx:id="btn_cancel" layoutX="500.0" layoutY="14.0" mnemonicParsing="false" text="abbrechen" onAction="#cancelAction"/> + <Button fx:id="btn_cancel" layoutX="500.0" layoutY="14.0" mnemonicParsing="false" onAction="#cancelAction" text="abbrechen" /> <Button fx:id="btn_create" layoutX="500.0" layoutY="53.0" mnemonicParsing="false" onAction="#createCar" text="Erstellen" /> <CheckBox fx:id="cbx_NEF" layoutX="14.0" layoutY="57.0" mnemonicParsing="false" text="NEF - Halterung" /> <FlowPane fx:id="fp_vehicleList" layoutX="14.0" layoutY="94.0" prefHeight="298.0" prefWidth="571.0" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" /> diff --git a/src/main/resources/fxml/listEmployees.fxml b/src/main/resources/fxml/listEmployees.fxml index ae815e1..6c4593b 100644 --- a/src/main/resources/fxml/listEmployees.fxml +++ b/src/main/resources/fxml/listEmployees.fxml @@ -8,7 +8,7 @@ <?import javafx.scene.layout.VBox?> <?import javafx.scene.text.Font?> -<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" +<AnchorPane fx:id="listEmployeesAP" visible="false" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="536.0" prefWidth="816.0" style="-fx-background-color: #EFEBE8;" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.ListEmployeesController"> |