Search in sources :

Example 1 with StatelessEffect

use of com.helospark.tactview.core.timeline.StatelessEffect in project tactview by helospark.

the class StandardEffectFactory method createEffect.

@Override
public StatelessEffect createEffect(CreateEffectRequest request) {
    StatelessEffect result = factory.apply(request);
    // hack to avoid having to pass everything via constructor for common code in parent
    context.getAutowireSupportUtil().autowireFieldsTo(result);
    result.initializeValueProvider();
    return result;
}
Also used : StatelessEffect(com.helospark.tactview.core.timeline.StatelessEffect)

Example 2 with StatelessEffect

use of com.helospark.tactview.core.timeline.StatelessEffect in project tactview by helospark.

the class StandardEffectFactory method restoreEffect.

@Override
public StatelessEffect restoreEffect(JsonNode node, LoadMetadata loadMetadata) {
    StatelessEffect result = restoreFactory.apply(node, loadMetadata);
    // hack to avoid having to pass everything via constructor for common code in parent
    context.getAutowireSupportUtil().autowireFieldsTo(result);
    result.initializeValueProvider();
    ReflectionUtil.realoadSavedFields(node.get("savedFields"), result, loadMetadata);
    return result;
}
Also used : StatelessEffect(com.helospark.tactview.core.timeline.StatelessEffect)

Example 3 with StatelessEffect

use of com.helospark.tactview.core.timeline.StatelessEffect in project tactview by helospark.

the class EffectResizedCommand method revert.

@Override
public void revert() {
    StatelessEffect effect = timelineManager.findEffectById(effectId).orElseThrow(() -> new IllegalArgumentException("No effect found"));
    TimelinePosition previousPosition = originalPosition;
    ResizeEffectRequest request = ResizeEffectRequest.builder().withEffect(effect).withLeft(left).withGlobalPosition(previousPosition).withUseSpecialPoints(false).withAllowResizeToDisplaceOtherEffects(allowResizeToDisplaceOtherEffects).build();
    timelineManager.resizeEffect(request);
}
Also used : StatelessEffect(com.helospark.tactview.core.timeline.StatelessEffect) ResizeEffectRequest(com.helospark.tactview.core.timeline.ResizeEffectRequest) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition)

Example 4 with StatelessEffect

use of com.helospark.tactview.core.timeline.StatelessEffect in project tactview by helospark.

the class EffectResizedCommand method execute.

@Override
public void execute() {
    StatelessEffect effect = timelineManager.findEffectById(effectId).orElseThrow(() -> new IllegalArgumentException("No effect found"));
    ResizeEffectRequest request = ResizeEffectRequest.builder().withEffect(effect).withLeft(left).withGlobalPosition(globalPosition).withUseSpecialPoints(useSpecialPoints).withMoreResizeExpected(moreResizeExpected).withMaximumJumpLength(maximumJumpLength).withMinimumLength(minimumLength).withAllowResizeToDisplaceOtherEffects(allowResizeToDisplaceOtherEffects).build();
    timelineManager.resizeEffect(request);
}
Also used : StatelessEffect(com.helospark.tactview.core.timeline.StatelessEffect) ResizeEffectRequest(com.helospark.tactview.core.timeline.ResizeEffectRequest)

Example 5 with StatelessEffect

use of com.helospark.tactview.core.timeline.StatelessEffect in project tactview by helospark.

the class CopyPasteRepository method copyEffect.

