From be76439c6e0a53a0b70e63daf99de8317dd8e9e4 Mon Sep 17 00:00:00 2001
From: Viktoria Pundy <viktoria.pundy@aon.at>
Date: Thu, 17 May 2018 16:57:03 +0200
Subject: Renamed ArchivOperation to ArchiveOperation [#24990]

---
 .../userInterface/ArchivOperationController.java   | 135 ---------------------
 .../userInterface/ArchiveOperationController.java  | 134 ++++++++++++++++++++
 .../userInterface/CreateOperationController.java   |   8 +-
 src/main/resources/fxml/ArchivOperation.fxml       |  61 ----------
 src/main/resources/fxml/ArchiveOperation.fxml      |  61 ++++++++++
 5 files changed, 199 insertions(+), 200 deletions(-)
 delete mode 100644 src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchivOperationController.java
 create mode 100644 src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchiveOperationController.java
 delete mode 100644 src/main/resources/fxml/ArchivOperation.fxml
 create mode 100644 src/main/resources/fxml/ArchiveOperation.fxml

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
deleted file mode 100644
index c22b398..0000000
--- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchivOperationController.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.userInterface;
-
-import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Operation;
-import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Operation.Status;
-import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Vehicle;
-import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.service.OperationService;
-import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import java.util.EnumSet;
-import java.util.LinkedList;
-import java.util.List;
-import javafx.scene.control.Alert;
-import javafx.scene.control.Alert.AlertType;
-import javafx.scene.control.Button;
-import javafx.scene.control.Hyperlink;
-import javafx.scene.control.Label;
-import javafx.scene.layout.AnchorPane;
-import javafx.scene.layout.FlowPane;
-import org.springframework.stereotype.Controller;
-
-@Controller
-public class ArchivOperationController {
-
-    public AnchorPane apDetails;
-    public Label lblCodeHeader;
-    public Hyperlink hypBack;
-    public Label lblOpCode;
-    public Label lblVehicles;
-    public Label lblDate;
-    public Label lblAddress;
-    public FlowPane fpVehicles;
-    OperationService operationService;
-    public FlowPane archiveOperationFlowPane;
-    public CreateOperationController createOperationController;
-    LinkedList<Operation> list = new LinkedList<>();
-
-    public ArchivOperationController() {}
-
-    public void setServices(
-            OperationService operationService,
-            CreateOperationController createOperationController) {
-        this.operationService = operationService;
-        this.createOperationController = createOperationController;
-    }
-
-    public void fillList() {
-        try {
-            list.addAll(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();
-        }
-        for (int i = 0; i < list.size(); i++) {
-            Button b = new Button();
-            b.setPrefHeight(200);
-            b.setPrefWidth(800 / 2);
-            b.setText(list.get(i).opCode());
-            b.setOnAction(event -> buttonClicked(b));
-            archiveOperationFlowPane.getChildren().add(b);
-        }
-    }
-
-    Operation detailOperation;
-
-    public void buttonClicked(Button button) {
-        int size = archiveOperationFlowPane.getChildren().size();
-        int index = 0;
-        for (int i = 0; i < size; i++) {
-            if (archiveOperationFlowPane.getChildren().get(i) == button) {
-                index = i;
-                break;
-            }
-        }
-        detailOperation = list.get(index);
-
-        setOperation();
-        setDetailsVisible(true);
-    }
-
-    private void setOperation() {
-        // TODO
-        lblCodeHeader.setText(detailOperation.opCode());
-        String date = "am ";
-        if (detailOperation.created() != null) {
-            LocalDateTime myDateTime =
-                    LocalDateTime.ofInstant(detailOperation.created(), ZoneOffset.UTC);
-            date +=
-                    myDateTime.getDayOfMonth()
-                            + "."
-                            + myDateTime.getMonth().getValue()
-                            + "."
-                            + myDateTime.getYear();
-            lblDate.setText(date);
-        } else {
-            lblDate.setText("---");
-        }
-
-        lblOpCode.setText(detailOperation.opCode());
-        StringBuilder result = new StringBuilder();
-        for (int i = 0; i < detailOperation.vehicles().size(); i++) {
-            if (i == detailOperation.vehicles().size() - 1) {
-                result.append(detailOperation.vehicles().get(i).name());
-            } else {
-                result.append(detailOperation.vehicles().get(i).name()).append(", ");
-            }
-        }
-        lblVehicles.setText(result.toString());
-        lblAddress.setText(detailOperation.destination());
-
-        List<Vehicle> vehicles = detailOperation.vehicles();
-        for (int i = 0; i < vehicles.size(); i++) {
-            Button b = new Button();
-            b.setPrefHeight(200);
-            b.setPrefWidth(640 / 2);
-            b.setText(vehicles.get(i).name());
-            fpVehicles.getChildren().add(b);
-        }
-    }
-
-    public void setListVisible(boolean b) {
-        archiveOperationFlowPane.setVisible(b);
-    }
-
-    public void setDetailsVisible(boolean b) {
-        apDetails.setVisible(b);
-    }
-
-    public void backClicked() {
-        setDetailsVisible(false);
-    }
-}
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchiveOperationController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchiveOperationController.java
new file mode 100644
index 0000000..d3698e3
--- /dev/null
+++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/userInterface/ArchiveOperationController.java
@@ -0,0 +1,134 @@
+package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.userInterface;
+
+import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Operation;
+import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Operation.Status;
+import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Vehicle;
+import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.service.OperationService;
+import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
+import java.util.EnumSet;
+import java.util.LinkedList;
+import java.util.List;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
+import javafx.scene.control.Button;
+import javafx.scene.control.Hyperlink;
+import javafx.scene.control.Label;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.FlowPane;
+import org.springframework.stereotype.Controller;
+
+@Controller
+public class ArchiveOperationController {
+
+    public AnchorPane apDetails;
+    public Label lblCodeHeader;
+    public Hyperlink hypBack;
+    public Label lblOpCode;
+    public Label lblVehicles;
+    public Label lblDate;
+    public Label lblAddress;
+    public FlowPane fpVehicles;
+    OperationService operationService;
+    public FlowPane archiveOperationFlowPane;
+    public CreateOperationController createOperationController;
+    LinkedList<Operation> list = new LinkedList<>();
+
+    public ArchiveOperationController() {}
+
+    public void setServices(
+            OperationService operationService,
+            CreateOperationController createOperationController) {
+        this.operationService = operationService;
+        this.createOperationController = createOperationController;
+    }
+
+    public void fillList() {
+        try {
+            list.addAll(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();
+        }
+        for (int i = 0; i < list.size(); i++) {
+            Button b = new Button();
+            b.setPrefHeight(200);
+            b.setPrefWidth(800 / 2);
+            b.setText(list.get(i).opCode());
+            b.setOnAction(event -> buttonClicked(b));
+            archiveOperationFlowPane.getChildren().add(b);
+        }
+    }
+
+    Operation detailOperation;
+
+    public void buttonClicked(Button button) {
+        int size = archiveOperationFlowPane.getChildren().size();
+        int index = 0;
+        for (int i = 0; i < size; i++) {
+            if (archiveOperationFlowPane.getChildren().get(i) == button) {
+                index = i;
+                break;
+            }
+        }
+        detailOperation = list.get(index);
+
+        setOperation();
+        setDetailsVisible(true);
+    }
+
+    private void setOperation() {
+        lblCodeHeader.setText(detailOperation.opCode());
+        String date = "am ";
+        if (detailOperation.created() != null) {
+            LocalDateTime myDateTime =
+                    LocalDateTime.ofInstant(detailOperation.created(), ZoneOffset.UTC);
+            date +=
+                    myDateTime.getDayOfMonth()
+                            + "."
+                            + myDateTime.getMonth().getValue()
+                            + "."
+                            + myDateTime.getYear();
+            lblDate.setText(date);
+        } else {
+            lblDate.setText("---");
+        }
+
+        lblOpCode.setText(detailOperation.opCode());
+        StringBuilder result = new StringBuilder();
+        for (int i = 0; i < detailOperation.vehicles().size(); i++) {
+            if (i == detailOperation.vehicles().size() - 1) {
+                result.append(detailOperation.vehicles().get(i).name());
+            } else {
+                result.append(detailOperation.vehicles().get(i).name()).append(", ");
+            }
+        }
+        lblVehicles.setText(result.toString());
+        lblAddress.setText(detailOperation.destination());
+
+        List<Vehicle> vehicles = detailOperation.vehicles();
+        for (int i = 0; i < vehicles.size(); i++) {
+            Button b = new Button();
+            b.setPrefHeight(200);
+            b.setPrefWidth(640 / 2);
+            b.setText(vehicles.get(i).name());
+            fpVehicles.getChildren().add(b);
+        }
+    }
+
+    public void setListVisible(boolean b) {
+        archiveOperationFlowPane.setVisible(b);
+    }
+
+    public void setDetailsVisible(boolean b) {
+        apDetails.setVisible(b);
+    }
+
+    public void backClicked() {
+        setDetailsVisible(false);
+    }
+}
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 5bf2c81..a25085a 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
@@ -245,7 +245,7 @@ public class CreateOperationController {
     }
 
     public void onArchivLinkClicked() {
-        openNewArchivWindow("ArchivOperation.fxml");
+        openNewArchivWindow("ArchiveOperation.fxml");
     }
 
     private void openNewArchivWindow(String fxmlFileName) {
@@ -254,9 +254,9 @@ public class CreateOperationController {
         try {
             FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/" + fxmlFileName));
             Parent node = fxmlLoader.load();
-            ArchivOperationController archivOperationController = fxmlLoader.getController();
-            archivOperationController.setServices(operationService, this);
-            archivOperationController.fillList();
+            ArchiveOperationController archiveOperationController = fxmlLoader.getController();
+            archiveOperationController.setServices(operationService, this);
+            archiveOperationController.fillList();
             stage.setScene(new Scene(node));
         } catch (IOException e) {
             LOG.error("Could not open new window: {}", e);
diff --git a/src/main/resources/fxml/ArchivOperation.fxml b/src/main/resources/fxml/ArchivOperation.fxml
deleted file mode 100644
index 29313af..0000000
--- a/src/main/resources/fxml/ArchivOperation.fxml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?import javafx.scene.control.Hyperlink?>
-<?import javafx.scene.control.Label?>
-<?import javafx.scene.layout.AnchorPane?>
-<?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.userInterface.ArchivOperationController">
-  <children>
-    <AnchorPane prefHeight="650.0" prefWidth="800.0" style="-fx-background-color: rgba(239,235,232,1);" AnchorPane.leftAnchor="200.0" />
-    <FlowPane fx:id="archiveOperationFlowPane" prefHeight="650.0" prefWidth="800.0" AnchorPane.leftAnchor="200.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="201.0" AnchorPane.topAnchor="0.0">
-         <children>
-            <AnchorPane prefHeight="170.0" prefWidth="800.0" style="-fx-background-color: rgba(191,144,0,1);">
-               <children>
-                  <Label layoutX="81.0" layoutY="20.0" prefHeight="34.0" prefWidth="116.0" text="Archiv-Eintrag:" textFill="WHITE">
-                     <font>
-                        <Font name="System Bold" size="16.0" />
-                     </font>
-                  </Label>
-                  <Label fx:id="lblCodeHeader" layoutX="203.0" layoutY="20.0" prefHeight="34.0" prefWidth="116.0" textFill="WHITE">
-                     <font>
-                        <Font name="System Bold" size="16.0" />
-                     </font>
-                  </Label>
-                  <Hyperlink fx:id="hypBack" layoutX="656.0" layoutY="20.0" onAction="#backClicked" text="Zurück" textFill="WHITE">
-                     <font>
-                        <Font name="System Bold" size="16.0" />
-                     </font>
-                  </Hyperlink>
-               </children></AnchorPane>
-            <AnchorPane layoutX="82.0" layoutY="60.0" prefHeight="150.0" prefWidth="636.0" style="-fx-background-color: white; -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 5, 0, 0, 5);">
-               <children>
-                  <Label fx:id="lblOpCode" layoutX="25.0" layoutY="22.0" prefHeight="26.0" prefWidth="116.0" text="Label">
-                     <font>
-                        <Font name="System Bold" size="18.0" />
-                     </font>
-                  </Label>
-                  <Label fx:id="lblAddress" layoutX="26.0" layoutY="53.0" prefHeight="22.0" prefWidth="540.0" style="-fx-effect: dropshadow;" text="Label">
-                     <font>
-                        <Font size="15.0" />
-                     </font>
-                  </Label>
-                  <Label fx:id="lblVehicles" layoutX="58.0" layoutY="91.0" prefHeight="46.0" prefWidth="554.0" style="-fx-effect: drop;" text="Label">
-                     <font>
-                        <Font size="15.0" />
-                     </font>
-                  </Label>
-                  <Label fx:id="lblDate" alignment="CENTER_RIGHT" layoutX="482.0" layoutY="22.0" prefHeight="27.0" prefWidth="140.0" text="Label">
-                     <font>
-                        <Font name="System Bold" size="18.0" />
-                     </font>
-                  </Label>
-               </children>
-            </AnchorPane>
-            <FlowPane fx:id="fpVehicles" layoutX="82.0" layoutY="225.0" prefHeight="410.0" prefWidth="640.0" />
-         </children>
-      </AnchorPane>
-  </children>
-</AnchorPane>
diff --git a/src/main/resources/fxml/ArchiveOperation.fxml b/src/main/resources/fxml/ArchiveOperation.fxml
new file mode 100644
index 0000000..d9348c1
--- /dev/null
+++ b/src/main/resources/fxml/ArchiveOperation.fxml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.control.Hyperlink?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.layout.AnchorPane?>
+<?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.userInterface.ArchiveOperationController">
+  <children>
+    <AnchorPane prefHeight="650.0" prefWidth="800.0" style="-fx-background-color: rgba(239,235,232,1);" AnchorPane.leftAnchor="200.0" />
+    <FlowPane fx:id="archiveOperationFlowPane" prefHeight="650.0" prefWidth="800.0" AnchorPane.leftAnchor="200.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="201.0" AnchorPane.topAnchor="0.0">
+         <children>
+            <AnchorPane prefHeight="170.0" prefWidth="800.0" style="-fx-background-color: rgba(191,144,0,1);">
+               <children>
+                  <Label layoutX="81.0" layoutY="20.0" prefHeight="34.0" prefWidth="116.0" text="Archiv-Eintrag:" textFill="WHITE">
+                     <font>
+                        <Font name="System Bold" size="16.0" />
+                     </font>
+                  </Label>
+                  <Label fx:id="lblCodeHeader" layoutX="203.0" layoutY="20.0" prefHeight="34.0" prefWidth="116.0" textFill="WHITE">
+                     <font>
+                        <Font name="System Bold" size="16.0" />
+                     </font>
+                  </Label>
+                  <Hyperlink fx:id="hypBack" layoutX="656.0" layoutY="20.0" onAction="#backClicked" text="Zurück" textFill="WHITE">
+                     <font>
+                        <Font name="System Bold" size="16.0" />
+                     </font>
+                  </Hyperlink>
+               </children></AnchorPane>
+            <AnchorPane layoutX="82.0" layoutY="60.0" prefHeight="150.0" prefWidth="636.0" style="-fx-background-color: white; -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 5, 0, 0, 5);">
+               <children>
+                  <Label fx:id="lblOpCode" layoutX="25.0" layoutY="22.0" prefHeight="26.0" prefWidth="116.0" text="Label">
+                     <font>
+                        <Font name="System Bold" size="18.0" />
+                     </font>
+                  </Label>
+                  <Label fx:id="lblAddress" layoutX="26.0" layoutY="53.0" prefHeight="22.0" prefWidth="540.0" style="-fx-effect: dropshadow;" text="Label">
+                     <font>
+                        <Font size="15.0" />
+                     </font>
+                  </Label>
+                  <Label fx:id="lblVehicles" layoutX="58.0" layoutY="91.0" prefHeight="46.0" prefWidth="554.0" style="-fx-effect: drop;" text="Label">
+                     <font>
+                        <Font size="15.0" />
+                     </font>
+                  </Label>
+                  <Label fx:id="lblDate" alignment="CENTER_RIGHT" layoutX="482.0" layoutY="22.0" prefHeight="27.0" prefWidth="140.0" text="Label">
+                     <font>
+                        <Font name="System Bold" size="18.0" />
+                     </font>
+                  </Label>
+               </children>
+            </AnchorPane>
+            <FlowPane fx:id="fpVehicles" layoutX="82.0" layoutY="225.0" prefHeight="410.0" prefWidth="640.0" />
+         </children>
+      </AnchorPane>
+  </children>
+</AnchorPane>
-- 
cgit v1.2.3-70-g09d2