diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/ui/vehiclePane/VehiclePaneController.java | 55 | 
1 files changed, 40 insertions, 15 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/ui/vehiclePane/VehiclePaneController.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/ui/vehiclePane/VehiclePaneController.java index 903028e..2b0df13 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/ui/vehiclePane/VehiclePaneController.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/ui/vehiclePane/VehiclePaneController.java @@ -2,23 +2,25 @@ package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.ui.vehiclePane  import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto.Vehicle;  import java.io.IOException; +import javafx.fxml.FXML;  import javafx.fxml.FXMLLoader;  import javafx.scene.Node; +import javafx.scene.image.Image;  import javafx.scene.image.ImageView;  import javafx.scene.text.Text;  public class VehiclePaneController { - -    private Text txtType; -    private Text txtNumber; -    private ImageView ivNEF; -    private Text txtNEF; -    private ImageView ivQualification; -    private Text txtQualification; -    private Text txtRooftype; +    @FXML private Text txtType; +    @FXML private Text txtNumber; +    @FXML private ImageView ivNEF; +    @FXML private Text txtNEF; +    @FXML private ImageView ivQualification; +    @FXML private Text txtQualification; +    @FXML private Text txtRooftype;      public static VehiclePaneController createVehiclePane() throws IOException { -        FXMLLoader fxmlLoader = new FXMLLoader(VehiclePaneController.class.getResource("/fxml/vehiclePane.fxml")); +        FXMLLoader fxmlLoader = +                new FXMLLoader(VehiclePaneController.class.getResource("/fxml/vehiclePane.fxml"));          Node root = fxmlLoader.load();          VehiclePaneController result = fxmlLoader.getController();          result.rootElement = root; @@ -32,13 +34,36 @@ public class VehiclePaneController {          return rootElement;      } -    /*** -     * Set the displayed data of this VehiclePane. +    /** +     * * 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 showQualification If true, the most recent registration of vehicle will be searched +     *     for the highest qualification.       */ -    public void setData(Vehicle vehicle, boolean showQualification) -    { - +    public void setData(Vehicle vehicle, boolean showQualification) { +        txtType.setText(vehicle.type().name()); +        String constrType = vehicle.constructionType().name(); +        txtRooftype.setText( +                constrType.substring(0, 1).toUpperCase() + constrType.substring(1).toLowerCase()); +        txtNumber.setText("" + vehicle.id()); +        if (vehicle.hasNef()) { +            ivNEF.setImage(new Image("../images/NEF.png")); +            txtNEF.setText("hat NEF-Halterung"); +        } else { +            ivNEF.setImage(new Image("../images/NotNEF.png")); +            txtNEF.setText("keine NEF-Halterung"); +        } +        if (showQualification) +        { +            //TODO +        } +        else +        { +            txtQualification.setVisible(false); +            txtQualification.setManaged(false); +            ivQualification.setVisible(false); +            ivQualification.setManaged(false); +        }      }  }  | 
