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;
}
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;
}
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);
}
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);
}
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);
}
Aggregations