From 4d28a72048d208cf2dfd3e34b5fb23a194975314 Mon Sep 17 00:00:00 2001
From: Andreas Weninger <e01526989@student.tuwien.ac.at>
Date: Fri, 11 May 2018 16:17:42 +0200
Subject: UI Changes Main Window

---
 .../userInterface/CreateOperationController.java   |   8 +-
 .../resources/fxml/CreateOperationController.fxml  | 165 ++++++++++++---------
 src/main/resources/fxml/vehiclePane.fxml           |   2 +-
 3 files changed, 103 insertions(+), 72 deletions(-)

(limited to 'src/main')

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 446ca50..512087f 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
@@ -1,16 +1,19 @@
 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;
 import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Operation.Severity;
 import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Operation.Status;
 import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Registration;
 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.einsatzverwaltung.service.OperationServiceImpl;
 import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.service.VehicleService;
 import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.ui.vehiclepane.VehiclePaneController;
 import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidOperationException;
 import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidVehicleException;
 import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException;
+import at.ac.tuwien.sepm.assignment.groupphase.util.JDBCConnectionManager;
 import at.ac.tuwien.sepm.assignment.groupphase.util.SpringFXMLLoader;
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
@@ -39,7 +42,6 @@ import javafx.scene.layout.FlowPane;
 import javafx.stage.Stage;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 
 @Controller
