Class RMTimeline
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.rm.graphics.RMTimeline
-
- All Implemented Interfaces:
RMPropertyChanger
,java.beans.PropertyChangeListener
,java.lang.Cloneable
,java.util.EventListener
public class RMTimeline extends RMObject implements java.beans.PropertyChangeListener
An animation object that holds a list of key frames.
-
-
Constructor Summary
Constructors Constructor Description RMTimeline()
Creates a new timeline.RMTimeline(java.lang.Object anOwner)
Creates a new timeline with owner.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKeyFrame(RMKeyFrame aKeyFrame)
Adds a given key frame.void
addKeyFrame(RMKeyFrame aKeyFrame, int anIndex)
Adds a given key frame at given index.protected void
addKeyFrameKeyValue(RMKeyFrame aKeyFrame, RMKeyValue aKeyValue)
Adds a key frame key value, so that a key value list entry is created.RMKeyValue
addKeyFrameKeyValue(java.lang.Object aTarget, java.lang.String aKey, java.lang.Object aValue, int aTime)
Adds a new key frame key value forRMKeyValue
addKeyFrameKeyValue(java.lang.Object aTarget, java.lang.String aKey, java.lang.Object aValue, int aTime, java.lang.Object anOldValue, int anOldTime)
Adds a new key frame key value forRMTimeline
clone()
Standard clone implementation.RMTimeline
clone(java.lang.Object aTarget)
Standard clone implementation.void
fromXML(java.lang.Object aTarget, RXArchiver anArchiver, RXElement anElement)
XML unarchival for anim and shape.int
getIndex(RMKeyFrame aKeyFrame)
Return index for given key frame.RMKeyFrame
getKeyFrame(int anIndex)
Returns an individual key frame at given index.RMKeyFrame
getKeyFrameAt(int aTime)
Returns the key frame at the given time.RMKeyFrame
getKeyFrameAt(int aTime, boolean doCreate)
Returns the key frame at the given time, with an option to create it if missing.int
getKeyFrameCount()
Returns the number of key frames.java.util.List<RMKeyFrame>
getKeyFrames()
Returns the list of key frames.RMKeyValueList
getKeyValueList(java.lang.Object aTarget, java.lang.String aKey)
Returns a key value list for a given target and value.RMKeyValueList
getKeyValueList(java.lang.Object aTarget, java.lang.String aKey, boolean doCreate)
Returns a key value list for a given target and value, with an option to create if missing.java.lang.Object
getOwner()
Returns the timeline owner.int
getTime()
Returns the current time of the timeline (in milliseconds).boolean
isEmpty()
Returns whether timeline is empty.void
propertyChange(java.beans.PropertyChangeEvent anEvent)
Implement to catch key value changes and forward to this key frame's property change listeners.RMKeyFrame
removeKeyFrame(int anIndex)
Removes a keyframe at given index.int
removeKeyFrame(RMKeyFrame aKeyFrame)
Removes the given key frame.protected void
removeKeyFrameKeyValue(RMKeyFrame aKeyFrame, RMKeyValue aKeyValue)
Removes a key frame key value, so that a key value list entry is removed.void
removeKeyFrameKeyValues(java.lang.Object aTarget, java.lang.String aKey, int aStartTime, int anEndTime, boolean isInclusive)
Removes key frame key values for target and key between two times (with option to include those times).void
scaleRecords(int aStartTime, float aFactor)
This method scales all records from a given start time through a length to a new length.void
setOwner(java.lang.Object anOwner)
Sets the timeline owner.void
setTime(int aTime)
Sets the current time of the timeline (in milliseconds).void
shiftRecords(int fromTime, int byTime)
This method shifts key frame values at or beyond a given time by the given amount.java.lang.String
toString()
Standard toString implementation.void
toXML(RXArchiver anArchiver, RXElement anElement)
XML archival (for shape).-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Method Detail
-
getOwner
public java.lang.Object getOwner()
Returns the timeline owner.
-
setOwner
public void setOwner(java.lang.Object anOwner)
Sets the timeline owner.
-
isEmpty
public boolean isEmpty()
Returns whether timeline is empty.
-
getKeyFrameCount
public int getKeyFrameCount()
Returns the number of key frames.
-
getKeyFrame
public RMKeyFrame getKeyFrame(int anIndex)
Returns an individual key frame at given index.
-
getKeyFrames
public java.util.List<RMKeyFrame> getKeyFrames()
Returns the list of key frames.
-
addKeyFrame
public void addKeyFrame(RMKeyFrame aKeyFrame)
Adds a given key frame.
-
addKeyFrame
public void addKeyFrame(RMKeyFrame aKeyFrame, int anIndex)
Adds a given key frame at given index. This should be protected - but undo system current needs it public.
-
removeKeyFrame
public RMKeyFrame removeKeyFrame(int anIndex)
Removes a keyframe at given index.
-
removeKeyFrame
public int removeKeyFrame(RMKeyFrame aKeyFrame)
Removes the given key frame.
-
getIndex
public int getIndex(RMKeyFrame aKeyFrame)
Return index for given key frame.
-
getKeyFrameAt
public RMKeyFrame getKeyFrameAt(int aTime)
Returns the key frame at the given time.
-
getKeyFrameAt
public RMKeyFrame getKeyFrameAt(int aTime, boolean doCreate)
Returns the key frame at the given time, with an option to create it if missing.
-
getKeyValueList
public RMKeyValueList getKeyValueList(java.lang.Object aTarget, java.lang.String aKey)
Returns a key value list for a given target and value.
-
getKeyValueList
public RMKeyValueList getKeyValueList(java.lang.Object aTarget, java.lang.String aKey, boolean doCreate)
Returns a key value list for a given target and value, with an option to create if missing.
-
getTime
public int getTime()
Returns the current time of the timeline (in milliseconds).
-
setTime
public void setTime(int aTime)
Sets the current time of the timeline (in milliseconds).
-
addKeyFrameKeyValue
protected void addKeyFrameKeyValue(RMKeyFrame aKeyFrame, RMKeyValue aKeyValue)
Adds a key frame key value, so that a key value list entry is created.
-
removeKeyFrameKeyValue
protected void removeKeyFrameKeyValue(RMKeyFrame aKeyFrame, RMKeyValue aKeyValue)
Removes a key frame key value, so that a key value list entry is removed.
-
addKeyFrameKeyValue
public RMKeyValue addKeyFrameKeyValue(java.lang.Object aTarget, java.lang.String aKey, java.lang.Object aValue, int aTime)
Adds a new key frame key value for
-
addKeyFrameKeyValue
public RMKeyValue addKeyFrameKeyValue(java.lang.Object aTarget, java.lang.String aKey, java.lang.Object aValue, int aTime, java.lang.Object anOldValue, int anOldTime)
Adds a new key frame key value for
-
removeKeyFrameKeyValues
public void removeKeyFrameKeyValues(java.lang.Object aTarget, java.lang.String aKey, int aStartTime, int anEndTime, boolean isInclusive)
Removes key frame key values for target and key between two times (with option to include those times).
-
shiftRecords
public void shiftRecords(int fromTime, int byTime)
This method shifts key frame values at or beyond a given time by the given amount.
-
scaleRecords
public void scaleRecords(int aStartTime, float aFactor)
This method scales all records from a given start time through a length to a new length.
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
Implement to catch key value changes and forward to this key frame's property change listeners.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
clone
public RMTimeline clone()
Standard clone implementation.- Overrides:
clone
in classRMListenerList
-
clone
public RMTimeline clone(java.lang.Object aTarget)
Standard clone implementation.
-
toXML
public void toXML(RXArchiver anArchiver, RXElement anElement)
XML archival (for shape).
-
fromXML
public void fromXML(java.lang.Object aTarget, RXArchiver anArchiver, RXElement anElement)
XML unarchival for anim and shape.
-
-