aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/at/ac/tuwien
diff options
context:
space:
mode:
authorDominic Rogetzer <e1627756@student.tuwien.ac.at>2018-05-07 12:14:13 +0200
committerDominic Rogetzer <e01627756@student.tuwien.ac.at>2018-05-07 12:14:13 +0200
commit40ad8a458a0706ccdcd567965f0275d4dd0aa118 (patch)
treef90459884956e46239a9f40ce4a292febc0f0045 /src/main/java/at/ac/tuwien
parentd3f8c25338c4dfbefc70eb5cb01f2f448ecb9e99 (diff)
downloadsepm-groupproject-40ad8a458a0706ccdcd567965f0275d4dd0aa118.tar.gz
sepm-groupproject-40ad8a458a0706ccdcd567965f0275d4dd0aa118.tar.xz
sepm-groupproject-40ad8a458a0706ccdcd567965f0275d4dd0aa118.zip
Add MainApplication which opens Operation window
Diffstat (limited to 'src/main/java/at/ac/tuwien')
-rw-r--r--src/main/java/at/ac/tuwien/sepm/assignment/groupphase/application/MainApplication.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/application/MainApplication.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/application/MainApplication.java
new file mode 100644
index 0000000..a8a6c62
--- /dev/null
+++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/application/MainApplication.java
@@ -0,0 +1,51 @@
+package at.ac.tuwien.sepm.assignment.groupphase.application;
+
+import at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.userInterface.CreateOperationController;
+import at.ac.tuwien.sepm.assignment.groupphase.util.SpringFXMLLoader;
+import javafx.application.Application;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.stereotype.Component;
+
+@Component
+@ComponentScan("at.ac.tuwien.sepm.assignment.groupphase")
+public class MainApplication extends Application {
+
+ private static AnnotationConfigApplicationContext configApplicationContext;
+
+ public static void main(String[] args) {
+ Application.launch(MainApplication.class, args);
+ }
+
+ @Override
+ public void start(Stage primaryStage) throws Exception {
+ primaryStage.setTitle("Einsatz erstellen");
+ primaryStage.centerOnScreen();
+ // primaryStage.setOnCloseRequest( event -> );
+
+ configApplicationContext = new AnnotationConfigApplicationContext(MainApplication.class);
+ final var fxmlLoader = configApplicationContext.getBean(SpringFXMLLoader.class);
+ primaryStage.setScene(
+ new Scene(
+ (Parent)
+ fxmlLoader.load(
+ getClass()
+ .getResourceAsStream(
+ "/fxml/CreateOperationController.fxml"))));
+
+ /*FXMLLoader fxmlLoader =
+ new FXMLLoader(getClass().getResource("/fxml/CreateOperationController.fxml"));
+ Parent node = fxmlLoader.load();
+ // TODO:*/
+ CreateOperationController controller =
+ configApplicationContext.getBean(
+ CreateOperationController.class); // fxmlLoader.getController();
+ controller.updateList();
+ // primaryStage.setScene(new Scene(node));
+ primaryStage.show();
+ primaryStage.toFront();
+ }
+}