use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class StandardEffectContextMenuChainItemConfiguration method moveDownItem.
@Bean
@Order(91)
public EffectContextMenuChainItem moveDownItem(UiCommandInterpreterService commandInterpreter, TimelineManagerAccessor timelineManager) {
return alwaysSupportedContextMenuItem(request -> {
MenuItem moveDownClip = new MenuItem("Move down");
int index = timelineManager.findEffectChannel(request.getEffect().getId());
int numberOfEffectChannels = timelineManager.getNumberOfEffectChannels(request.getEffect().getId()) - 1;
System.out.println("Down index: " + index + " " + numberOfEffectChannels);
if (index >= numberOfEffectChannels) {
moveDownClip.setDisable(true);
} else {
moveDownClip.setOnAction(e -> commandInterpreter.sendWithResult(new MoveEffectToChannelCommand(timelineManager, request.getEffect().getId(), index + 1)));
}
return moveDownClip;
});
}
use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class StandardEffectContextMenuChainItemConfiguration method maximizeMenuItem.
@Bean
@Order(120)
public EffectContextMenuChainItem maximizeMenuItem(ExtendsClipToMaximizeLengthService extendsClipToMaximizeLengthService, TimelineManagerAccessor timelineManager) {
return alwaysSupportedContextMenuItem(request -> {
MenuItem maximizeClipMenuItem = new MenuItem("Maximize");
timelineManager.findClipForEffect(request.getEffect().getId()).ifPresent(clip -> {
maximizeClipMenuItem.setOnAction(e -> extendsClipToMaximizeLengthService.extendEffectToClipSize(clip.getId(), request.getEffect()));
});
return maximizeClipMenuItem;
});
}
use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class StandardEffectContextMenuChainItemConfiguration method copyMenuItem.
@Bean
@Order(100)
public EffectContextMenuChainItem copyMenuItem(CopyPasteRepository copyPasteRepository) {
return alwaysSupportedContextMenuItem(request -> {
MenuItem copyClip = new MenuItem("Copy");
copyClip.setOnAction(e -> copyPasteRepository.copyEffect(request.getEffect().getId()));
return copyClip;
});
}
use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class DefaultEditMenuItemConfiguration method addChapterMenuItem.
@Bean
@Order(1950)
public SelectableMenuContribution addChapterMenuItem(AlertDialogFactory dialogFactory, TimelineState timelineState, MarkerRepository chapterRepository) {
KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("addChapter", new KeyCodeCombination(KeyCode.P, KeyCodeCombination.CONTROL_DOWN), "Add chapter").getCombination();
return new DefaultMenuContribution(List.of(EDIT_ROOT, CHAPTER_ROOT, "Add chapter at current position"), event -> {
TimelinePosition position = timelineState.getPlaybackPosition();
Optional<String> result = dialogFactory.showTextInputDialog("Add chapter", "Label of the chapter", "Chapter x");
if (result.isPresent()) {
chapterRepository.addChapter(position, result.get());
}
}, combination);
}
use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class DefaultEditMenuItemConfiguration method cutAllAtCurrentPositionMenuItem.
@Bean
@Order(1910)
public SelectableMenuContribution cutAllAtCurrentPositionMenuItem(AlertDialogFactory dialogFactory, TimelineState timelineState, UiCutHandler uiCutHandler) {
String title = "Cut at current position";
KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("cutAllAtCurrentPosition", new KeyCodeCombination(KeyCode.K, KeyCodeCombination.CONTROL_DOWN), title).getCombination();
return new DefaultMenuContribution(List.of(EDIT_ROOT, CUT_MENU_ITEM, title), event -> {
uiCutHandler.cutAllAtCurrentPosition();
}, combination);
}
Aggregations