Search in sources :

Example 1 with EffectGraphAccessor

use of com.helospark.tactview.core.timeline.effect.interpolation.graph.EffectGraphAccessor in project tactview by helospark.

the class GraphSetterChainItem method handle.

@Override
protected EffectLine handle(GraphProvider graphingProvider, ValueProviderDescriptor descriptor) {
    Button button = new Button("Open graph window", new Glyph("FontAwesome", FontAwesome.Glyph.DIAMOND));
    GraphingComponent graphingComponent = new GraphingComponent(250, 100, effectGraphAccessor, messagingService, menuItemFactories, commandInterpreter, stylesheetAdderService, nameToIdRepository);
    graphingComponent.setGraphProvider(graphingProvider);
    graphingComponent.setZoom(0.4);
    graphingComponent.setParent(scene.getWindow());
    graphingComponent.redrawGraphProvider();
    VBox vbox = new VBox(button, graphingComponent);
    PrimitiveEffectLine result = PrimitiveEffectLine.builder().withCurrentValueProvider(() -> effectParametersRepository.getValueAtAsObject(graphingProvider.getId(), uiTimelineManager.getCurrentPosition())).withVisibleNode(vbox).withDescriptorId(graphingProvider.getId()).withEffectParametersRepository(effectParametersRepository).withCommandInterpreter(commandInterpreter).withDescriptor(descriptor).withUpdateFunction(position -> {
        graphingComponent.redrawGraphProvider();
    }).withUpdateFromValue(value -> {
    }).build();
    button.setOnMouseClicked(event -> {
        dockableTabRepository.openTab(graphingDialog);
        graphingDialog.showProvider(graphingProvider);
    });
    return result;
}
Also used : Button(javafx.scene.control.Button) Component(com.helospark.lightdi.annotation.Component) ValueProviderDescriptor(com.helospark.tactview.core.timeline.effect.interpolation.ValueProviderDescriptor) Scene(javafx.scene.Scene) UiCommandInterpreterService(com.helospark.tactview.ui.javafx.UiCommandInterpreterService) GraphingComponentFactory(com.helospark.tactview.ui.javafx.uicomponents.propertyvalue.graph.factory.GraphingComponentFactory) NameToIdRepository(com.helospark.tactview.ui.javafx.repository.NameToIdRepository) GraphingDialog(com.helospark.tactview.ui.javafx.uicomponents.propertyvalue.graph.GraphingDialog) EffectParametersRepository(com.helospark.tactview.core.timeline.effect.EffectParametersRepository) DockableTabRepository(com.helospark.tactview.ui.javafx.tabs.dockabletab.DockableTabRepository) VBox(javafx.scene.layout.VBox) MessagingService(com.helospark.tactview.core.util.messaging.MessagingService) List(java.util.List) EffectGraphAccessor(com.helospark.tactview.core.timeline.effect.interpolation.graph.EffectGraphAccessor) ScenePostProcessor(com.helospark.tactview.ui.javafx.scenepostprocessor.ScenePostProcessor) Glyph(org.controlsfx.glyphfont.Glyph) GraphProvider(com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider) StylesheetAdderService(com.helospark.tactview.ui.javafx.stylesheet.StylesheetAdderService) FontAwesome(org.controlsfx.glyphfont.FontAwesome) GraphingComponent(com.helospark.tactview.ui.javafx.uicomponents.propertyvalue.graph.GraphingComponent) UiTimelineManager(com.helospark.tactview.ui.javafx.UiTimelineManager) Button(javafx.scene.control.Button) Glyph(org.controlsfx.glyphfont.Glyph) VBox(javafx.scene.layout.VBox) GraphingComponent(com.helospark.tactview.ui.javafx.uicomponents.propertyvalue.graph.GraphingComponent)

Aggregations

Component (com.helospark.lightdi.annotation.Component)1 EffectParametersRepository (com.helospark.tactview.core.timeline.effect.EffectParametersRepository)1 ValueProviderDescriptor (com.helospark.tactview.core.timeline.effect.interpolation.ValueProviderDescriptor)1 EffectGraphAccessor (com.helospark.tactview.core.timeline.effect.interpolation.graph.EffectGraphAccessor)1 GraphProvider (com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider)1 MessagingService (com.helospark.tactview.core.util.messaging.MessagingService)1 UiCommandInterpreterService (com.helospark.tactview.ui.javafx.UiCommandInterpreterService)1 UiTimelineManager (com.helospark.tactview.ui.javafx.UiTimelineManager)1 NameToIdRepository (com.helospark.tactview.ui.javafx.repository.NameToIdRepository)1 ScenePostProcessor (com.helospark.tactview.ui.javafx.scenepostprocessor.ScenePostProcessor)1 StylesheetAdderService (com.helospark.tactview.ui.javafx.stylesheet.StylesheetAdderService)1 DockableTabRepository (com.helospark.tactview.ui.javafx.tabs.dockabletab.DockableTabRepository)1 GraphingComponent (com.helospark.tactview.ui.javafx.uicomponents.propertyvalue.graph.GraphingComponent)1 GraphingDialog (com.helospark.tactview.ui.javafx.uicomponents.propertyvalue.graph.GraphingDialog)1 GraphingComponentFactory (com.helospark.tactview.ui.javafx.uicomponents.propertyvalue.graph.factory.GraphingComponentFactory)1 List (java.util.List)1 Scene (javafx.scene.Scene)1 Button (javafx.scene.control.Button)1 VBox (javafx.scene.layout.VBox)1 FontAwesome (org.controlsfx.glyphfont.FontAwesome)1