Search in sources :

Example 1 with UiProjectRepository

use of com.helospark.tactview.ui.javafx.repository.UiProjectRepository in project tactview by helospark.

the class JavaFXUiMain method init.

@Override
public void init() throws Exception {
    super.init();
    Platform.runLater(() -> {
        splashStage = new Stage(StageStyle.DECORATED);
        splashStage.setTitle("Tactview starting...");
        StylesheetAdderService.setTactviewIconForStageStatic(splashStage);
        splasViewh = new ImageView(new Image(getClass().getResource("/tactview-splash.png").toString()));
        splashStage.initStyle(StageStyle.TRANSPARENT);
        showSplash(splashStage, splasViewh);
    });
    LightDiContextConfiguration configuration = LightDiContextConfiguration.builder().withThreadNumber(4).withCheckForIntegrity(true).withAdditionalDependencies(Collections.singletonList(new JnaLightDiPlugin())).withUseClasspathFile(false).build();
    List<Class<?>> allClasses = new ArrayList<>();
    allClasses.add(MainApplicationConfiguration.class);
    allClasses.addAll(PluginMainClassProviders.getPluginClasses());
    lightDi = new LightDiContext(configuration);
    lightDi.addPropertySource(createInitialPropertySource());
    lightDi.loadDependencies(List.of(), allClasses);
    uiTimeline = lightDi.getBean(UiTimeline.class);
    uiTimelineManager = lightDi.getBean(UiTimelineManager.class);
    effectPropertyView = lightDi.getBean(PropertyView.class);
    uiTimelineManager.registerUiPlaybackConsumer(position -> uiTimeline.updateLine(position));
    uiTimelineManager.registerUiPlaybackConsumer(position -> effectPropertyView.updateValues(position));
    displayUpdateService = lightDi.getBean(DisplayUpdaterService.class);
    projectSizeInitializer = lightDi.getBean(ProjectSizeInitializer.class);
    uiTimelineManager.setDisplayUpdaterService(lightDi.getBean(DisplayUpdaterService.class));
    uiProjectRepository = lightDi.getBean(UiProjectRepository.class);
    renderService = lightDi.getBean(RenderDialogOpener.class);
    lightDi.eagerInitAllBeans();
}
Also used : LightDiContext(com.helospark.lightdi.LightDiContext) UiProjectRepository(com.helospark.tactview.ui.javafx.repository.UiProjectRepository) ArrayList(java.util.ArrayList) BufferedImage(java.awt.image.BufferedImage) Image(javafx.scene.image.Image) RenderDialogOpener(com.helospark.tactview.ui.javafx.render.RenderDialogOpener) UiTimeline(com.helospark.tactview.ui.javafx.uicomponents.UiTimeline) JnaLightDiPlugin(com.helospark.tactview.core.util.jpaplugin.JnaLightDiPlugin) Stage(javafx.stage.Stage) ProjectSizeInitializer(com.helospark.tactview.ui.javafx.menu.defaultmenus.projectsize.ProjectSizeInitializer) ImageView(javafx.scene.image.ImageView) LightDiContextConfiguration(com.helospark.lightdi.LightDiContextConfiguration) PropertyView(com.helospark.tactview.ui.javafx.uicomponents.PropertyView)

Aggregations

LightDiContext (com.helospark.lightdi.LightDiContext)1 LightDiContextConfiguration (com.helospark.lightdi.LightDiContextConfiguration)1 JnaLightDiPlugin (com.helospark.tactview.core.util.jpaplugin.JnaLightDiPlugin)1 ProjectSizeInitializer (com.helospark.tactview.ui.javafx.menu.defaultmenus.projectsize.ProjectSizeInitializer)1 RenderDialogOpener (com.helospark.tactview.ui.javafx.render.RenderDialogOpener)1 UiProjectRepository (com.helospark.tactview.ui.javafx.repository.UiProjectRepository)1 PropertyView (com.helospark.tactview.ui.javafx.uicomponents.PropertyView)1 UiTimeline (com.helospark.tactview.ui.javafx.uicomponents.UiTimeline)1 BufferedImage (java.awt.image.BufferedImage)1 ArrayList (java.util.ArrayList)1 Image (javafx.scene.image.Image)1 ImageView (javafx.scene.image.ImageView)1 Stage (javafx.stage.Stage)1