use of com.helospark.lightdi.annotation.Qualifier in project tactview by helospark.
the class StandardClipContextMenuChainItemConfiguration method scaleToFrameMenuItem.
@Bean
@Order(0)
public ClipContextMenuChainItem scaleToFrameMenuItem(UiCommandInterpreterService commandInterpreter, TimelineManagerAccessor timelineManager, ProjectRepository projectRepository, @Qualifier("scaleEffect") EffectFactory scaleFactory, EffectFactoryChain effectFactoryChain, SelectedNodeRepository selectedNodeRepository) {
return typeSupportingContextMenuItem(VisualTimelineClip.class, request -> {
MenuItem scaleToImageMenuItem = new MenuItem("Scale to frame");
scaleToImageMenuItem.setOnAction(e -> {
List<AddScaleCommand> commands = request.getAllClips().stream().map(a -> a.getId()).map(clipId -> AddScaleCommand.builder().withClipId(clipId).withProjectRepository(projectRepository).withScaleEffectFactory(scaleFactory).withTimelineManager(timelineManager).withEffectFactoryChain(effectFactoryChain).build()).collect(Collectors.toList());
if (commands.size() > 0) {
commandInterpreter.sendWithResult(new CompositeCommand(commands));
}
});
return scaleToImageMenuItem;
});
}
Aggregations