diff options
Diffstat (limited to 'src/de/fhswf/in/inf/se/projektthemenvergabe/Main.java')
| -rw-r--r-- | src/de/fhswf/in/inf/se/projektthemenvergabe/Main.java | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/src/de/fhswf/in/inf/se/projektthemenvergabe/Main.java b/src/de/fhswf/in/inf/se/projektthemenvergabe/Main.java new file mode 100644 index 0000000..9e9d8d3 --- /dev/null +++ b/src/de/fhswf/in/inf/se/projektthemenvergabe/Main.java @@ -0,0 +1,105 @@ +/** + * + */ +package de.fhswf.in.inf.se.projektthemenvergabe; + +import de.fhswf.in.inf.se.projektthemenvergabe.model.Ansprechpartner; +import de.fhswf.in.inf.se.projektthemenvergabe.model.Organisation; +import de.fhswf.in.inf.se.projektthemenvergabe.view.AnsprechpartnerListeController; +import javafx.application.Application; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.scene.layout.BorderPane; +import javafx.stage.Stage; + +/** + * Handles the stages and the data. + * + * @author Dina-Marie Hanxleden & Stefan Suhren + * @version 1.0 + */ +public class Main extends Application +{ + private ObservableList<Ansprechpartner> ansprechpartner = FXCollections + .observableArrayList(Ansprechpartner.extractor()); + + private ObservableList<Organisation> organisation = FXCollections + .observableArrayList(Organisation.extractor()); + + private Stage primaryStage; + + /* + * (non-Javadoc) + * + * @see javafx.application.Application#start(javafx.stage.Stage) + */ + @Override + public void start(Stage primaryStage) throws Exception + { + this.primaryStage = primaryStage; + + try + { + FXMLLoader loader = new FXMLLoader( + getClass().getResource("view/AnsprechpartnerListe.fxml")); + BorderPane root = (BorderPane) loader.load(); + + Scene scene = new Scene(root); + primaryStage.setScene(scene); + + AnsprechpartnerListeController controller = loader.getController(); + controller.setMain(this); + + primaryStage.show(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + /** + * Getter for property ansprechpartner. + * + * @return Returns the ansprechpartner. + */ + public ObservableList<Ansprechpartner> getAnsprechpartner() + { + return ansprechpartner; + } + + /** + * Get the primary {@link Stage} for this application. Can for example be + * used to set modal. + * + * @return The primary stage of the application. + */ + public Stage getPrimaryStage() + { + return primaryStage; + } + + /** + * Getter for property organisation. + * + * @return Returns the organisation. + */ + public ObservableList<Organisation> getOrganisation() + { + return organisation; + } + + /** + * Launches the JavaFX application. + * + * @param args + * Command line arguments. + */ + public static void main(String[] args) + { + launch(args); + } + +} |
