use of com.helospark.tactview.core.timeline.proceduralclip.ProceduralClipFactoryChainItem in project tactview by helospark.
the class ProceduralClipFactory method createClip.
@Override
public TimelineClip createClip(AddClipRequest request) {
ProceduralClipFactoryChainItem proceduralFactory = factories.stream().filter(factory -> factory.doesSupport(request)).findFirst().orElseThrow(() -> new IllegalArgumentException("Nothing can handle " + request));
ProceduralVisualClip proceduralTimelineClip = proceduralFactory.create(request);
proceduralTimelineClip.setProceduralFactoryId(proceduralFactory.getId());
proceduralTimelineClip.setCreatorFactoryId(getId());
return proceduralTimelineClip;
}
use of com.helospark.tactview.core.timeline.proceduralclip.ProceduralClipFactoryChainItem in project tactview by helospark.
the class ProceduralClipFactory method restoreClip.
@Override
public TimelineClip restoreClip(JsonNode savedClip, LoadMetadata metadata) {
String proceduralFactoryId = savedClip.get("proceduralFactoryId").asText();
ProceduralClipFactoryChainItem proceduralFactory = factories.stream().filter(factory -> factory.getProceduralClipId().equals(proceduralFactoryId)).findFirst().orElseThrow(() -> new IllegalArgumentException("Nothing can handle " + proceduralFactoryId));
ProceduralVisualClip result = proceduralFactory.restoreClip(savedClip, metadata);
result.setProceduralFactoryId(proceduralFactoryId);
return result;
}
Aggregations