Search in sources :

Example 6 with Bean

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

the class TactViewCoreConfiguration method prettyPrintingObjectMapper.

@Bean
public ObjectMapper prettyPrintingObjectMapper() {
    ObjectMapper result = new ObjectMapper();
    result.enable(SerializationFeature.INDENT_OUTPUT);
    return result;
}
Also used : ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Bean(com.helospark.lightdi.annotation.Bean)

Example 7 with Bean

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

the class TactViewCoreConfiguration method getterIgnoringObjectMapper.

@Bean
public ObjectMapper getterIgnoringObjectMapper() {
    ObjectMapper regularObjectMapper = new ObjectMapper();
    regularObjectMapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE);
    regularObjectMapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
    return regularObjectMapper;
}
Also used : ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Bean(com.helospark.lightdi.annotation.Bean)

Example 8 with Bean

use of com.helospark.lightdi.annotation.Bean 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)

Example 9 with Bean

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

the class DefaultEditMenuItemConfiguration method selectClipsToRightContextMenuItem.

@Bean
@Order(1802)
public SelectableMenuContribution selectClipsToRightContextMenuItem(SelectedNodeRepository selectedNodeRepository, TimelineManagerAccessor timelineManager, TimelineState state) {
    return new DefaultMenuContribution(List.of(EDIT_ROOT, SELECT_ROOT, "Clips to _right"), event -> {
        TimelinePosition playbackPosition = state.getPlaybackPosition();
        selectedNodeRepository.clearAllSelectedItems();
        List<String> clipsIds = new ArrayList<>();
        for (var channel : timelineManager.getChannels()) {
            for (var clip : channel.getAllClips()) {
                if (!clip.getInterval().getEndPosition().isLessThan(playbackPosition)) {
                    clipsIds.add(clip.getId());
                }
            }
        }
        selectedNodeRepository.clearAllSelectedItems();
        selectedNodeRepository.addSelectedClips(clipsIds);
    });
}
Also used : DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) ArrayList(java.util.ArrayList) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 10 with Bean

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

the class DefaultEditMenuItemConfiguration method cutSelectedAtCurrent.

@Bean
@Order(1911)
public SelectableMenuContribution cutSelectedAtCurrent(AlertDialogFactory dialogFactory, TimelineState timelineState, UiCutHandler uiCutHandler) {
    String title = "Set selected endpoint";
    KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("cutSelectedAtCursor", new KeyCodeCombination(KeyCode.O, KeyCodeCombination.CONTROL_DOWN), title).getCombination();
    return new DefaultMenuContribution(List.of(EDIT_ROOT, CUT_MENU_ITEM, title), event -> {
        uiCutHandler.cutSelectedUntilCursor(false);
    }, 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)43 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)13 TimelineClip (com.helospark.tactview.core.timeline.TimelineClip)6 Configuration (com.helospark.lightdi.annotation.Configuration)5 ProjectRepository (com.helospark.tactview.core.repository.ProjectRepository)4 TimelineManagerAccessor (com.helospark.tactview.core.timeline.TimelineManagerAccessor)4 VisualTimelineClip (com.helospark.tactview.core.timeline.VisualTimelineClip)4 EffectFactory (com.helospark.tactview.core.timeline.effect.EffectFactory)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 KeyframeSupportingDoubleInterpolator (com.helospark.tactview.core.timeline.effect.interpolation.interpolator.KeyframeSupportingDoubleInterpolator)3