Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package carbonFootprint.gui.view;
- import carbonFootprint.gui.CarbonFootprint;
- import carbonFootprint.gui.controller.CarbonFootprintController;
- import javafx.collections.FXCollections;
- import javafx.event.ActionEvent;
- import javafx.fxml.FXML;
- import javafx.scene.control.Button;
- import javafx.scene.control.ChoiceBox;
- import javafx.scene.control.TextArea;
- import javafx.scene.control.TextField;
- public class CarbonFootprintMainViewController
- {
- // Das ist das zentrale Objekt der GUI
- private CarbonFootprint footprint;
- // Dies ist der Controller, der die Funktionalität bereitstellt
- private CarbonFootprintController carbonFootprintController =new CarbonFootprintController();
- @FXML
- private TextField firstName;
- @FXML
- private TextField lastName;
- @FXML
- private TextField strasse;
- @FXML
- private TextField hausnr;
- @FXML
- private TextField plz;
- // Hier fehlen noch einige Eingabeelemente...
- @FXML
- private Button ausfuehren;
- @FXML
- private TextArea ausgabe;
- @FXML
- private ChoiceBox<String> vehicleChoiceBox;
- @FXML
- private void initialize ()
- {
- // Wird beim Öffnen des Formulars ausgeführt
- vehicleChoiceBox.setItems(FXCollections.observableArrayList("","Fahrrad","Auto","Bus"));
- }
- @FXML
- private void buttonAktivieren (ActionEvent event)
- {
- // Hier kommen Funktionsaufrufe hin, die beim Drücken des Buttons stattfinden sollen,
- // die eigentliche Implementierung sollte im Controller stattfinden
- }
- public void setMainApp (CarbonFootprint footprint)
- {
- this.footprint=footprint;
- }
- public CarbonFootprint getMainApp ()
- {
- return footprint;
- }
- public TextField getFirstName ()
- {
- return firstName;
- }
- public void setFirstName (TextField firstName)
- {
- this.firstName=firstName;
- }
- public TextField getLastName ()
- {
- return lastName;
- }
- public void setLastName (TextField lastName)
- {
- this.lastName=lastName;
- }
- public TextField getStrasse ()
- {
- return strasse;
- }
- public void setStrasse (TextField strasse)
- {
- this.strasse=strasse;
- }
- public TextField getHausnr ()
- {
- return hausnr;
- }
- public void setHausnr (TextField hausnr)
- {
- this.hausnr=hausnr;
- }
- public TextField getPlz ()
- {
- return plz;
- }
- public void setPlz (TextField plz)
- {
- this.plz=plz;
- }
- public ChoiceBox getVehicleChoiceBox ()
- {
- return vehicleChoiceBox;
- }
- public void setVehicleChoiceBox (ChoiceBox vehicleChoiceBox)
- {
- this.vehicleChoiceBox=vehicleChoiceBox;
- }
- // Getter und Setter fehlen auch noch
- public TextArea getAusgabe ()
- {
- return ausgabe;
- }
- public void setAusgabe (TextArea ausgabe)
- {
- this.ausgabe=ausgabe;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement