Search in sources :

Example 1 with GraphProvider

use of com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider 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)

Example 2 with GraphProvider

use of com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider in project tactview by helospark.

the class GraphProceduralClip method getDescriptorsInternal.

@Override
public List<ValueProviderDescriptor> getDescriptorsInternal() {
    List<ValueProviderDescriptor> result = super.getDescriptorsInternal();
    // if is there to distinguish between load and new init
    if (graphProvider == null) {
        EffectGraph effectGraph = defaultGraphArrangementFactory.createEffectGraphProviderWithOutput();
        graphProvider = new GraphProvider(effectGraph);
    }
    graphProvider.setContainingIntervalAware(this);
    graphProvider.setContainingElementId(this.getId());
    // TODO: this is not a pretty solution, but current arch does not provider better, must think of different way
    effectGraphAccessor.sendProviderMessageFor(graphProvider);
    ValueProviderDescriptor graphDescriptor = ValueProviderDescriptor.builder().withKeyframeableEffect(graphProvider).withName("Graph").build();
    result.add(graphDescriptor);
    return result;
}
Also used : ValueProviderDescriptor(com.helospark.tactview.core.timeline.effect.interpolation.ValueProviderDescriptor) EffectGraph(com.helospark.tactview.core.timeline.effect.interpolation.graph.EffectGraph) GraphProvider(com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider)

Example 3 with GraphProvider

use of com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider in project tactview by helospark.

the class GraphEffect method initializeValueProviderInternal.

@Override
protected void initializeValueProviderInternal() {
    EffectGraph effectGraph = defaultGraphArrangementFactory.createEffectGraphProviderWithInputAndOutput();
    effectGraphProvider = new GraphProvider(effectGraph);
}
Also used : EffectGraph(com.helospark.tactview.core.timeline.effect.interpolation.graph.EffectGraph) GraphProvider(com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider)

Aggregations

GraphProvider (com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider)3 ValueProviderDescriptor (com.helospark.tactview.core.timeline.effect.interpolation.ValueProviderDescriptor)2 EffectGraph (com.helospark.tactview.core.timeline.effect.interpolation.graph.EffectGraph)2 Component (com.helospark.lightdi.annotation.Component)1 EffectParametersRepository (com.helospark.tactview.core.timeline.effect.EffectParametersRepository)1 EffectGraphAccessor (com.helospark.tactview.core.timeline.effect.interpolation.graph.EffectGraphAccessor)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