Search in sources :

Example 1 with MainController

use of org.phoenicis.javafx.controller.MainController in project POL-POM-5 by PlayOnLinux.

the class JavaFXApplication method start.

@Override
public void start(Stage primaryStage) {
    primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("views/common/phoenicis.png")));
    primaryStage.setTitle("Phoenicis");
    loadFonts();
    ConfigurableApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfiguration.class);
    final MainController mainController = applicationContext.getBean(MainController.class);
    mainController.show();
    mainController.setOnClose(() -> {
        applicationContext.getBean(ControlledThreadPoolExecutorServiceCloser.class).setCloseImmediately(true);
        applicationContext.close();
    });
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) ControlledThreadPoolExecutorServiceCloser(org.phoenicis.multithreading.ControlledThreadPoolExecutorServiceCloser) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) MainController(org.phoenicis.javafx.controller.MainController) Image(javafx.scene.image.Image)

Aggregations

Image (javafx.scene.image.Image)1 MainController (org.phoenicis.javafx.controller.MainController)1 ControlledThreadPoolExecutorServiceCloser (org.phoenicis.multithreading.ControlledThreadPoolExecutorServiceCloser)1 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1