Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. package carbonFootprint.gui.view;
  2.  
  3. import carbonFootprint.gui.CarbonFootprint;
  4. import carbonFootprint.gui.controller.CarbonFootprintController;
  5. import javafx.collections.FXCollections;
  6. import javafx.event.ActionEvent;
  7. import javafx.fxml.FXML;
  8. import javafx.scene.control.Button;
  9. import javafx.scene.control.ChoiceBox;
  10. import javafx.scene.control.TextArea;
  11. import javafx.scene.control.TextField;
  12.  
  13. public class CarbonFootprintMainViewController
  14. {
  15. // Das ist das zentrale Objekt der GUI
  16. private CarbonFootprint footprint;
  17.  
  18. // Dies ist der Controller, der die Funktionalität bereitstellt
  19. private CarbonFootprintController carbonFootprintController =new CarbonFootprintController();
  20.  
  21. @FXML
  22. private TextField firstName;
  23.  
  24. @FXML
  25. private TextField lastName;
  26.  
  27. @FXML
  28. private TextField strasse;
  29.  
  30. @FXML
  31. private TextField hausnr;
  32.  
  33. @FXML
  34. private TextField plz;
  35.  
  36. // Hier fehlen noch einige Eingabeelemente...
  37.  
  38. @FXML
  39. private Button ausfuehren;
  40.  
  41. @FXML
  42. private TextArea ausgabe;
  43.  
  44. @FXML
  45. private ChoiceBox<String> vehicleChoiceBox;
  46.  
  47. @FXML
  48. private void initialize ()
  49. {
  50. // Wird beim Öffnen des Formulars ausgeführt
  51.  
  52. vehicleChoiceBox.setItems(FXCollections.observableArrayList("","Fahrrad","Auto","Bus"));
  53. }
  54.  
  55.  
  56. @FXML
  57. private void buttonAktivieren (ActionEvent event)
  58. {
  59. // Hier kommen Funktionsaufrufe hin, die beim Drücken des Buttons stattfinden sollen,
  60. // die eigentliche Implementierung sollte im Controller stattfinden
  61. }
  62.  
  63. public void setMainApp (CarbonFootprint footprint)
  64. {
  65. this.footprint=footprint;
  66. }
  67.  
  68. public CarbonFootprint getMainApp ()
  69. {
  70. return footprint;
  71. }
  72.  
  73. public TextField getFirstName ()
  74. {
  75. return firstName;
  76. }
  77.  
  78. public void setFirstName (TextField firstName)
  79. {
  80. this.firstName=firstName;
  81. }
  82.  
  83. public TextField getLastName ()
  84. {
  85. return lastName;
  86. }
  87.  
  88. public void setLastName (TextField lastName)
  89. {
  90. this.lastName=lastName;
  91. }
  92.  
  93. public TextField getStrasse ()
  94. {
  95. return strasse;
  96. }
  97.  
  98. public void setStrasse (TextField strasse)
  99. {
  100. this.strasse=strasse;
  101. }
  102.  
  103. public TextField getHausnr ()
  104. {
  105. return hausnr;
  106. }
  107.  
  108. public void setHausnr (TextField hausnr)
  109. {
  110. this.hausnr=hausnr;
  111. }
  112.  
  113. public TextField getPlz ()
  114. {
  115. return plz;
  116. }
  117.  
  118. public void setPlz (TextField plz)
  119. {
  120. this.plz=plz;
  121. }
  122.  
  123. public ChoiceBox getVehicleChoiceBox ()
  124. {
  125. return vehicleChoiceBox;
  126. }
  127.  
  128. public void setVehicleChoiceBox (ChoiceBox vehicleChoiceBox)
  129. {
  130. this.vehicleChoiceBox=vehicleChoiceBox;
  131. }
  132. // Getter und Setter fehlen auch noch
  133.  
  134. public TextArea getAusgabe ()
  135. {
  136. return ausgabe;
  137. }
  138.  
  139. public void setAusgabe (TextArea ausgabe)
  140. {
  141. this.ausgabe=ausgabe;
  142. }
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement