use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.
the class StandardClipContextMenuChainItemConfiguration method copyMenuItem.
@Bean
@Order(100)
public ClipContextMenuChainItem copyMenuItem(CopyPasteRepository copyPasteRepository) {
return alwaysSupportedContextMenuItem(request -> {
MenuItem copyClip = new MenuItem("Copy");
copyClip.setOnAction(e -> copyPasteRepository.copyClip(List.of(request.getPrimaryClip().getId())));
return copyClip;
});
}
use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.
the class StandardDoubleInterpolatorFactoryConfiguration method bezierDoubleInterpolator.
@Bean
public StandardDoubleInterpolatorFactory<?> bezierDoubleInterpolator() {
return new StandardDoubleInterpolatorFactory<>("bezierDoubleInterpolator", BezierDoubleInterpolator.class, (previousProvider, previousInterpolator) -> {
TreeMap<TimelinePosition, CubicBezierPoint> values = new TreeMap<>();
double defaultValue = 0.0;
if (previousInterpolator instanceof KeyframeSupportingDoubleInterpolator) {
for (var entry : ((KeyframeSupportingDoubleInterpolator) previousInterpolator).getValues().entrySet()) {
values.put(entry.getKey(), new CubicBezierPoint((Double) entry.getValue(), new Point(-1, 0), new Point(1, 0)));
}
defaultValue = ((KeyframeSupportingDoubleInterpolator) previousInterpolator).getDefaultValue();
}
BezierDoubleInterpolator result = new BezierDoubleInterpolator(defaultValue, values);
if (previousInterpolator instanceof KeyframeSupportingDoubleInterpolator) {
result.setUseKeyframes(((KeyframeSupportingDoubleInterpolator) previousInterpolator).isUsingKeyframes());
}
return result;
});
}
use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.
the class CommonPropertyValueContextMenuItemConfiguration method removeAllAndSet.
@Bean
@Order(20)
public PropertyValueContextMenuItem removeAllAndSet(UiTimelineManager timelineManager, EffectParametersRepository effectParametersRepository, UiCommandInterpreterService commandInterpreter) {
return contextMenuEnabledIfKeyframesEnabled(request -> {
MenuItem removeAllAndSetMenuItemw = new MenuItem("Remove all and set");
removeAllAndSetMenuItemw.setOnAction(e -> {
request.effectLine.removeAllAndSetKeyframe(timelineManager.getCurrentPosition());
});
return removeAllAndSetMenuItemw;
});
}
use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.
the class CommonPropertyValueContextMenuItemConfiguration method removeKeyframeItem.
@Bean
@Order(10)
public PropertyValueContextMenuItem removeKeyframeItem(UiTimelineManager timelineManager, EffectParametersRepository effectParametersRepository, UiCommandInterpreterService commandInterpreter) {
return contextMenuEnabledIfKeyframesEnabled(request -> {
MenuItem removeKeyframeMenuItem = new MenuItem("Remove keyframe");
removeKeyframeMenuItem.setOnAction(e -> {
request.effectLine.removeKeyframe(timelineManager.getCurrentPosition());
});
return removeKeyframeMenuItem;
});
}
use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.
the class CommonPropertyValueContextMenuItemConfiguration method copyValue.
@Bean
@Order(-20)
public PropertyValueContextMenuItem copyValue(UiTimelineManager timelineManager) {
return allPrimitiveEffectLineSupportingMenuIfRequired(request -> {
MenuItem copyKeyframeMenuItem = new MenuItem("Copy");
copyKeyframeMenuItem.setOnAction(e -> {
Object currentValue = ((PrimitiveEffectLine) (request.effectLine)).getCurrentValueSupplier().get();
Clipboard clipboard = Clipboard.getSystemClipboard();
ClipboardContent content = new ClipboardContent();
content.put(RAW_DATA_FORMAT, currentValue);
clipboard.setContent(content);
});
return copyKeyframeMenuItem;
});
}
Aggregations