mirror of
https://github.com/aNNiMON/HotaruFX.git
synced 2024-09-19 14:14:21 +03:00
Remove keyframe duplication check
This commit is contained in:
parent
a34a23372b
commit
0f67442d0a
@ -1,10 +0,0 @@
|
|||||||
package com.annimon.hotarufx.exceptions;
|
|
||||||
|
|
||||||
import com.annimon.hotarufx.visual.KeyFrame;
|
|
||||||
|
|
||||||
public class KeyFrameDuplicationException extends RuntimeException {
|
|
||||||
|
|
||||||
public KeyFrameDuplicationException(KeyFrame keyFrame) {
|
|
||||||
super("Key frame " + keyFrame.getFrame() + " already exists in timeline");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +1,9 @@
|
|||||||
package com.annimon.hotarufx.visual;
|
package com.annimon.hotarufx.visual;
|
||||||
|
|
||||||
import com.annimon.hotarufx.exceptions.KeyFrameDuplicationException;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import javafx.beans.value.WritableValue;
|
import javafx.beans.value.WritableValue;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public class PropertyTimeline<T> {
|
public class PropertyTimeline<T> {
|
||||||
@ -19,10 +17,7 @@ public class PropertyTimeline<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PropertyTimeline<T> add(KeyFrame keyFrame, T value) {
|
public PropertyTimeline<T> add(KeyFrame keyFrame, T value) {
|
||||||
val previous = keyFrames.put(keyFrame, value);
|
keyFrames.put(keyFrame, value);
|
||||||
if (previous != null) {
|
|
||||||
throw new KeyFrameDuplicationException(keyFrame);
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user