Search in sources :

Example 1 with Order

use of com.helospark.lightdi.annotation.Order 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;
    });
}
Also used : MenuItem(javafx.scene.control.MenuItem) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 2 with Order

use of com.helospark.lightdi.annotation.Order 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;
    });
}
Also used : MenuItem(javafx.scene.control.MenuItem) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 3 with Order

use of com.helospark.lightdi.annotation.Order 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;
    });
}
Also used : MenuItem(javafx.scene.control.MenuItem) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 4 with Order

use of com.helospark.lightdi.annotation.Order 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;
    });
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) MenuItem(javafx.scene.control.MenuItem) Clipboard(javafx.scene.input.Clipboard) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 5 with Order

use of com.helospark.lightdi.annotation.Order in project tactview by helospark.

the class DefaultEditMenuItemConfiguration method selectAllClipsContextMenuItem.

@Bean
@Order(1800)
public SelectableMenuContribution selectAllClipsContextMenuItem(SelectedNodeRepository selectedNodeRepository, TimelineManagerAccessor timelineManager) {
    KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("selectAllClips", new KeyCodeCombination(KeyCode.A, KeyCombination.CONTROL_DOWN), "Select all clips").getCombination();
    return new DefaultMenuContribution(List.of(EDIT_ROOT, SELECT_ROOT, "_All clips"), event -> {
        selectedNodeRepository.clearAllSelectedItems();
        selectedNodeRepository.addSelectedClips(timelineManager.getAllClipIds());
    }, combination);
}
Also used : DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Aggregations

Bean (com.helospark.lightdi.annotation.Bean)36 Order (com.helospark.lightdi.annotation.Order)36 DefaultMenuContribution (com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution)19 MenuItem (javafx.scene.control.MenuItem)17 KeyCodeCombination (javafx.scene.input.KeyCodeCombination)14 TimelinePosition (com.helospark.tactview.core.timeline.TimelinePosition)9 TimelineClip (com.helospark.tactview.core.timeline.TimelineClip)6 Configuration (com.helospark.lightdi.annotation.Configuration)4 ProjectRepository (com.helospark.tactview.core.repository.ProjectRepository)4 TimelineManagerAccessor (com.helospark.tactview.core.timeline.TimelineManagerAccessor)4 UiCommandInterpreterService (com.helospark.tactview.ui.javafx.UiCommandInterpreterService)4 CopyPasteRepository (com.helospark.tactview.ui.javafx.repository.CopyPasteRepository)4 SelectedNodeRepository (com.helospark.tactview.ui.javafx.repository.SelectedNodeRepository)4 List (java.util.List)4 Collectors (java.util.stream.Collectors)4 Qualifier (com.helospark.lightdi.annotation.Qualifier)3 EffectFactoryChain (com.helospark.tactview.core.timeline.EffectFactoryChain)3 VisualTimelineClip (com.helospark.tactview.core.timeline.VisualTimelineClip)3 EffectFactory (com.helospark.tactview.core.timeline.effect.EffectFactory)3 RemoveClipService (com.helospark.tactview.ui.javafx.RemoveClipService)3