diff options
Diffstat (limited to 'src/main/java/at/ac/tuwien')
| -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;  | 
