diff options
author | Viktoria Pundy <viktoria.pundy@aon.at> | 2018-05-15 20:45:52 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2018-05-22 15:30:25 +0200 |
commit | 3d99fe05ab70666b5509c626e3155d128efdfa8b (patch) | |
tree | 9e299f06cdc3655c9a2fc44b8ad0c7712249724e /src | |
parent | a3d56bb7db4548ab60816d169469315ac64d3c38 (diff) | |
download | sepm-groupproject-3d99fe05ab70666b5509c626e3155d128efdfa8b.tar.gz sepm-groupproject-3d99fe05ab70666b5509c626e3155d128efdfa8b.tar.xz sepm-groupproject-3d99fe05ab70666b5509c626e3155d128efdfa8b.zip |
Started adding elements, implemented first methods for archivOperation [#24990]
Diffstat (limited to 'src')
3 files changed, 72 insertions, 4 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchivOperationController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchivOperationController.java index 68ea5fa..4019c71 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchivOperationController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchivOperationController.java @@ -1,10 +1,15 @@ package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.userInterface; import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dao.DBOperationDAO; +import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Operation.Status; import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.service.OperationService; import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.service.OperationServiceImpl; +import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException; import at.ac.tuwien.sepm.assignment.groupphase.util.JDBCConnectionManager; +import java.util.EnumSet; import javafx.fxml.FXML; +import javafx.scene.control.Alert; +import javafx.scene.control.Alert.AlertType; import javafx.scene.control.Button; import javafx.scene.layout.FlowPane; import org.springframework.stereotype.Controller; @@ -13,24 +18,54 @@ import org.springframework.stereotype.Controller; public class ArchivOperationController { OperationService operationService; public FlowPane archiveOperationFlowPane; + public CreateOperationController createOperationController; public ArchivOperationController(){ } - public void setServices(OperationService operationService){ + public void setServices(OperationService operationService, CreateOperationController createOperationController){ this.operationService = operationService; + this.createOperationController = createOperationController; } @FXML public void initialize(){ - Button b1 = new Button(); + /*Button b1 = new Button(); b1.setPrefHeight(200); b1.setPrefWidth(650/2); - archiveOperationFlowPane.getChildren().add(b1); + archiveOperationFlowPane.getChildren().add(b1);*/ + } + + public void setVisible(boolean b){ + archiveOperationFlowPane.setVisible(b); } + public void fillList() { + //TODO Test + //try { + // FOR EACH MAKE BUTTON + for (int i = 0; i < 2; i++) { + Button b = new Button(); + b.setPrefHeight(200); + b.setPrefWidth(650 / 2); + archiveOperationFlowPane.getChildren().add(b); + } + //operationService.list(EnumSet.of(Status.CANCELLED, Status.COMPLETED)); + /*} catch (ServiceException e) { + Alert alert = new Alert(AlertType.ERROR); + alert.setTitle("Fehler"); + alert.setHeaderText("Fehler!"); + alert.setContentText("Die Einsätze konnten nicht geladen werden!"); + alert.showAndWait(); + }*/ + } + public void closeWindow(){ + //TODO TEST + archiveOperationFlowPane.setVisible(false); + this.createOperationController.setVisible(true); + } } diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/CreateOperationController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/CreateOperationController.java index ed155db..796857b 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/CreateOperationController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/CreateOperationController.java @@ -55,6 +55,7 @@ public class CreateOperationController { public ListView lvActiveOperations; public Label lblChosenVehicles; public FlowPane fpVehicles; + public AnchorPane apInvisible; @FXML ArchivOperationController archivOperationController; private LinkedList<Vehicle> chosenVehicles = new LinkedList<>(); @@ -243,6 +244,29 @@ public class CreateOperationController { openNewWindow("createCar.fxml"); } + @FXML + private void openArchivWindow(){ + archivOperationController.setServices(operationService, this); + apInvisible.setVisible(true); + archivOperationController.setVisible(true); + archivOperationController.fillList(); + } + + /* + private void openDetailsWindow(Operation operation) { + + operationDetailsController.setControllers(this, operationService); + + apInvisible.setVisible(true); + + operationDetailsController.initOperation(operation); + + operationDetailsController.fillActiveList(); + + } + + */ + private void openNewWindow(String fxmlFileName) { Stage stage = new Stage(); @@ -264,4 +288,8 @@ public class CreateOperationController { updateList(); } + + public void setVisible(boolean b) { + apInvisible.setVisible(!b); + } } diff --git a/src/main/resources/fxml/ArchivOperation.fxml b/src/main/resources/fxml/ArchivOperation.fxml index 0efc9d9..6f3d883 100644 --- a/src/main/resources/fxml/ArchivOperation.fxml +++ b/src/main/resources/fxml/ArchivOperation.fxml @@ -1,6 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> +<?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.FlowPane?> -<FlowPane fx:id="archiveOperationFlowPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="650.0" prefWidth="800.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.userInterface.ArchivOperationController"/> +<FlowPane fx:id="archiveOperationFlowPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="650.0" prefWidth="800.0" 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.userInterface.ArchivOperationController"> + <children> + <AnchorPane prefHeight="650.0" prefWidth="800.0" /> + </children> +</FlowPane> |