Search in sources :

Example 1 with UiTimelineManager

use of com.helospark.tactview.ui.javafx.UiTimelineManager in project tactview by helospark.

the class DefaultEditMenuItemConfiguration method selectClipsUnderPlayheadMenuItem.

@Bean
@Order(1803)
public SelectableMenuContribution selectClipsUnderPlayheadMenuItem(SelectedNodeRepository selectedNodeRepository, TimelineManagerAccessor timelineManager, UiTimelineManager uiTimelineManager) {
    return new DefaultMenuContribution(List.of(EDIT_ROOT, SELECT_ROOT, "Clips under playhead"), event -> {
        TimelinePosition position = uiTimelineManager.getCurrentPosition();
        List<String> newSelectedClips = timelineManager.getAllClipIds().stream().flatMap(a -> timelineManager.findClipById(a).stream()).filter(a -> a.getInterval().intersects(TimelineInterval.ofPoint(position))).map(a -> a.getId()).collect(Collectors.toList());
        selectedNodeRepository.addSelectedClips(newSelectedClips);
    });
}
Also used : SubtimelineSelectWindowOpener(com.helospark.tactview.ui.javafx.menu.defaultmenus.subtimeline.SubtimelineSelectWindowOpener) AlertDialogFactory(com.helospark.tactview.ui.javafx.stylesheet.AlertDialogFactory) Scene(javafx.scene.Scene) UiCommandInterpreterService(com.helospark.tactview.ui.javafx.UiCommandInterpreterService) DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) InpointMarker(com.helospark.tactview.core.timeline.marker.markers.InpointMarker) ExposedDescriptorDescriptor(com.helospark.tactview.core.timeline.subtimeline.ExposedDescriptorDescriptor) GeneralMarker(com.helospark.tactview.core.timeline.marker.markers.GeneralMarker) TimelineClip(com.helospark.tactview.core.timeline.TimelineClip) ArrayList(java.util.ArrayList) Configuration(com.helospark.lightdi.annotation.Configuration) KeyCombination(javafx.scene.input.KeyCombination) Order(com.helospark.lightdi.annotation.Order) SeparatorMenuContribution(com.helospark.tactview.ui.javafx.menu.SeparatorMenuContribution) BigDecimal(java.math.BigDecimal) UiCutHandler(com.helospark.tactview.ui.javafx.uicomponents.UiCutHandler) CurrentlyPressedKeyRepository(com.helospark.tactview.ui.javafx.key.CurrentlyPressedKeyRepository) CopyPasteRepository(com.helospark.tactview.ui.javafx.repository.CopyPasteRepository) Bean(com.helospark.lightdi.annotation.Bean) SelectableMenuContribution(com.helospark.tactview.ui.javafx.menu.SelectableMenuContribution) UiTimelineManager(com.helospark.tactview.ui.javafx.UiTimelineManager) OutpointMarker(com.helospark.tactview.core.timeline.marker.markers.OutpointMarker) HotKeyRepository(com.helospark.tactview.ui.javafx.hotkey.HotKeyRepository) KeyCode(javafx.scene.input.KeyCode) SelectedNodeRepository(com.helospark.tactview.ui.javafx.repository.SelectedNodeRepository) SubtimelineFromTimelineFactory(com.helospark.tactview.core.timeline.subtimeline.SubtimelineFromTimelineFactory) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) TimelineState(com.helospark.tactview.ui.javafx.uicomponents.TimelineState) Set(java.util.Set) PreferencesPage(com.helospark.tactview.ui.javafx.preferences.PreferencesPage) Collectors(java.util.stream.Collectors) ReplaceTimelineWithSubtimelineCommand(com.helospark.tactview.ui.javafx.commands.impl.ReplaceTimelineWithSubtimelineCommand) TimelineInterval(com.helospark.tactview.core.timeline.TimelineInterval) UiLoadHandler(com.helospark.tactview.ui.javafx.save.UiLoadHandler) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) List(java.util.List) LinkClipRepository(com.helospark.tactview.core.timeline.LinkClipRepository) ScenePostProcessor(com.helospark.tactview.ui.javafx.scenepostprocessor.ScenePostProcessor) HotKeyRemapWindow(com.helospark.tactview.ui.javafx.hotkey.HotKeyRemapWindow) StylesheetAdderService(com.helospark.tactview.ui.javafx.stylesheet.StylesheetAdderService) TimelineManagerAccessor(com.helospark.tactview.core.timeline.TimelineManagerAccessor) Optional(java.util.Optional) ProjectRepository(com.helospark.tactview.core.repository.ProjectRepository) RestartDialogOpener(com.helospark.tactview.ui.javafx.plugin.RestartDialogOpener) MarkerRepository(com.helospark.tactview.core.timeline.marker.MarkerRepository) DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Aggregations

Bean (com.helospark.lightdi.annotation.Bean)1 Configuration (com.helospark.lightdi.annotation.Configuration)1 Order (com.helospark.lightdi.annotation.Order)1 ProjectRepository (com.helospark.tactview.core.repository.ProjectRepository)1 LinkClipRepository (com.helospark.tactview.core.timeline.LinkClipRepository)1 TimelineClip (com.helospark.tactview.core.timeline.TimelineClip)1 TimelineInterval (com.helospark.tactview.core.timeline.TimelineInterval)1 TimelineManagerAccessor (com.helospark.tactview.core.timeline.TimelineManagerAccessor)1 TimelinePosition (com.helospark.tactview.core.timeline.TimelinePosition)1 MarkerRepository (com.helospark.tactview.core.timeline.marker.MarkerRepository)1 GeneralMarker (com.helospark.tactview.core.timeline.marker.markers.GeneralMarker)1 InpointMarker (com.helospark.tactview.core.timeline.marker.markers.InpointMarker)1 OutpointMarker (com.helospark.tactview.core.timeline.marker.markers.OutpointMarker)1 ExposedDescriptorDescriptor (com.helospark.tactview.core.timeline.subtimeline.ExposedDescriptorDescriptor)1 SubtimelineFromTimelineFactory (com.helospark.tactview.core.timeline.subtimeline.SubtimelineFromTimelineFactory)1 UiCommandInterpreterService (com.helospark.tactview.ui.javafx.UiCommandInterpreterService)1 UiTimelineManager (com.helospark.tactview.ui.javafx.UiTimelineManager)1 ReplaceTimelineWithSubtimelineCommand (com.helospark.tactview.ui.javafx.commands.impl.ReplaceTimelineWithSubtimelineCommand)1 HotKeyRemapWindow (com.helospark.tactview.ui.javafx.hotkey.HotKeyRemapWindow)1 HotKeyRepository (com.helospark.tactview.ui.javafx.hotkey.HotKeyRepository)1