public void copyEffect(List<String> selectedEffects) {
    if (selectedEffects.size() == 0) {
        return;
    }
    List<EffectCopyPasteDomainElement> elements = selectedEffects.stream().map(a -> {
        TimelineClip clip = timelineManager.findClipForEffect(a).orElse(null);
        StatelessEffect effect = clip.getEffect(a).orElse(null);
        return new EffectCopyPasteDomainElement(clip, effect);
    }).collect(Collectors.toList());
    clipboardContent = new EffectCopyPasteDomain(elements);
}
Also used : Component(com.helospark.lightdi.annotation.Component) AddExistingClipRequest(com.helospark.tactview.core.timeline.AddExistingClipRequest) UiCommandInterpreterService(com.helospark.tactview.ui.javafx.UiCommandInterpreterService) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) EffectCopyPasteDomainElement(com.helospark.tactview.ui.javafx.repository.copypaste.EffectCopyPasteDomain.EffectCopyPasteDomainElement) CompositeCommand(com.helospark.tactview.ui.javafx.commands.impl.CompositeCommand) AddExistingEffectCommand(com.helospark.tactview.ui.javafx.commands.impl.AddExistingEffectCommand) Collectors(java.util.stream.Collectors) TimelineClip(com.helospark.tactview.core.timeline.TimelineClip) EffectCopyPasteDomain(com.helospark.tactview.ui.javafx.repository.copypaste.EffectCopyPasteDomain) ArrayList(java.util.ArrayList) List(java.util.List) CloneRequestMetadata(com.helospark.tactview.core.clone.CloneRequestMetadata) AddExistingEffectRequest(com.helospark.tactview.core.timeline.AddExistingEffectRequest) TimelineChannel(com.helospark.tactview.core.timeline.TimelineChannel) TimelineManagerAccessor(com.helospark.tactview.core.timeline.TimelineManagerAccessor) AddExistingClipsCommand(com.helospark.tactview.ui.javafx.commands.impl.AddExistingClipsCommand) ClipCopyPasteDomain(com.helospark.tactview.ui.javafx.repository.copypaste.ClipCopyPasteDomain) StatelessEffect(com.helospark.tactview.core.timeline.StatelessEffect) Optional(java.util.Optional) EffectCopyPasteDomain(com.helospark.tactview.ui.javafx.repository.copypaste.EffectCopyPasteDomain) StatelessEffect(com.helospark.tactview.core.timeline.StatelessEffect) EffectCopyPasteDomainElement(com.helospark.tactview.ui.javafx.repository.copypaste.EffectCopyPasteDomain.EffectCopyPasteDomainElement) TimelineClip(com.helospark.tactview.core.timeline.TimelineClip)

Aggregations

StatelessEffect (com.helospark.tactview.core.timeline.StatelessEffect)16 TimelineClip (com.helospark.tactview.core.timeline.TimelineClip)6 Component (com.helospark.lightdi.annotation.Component)4 TimelinePosition (com.helospark.tactview.core.timeline.TimelinePosition)4 List (java.util.List)4 TimelineManagerAccessor (com.helospark.tactview.core.timeline.TimelineManagerAccessor)3 Collectors (java.util.stream.Collectors)3 LightDiContext (com.helospark.lightdi.LightDiContext)2 FakeUi (com.helospark.tactview.core.it.util.ui.FakeUi)2 ResizeEffectRequest (com.helospark.tactview.core.timeline.ResizeEffectRequest)2 StatelessVideoEffect (com.helospark.tactview.core.timeline.StatelessVideoEffect)2 TimelineChannel (com.helospark.tactview.core.timeline.TimelineChannel)2 VisualTimelineClip (com.helospark.tactview.core.timeline.VisualTimelineClip)2 CreateEffectRequest (com.helospark.tactview.core.timeline.effect.CreateEffectRequest)2 EffectFactory (com.helospark.tactview.core.timeline.effect.EffectFactory)2 ReadOnlyClipImage (com.helospark.tactview.core.timeline.image.ReadOnlyClipImage)2 EffectCopyPasteDomain (com.helospark.tactview.ui.javafx.repository.copypaste.EffectCopyPasteDomain)2 TimelineUiCacheElement (com.helospark.tactview.ui.javafx.uicomponents.canvasdraw.domain.TimelineUiCacheElement)2 ArrayList (java.util.ArrayList)2 ContextMenu (javafx.scene.control.ContextMenu)2