diff options
author | Andreas Weninger <e01526989@student.tuwien.ac.at> | 2018-06-05 11:33:53 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2018-06-06 19:40:02 +0200 |
commit | 91566c9a1e80c47ef93f8158df59564d2cdfdfdc (patch) | |
tree | 1c0e87416a1593956f10e5b074f4b21e4be8b149 /src/main/java/at/ac | |
parent | 6a8dc5df10bb7f478187a97fe0b31fb5dd2efc87 (diff) | |
download | sepm-groupproject-91566c9a1e80c47ef93f8158df59564d2cdfdfdc.tar.gz sepm-groupproject-91566c9a1e80c47ef93f8158df59564d2cdfdfdc.tar.xz sepm-groupproject-91566c9a1e80c47ef93f8158df59564d2cdfdfdc.zip |
Status display is only show if parameter is true.
Diffstat (limited to 'src/main/java/at/ac')
-rw-r--r-- | src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/VehiclePaneController.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/VehiclePaneController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/VehiclePaneController.java index 35a4b4a..8a0bba3 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/VehiclePaneController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/VehiclePaneController.java @@ -56,10 +56,10 @@ public class VehiclePaneController { * * Set the displayed data of this VehiclePane. * * @param vehicle The data to display. - * @param showQualification If true, the most recent registration of vehicle will be searched - * for the highest qualification. + * @param showStatusInfo If true, the highest qualification of the vehicle's active registration + * and the vehicle's status will be shown. */ - public void setData(Vehicle vehicle, boolean showQualification) { + public void setData(Vehicle vehicle, boolean showStatusInfo) { txtType.setText(vehicle.type().name()); String constrType = vehicle.constructionType().name(); txtRooftype.setText( @@ -72,7 +72,7 @@ public class VehiclePaneController { ivNEF.setImage(new Image("images/NotNEF.png")); txtNEF.setText("keine NEF-Halterung"); } - if (showQualification) { + if (showStatusInfo) { Instant now = Instant.now(); List<Registration> regs = vehicle.registrations(); @@ -92,18 +92,20 @@ public class VehiclePaneController { } txtQualification.setText(edu.get().name()); + + txtStatus.setText(vehicle.status().name()); + if (vehicle.status() == Status.FREI_FUNK || vehicle.status() == Status.FREI_WACHE) { + txtStatus.getStyleClass().add("bg-status-green"); + } else { + txtStatus.getStyleClass().add("bg-status-orange"); + } } else { txtQualification.setVisible(false); txtQualification.setManaged(false); ivQualification.setVisible(false); ivQualification.setManaged(false); - } - txtStatus.setText(vehicle.status().name()); - if (vehicle.status() == Status.FREI_FUNK || vehicle.status() == Status.FREI_WACHE) { - txtStatus.getStyleClass().add("bg-status-green"); - } else { - txtStatus.getStyleClass().add("bg-status-orange"); + txtStatus.setVisible(false); } this.data = vehicle; |