use of com.helospark.tactview.ui.javafx.uicomponents.propertyvalue.graph.GraphingDialog 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;
}
Aggregations