@@ -58,7 +60,9 @@ public class CreateOperationController {
 
     private LinkedList<Vehicle> chosenVehicles = new LinkedList<>();
 
-    @Autowired private OperationService operationService;
+    // TODO: Anders?
+    private OperationService operationService =
+            new OperationServiceImpl(new DBOperationDAO(new JDBCConnectionManager()));
     private final VehicleService vehicleService;
     private final SpringFXMLLoader fxmlLoader;
 
diff --git a/src/main/resources/fxml/CreateOperationController.fxml b/src/main/resources/fxml/CreateOperationController.fxml
index 54e08b0..18a1508 100644
--- a/src/main/resources/fxml/CreateOperationController.fxml
+++ b/src/main/resources/fxml/CreateOperationController.fxml
@@ -10,82 +10,109 @@
 <?import javafx.scene.layout.FlowPane?>
 <?import javafx.scene.text.Font?>
 
-<?import javafx.scene.control.ScrollPane?>
-<?import javafx.geometry.Insets?>
 <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
   prefHeight="650.0" prefWidth="1200.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.CreateOperationController"
-  stylesheets="@/styles/main.css">
-  <ScrollPane layoutX="34.0" prefWidth="932.0" AnchorPane.bottomAnchor="0" AnchorPane.topAnchor="222" vbarPolicy="NEVER">
-    <FlowPane fx:id="fpVehicles" hgap="12" vgap="12" prefWidth="918">
-      <padding>
-        <Insets topRightBottomLeft="6"/>
-      </padding>
-    </FlowPane>
-  </ScrollPane>
-  <AnchorPane prefHeight="182.0" style="-fx-background-color: #2D75B6;" AnchorPane.leftAnchor="0.0"
-    AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0"/>
-  <AnchorPane fx:id="apCreateOperation" layoutX="40.0" layoutY="71.0" prefHeight="151.0"
-    prefWidth="920.0"
-    styleClass="shadowed-white">
-    <Label layoutX="14.0" layoutY="14.0" prefHeight="30.0" prefWidth="62.0" text="Code"
-      styleClass="text-medium"/>
-    <Label layoutX="185.0" layoutY="14.0" prefHeight="30.0" prefWidth="94.0" text="Adresse"
-      styleClass="text-medium"/>
-    <Label layoutX="587.0" layoutY="14.0" prefHeight="30.0" prefWidth="121.0" text="Anmerkung"
-      styleClass="text-medium"/>
-    <TextField fx:id="txtCode" layoutX="14.0" layoutY="48.0" prefHeight="39.0"
-      prefWidth="163.0" styleClass="text-big">
+  fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.userInterface.CreateOperationController">
+   <AnchorPane layoutX="964.0" layoutY="-66.0" prefHeight="182.0" prefWidth="1200.0"
+     style="-fx-background-color: #2D75B6;" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0"/>
+   <AnchorPane fx:id="apCreateOperation" layoutX="40.0" layoutY="71.0" prefHeight="151.0"
+     prefWidth="920.0"
+     style="-fx-background-color: white; -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 5, 0, 0, 5);">
+      <Label layoutX="14.0" layoutY="14.0" prefHeight="30.0" prefWidth="62.0" text="Code">
+         <font>
+            <Font size="19.0"/>
+         </font>
+      </Label>
+      <Label layoutX="185.0" layoutY="14.0" prefHeight="30.0" prefWidth="94.0" text="Adresse">
+         <font>
+            <Font size="19.0"/>
+         </font>
+      </Label>
+      <Label layoutX="587.0" layoutY="14.0" prefHeight="30.0" prefWidth="121.0" text="Anmerkung">
+         <font>
+            <Font size="19.0"/>
+         </font>
+      </Label>
+      <TextField fx:id="txtCode" layoutX="14.0" layoutY="48.0" prefHeight="39.0"
+        prefWidth="163.0">
+         <font>
+            <Font name="System Bold" size="20.0"/>
+         </font>
+      </TextField>
+      <TextField fx:id="txtAddress" layoutX="185.0" layoutY="48.0" prefHeight="39.0"
+        prefWidth="396.0">
+         <font>
+            <Font name="System Bold" size="20.0"/>
+         </font>
+      </TextField>
+      <TextField fx:id="txtNote" layoutX="587.0" layoutY="48.0" prefHeight="39.0"
+        prefWidth="319.0">
+         <font>
+            <Font name="System Bold" size="20.0"/>
+         </font>
+      </TextField>
+      <Label layoutX="14.0" layoutY="101.0" prefHeight="30.0" prefWidth="102.0"
+        text="Fahrzeuge:">
+         <font>
+            <Font size="19.0"/>
+         </font>
+      </Label>
+      <Label fx:id="lblChosenVehicles" layoutX="116.0" layoutY="102.0" prefHeight="30.0"
+        prefWidth="610.0" text="keine ausgewählt">
+         <font>
+            <Font size="19.0"/>
+         </font>
+      </Label>
+      <Button fx:id="btnCreateOperation" layoutX="747.0" layoutY="95.0" mnemonicParsing="false"
+        onAction="#createOperationClicked" prefHeight="0.0" prefWidth="158.0" text="Erstellen">
+         <font>
+            <Font name="System Bold" size="21.0"/>
+         </font>
+      </Button>
+   </AnchorPane>
+   <Hyperlink layoutX="44.0" layoutY="38.0" onAction="#onRegistrationLinkClicked" text="Anmeldungen"
+     textFill="WHITE">
       <font>
-        <Font name="System Bold"/>
+         <Font size="15.0"/>
       </font>
-    </TextField>
-    <TextField fx:id="txtAddress" layoutX="185.0" layoutY="48.0" prefHeight="39.0"
-      prefWidth="396.0" styleClass="text-big">
+   </Hyperlink>
+   <Hyperlink layoutX="802.0" layoutY="38.0" onAction="#onEmployeeLinkClicked" text="Personen"
+     textFill="WHITE">
       <font>
-        <Font name="System Bold"/>
+         <Font size="15.0"/>
       </font>
-    </TextField>
-    <TextField fx:id="txtNote" layoutX="587.0" layoutY="48.0" prefHeight="39.0"
-      prefWidth="319.0" styleClass="text-big">
+   </Hyperlink>
+   <Hyperlink layoutX="877.0" layoutY="38.0" onAction="#onVehicleLinkClicked" text="Fahrzeuge"
+     textFill="WHITE">
       <font>
-        <Font name="System Bold"/>
+         <Font size="15.0"/>
       </font>
-    </TextField>
-    <Label layoutX="14.0" layoutY="101.0" prefHeight="30.0" prefWidth="102.0"
-      text="Fahrzeuge:" styleClass="text-medium"/>
-    <Label fx:id="lblChosenVehicles" layoutX="116.0" layoutY="102.0" prefHeight="30.0"
-      prefWidth="610.0" text="keine ausgewählt" styleClass="text-big"/>
-    <Button fx:id="btnCreateOperation" layoutX="747.0" styleClass="text-big" layoutY="95.0"
-      mnemonicParsing="false"
-      onAction="#createOperationClicked" prefHeight="0.0" prefWidth="158.0" text="Erstellen">
-      <font>
-        <Font name="System Bold"/>
-      </font>
-    </Button>
-  </AnchorPane>
-  <Hyperlink layoutX="44.0" layoutY="38.0" onAction="#onRegistrationLinkClicked" text="Anmeldungen"
-    textFill="WHITE" styleClass="text-small">
-  </Hyperlink>
-  <Hyperlink layoutX="802.0" layoutY="38.0" onAction="#onEmployeeLinkClicked" text="Personen"
-    styleClass="text-small"
-    textFill="WHITE">
-  </Hyperlink>
-  <Hyperlink layoutX="877.0" layoutY="38.0" onAction="#onVehicleLinkClicked" text="Fahrzeuge"
-    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="shadowed-white">
-    <ListView fx:id="lvActiveOperations" layoutX="4.0" layoutY="74.0" prefHeight="242.0"
-      prefWidth="200.0" style="-fx-background-color: white;"/>
-    <Label layoutX="10.0" layoutY="6.0"
-      text="Aktive Einsätze" styleClass="text-big">
-    </Label>
-    <Label layoutY="12.0" text="Archiv" styleClass="text-medium" AnchorPane.rightAnchor="12">
-    </Label>
-  </AnchorPane>
+   </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"
+     style="-fx-background-color: white; -fx-effect: dropshadow(gaussian, rgba(0.8,0.8,0.8,0.8), 5, 0, 0, 3);">
+      <children>
+         <ListView fx:id="lvActiveOperations" layoutX="4.0" layoutY="74.0" prefHeight="242.0"
+           prefWidth="200.0" style="-fx-background-color: white;"/>
+         <Label layoutX="10.0" layoutY="14.0" prefHeight="46.0" prefWidth="103.0"
+           text="Aktive Einsätze">
+            <font>
+               <Font name="System Bold" size="14.0"/>
+            </font>
+         </Label>
+         <Label layoutX="148.0" layoutY="28.0" text="Archiv">
+            <font>
+               <Font size="13.0"/>
+            </font>
+         </Label>
+      </children>
+   </AnchorPane>
+   <FlowPane fx:id="fpVehicles" hgap="12" layoutX="40.0" layoutY="228.0" prefHeight="388.0"
+     prefWidth="920.0" styleClass=".shadowedWhite" stylesheets="@../styles/main.css" vgap="12">
+      <effect>
+         <DropShadow blurType="GAUSSIAN" color="GRAY" offsetX="0" offsetY="3.0" radius="5"/>
+      </effect>
+   </FlowPane>
 </AnchorPane>
diff --git a/src/main/resources/fxml/vehiclePane.fxml b/src/main/resources/fxml/vehiclePane.fxml
index 79cfaf9..38be664 100644
--- a/src/main/resources/fxml/vehiclePane.fxml
+++ b/src/main/resources/fxml/vehiclePane.fxml
@@ -10,7 +10,7 @@
 <?import javafx.scene.text.Text?>
 <?import javafx.scene.text.TextFlow?>
 
-<GridPane hgap="6.0" stylesheets="@/styles/main.css" styleClass="shadowed-white" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.ui.vehiclepane.VehiclePaneController">
+<GridPane hgap="6.0" style="-fx-background-color: white;" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.ui.vehiclepane.VehiclePaneController">
   <columnConstraints>
     <ColumnConstraints />
     <ColumnConstraints />
-- 
cgit v1.2.3-70-g09d2