Class RMTimeline

All Implemented Interfaces:
RMPropertyChanger, PropertyChangeListener, Cloneable, EventListener

public class RMTimeline extends RMObject implements PropertyChangeListener
An animation object that holds a list of key frames.
  • Constructor Details

    • RMTimeline

      public RMTimeline()
      Creates a new timeline.
    • RMTimeline

      public RMTimeline(Object anOwner)
      Creates a new timeline with owner.
  • Method Details

    • getOwner

      public Object getOwner()
      Returns the timeline owner.
    • setOwner

      public void setOwner(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 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(Object aTarget, String aKey)
      Returns a key value list for a given target and value.
    • getKeyValueList

      public RMKeyValueList getKeyValueList(Object aTarget, 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(Object aTarget, String aKey, Object aValue, int aTime)
      Adds a new key frame key value for
    • addKeyFrameKeyValue

      public RMKeyValue addKeyFrameKeyValue(Object aTarget, String aKey, Object aValue, int aTime, Object anOldValue, int anOldTime)
      Adds a new key frame key value for
    • removeKeyFrameKeyValues

      public void removeKeyFrameKeyValues(Object aTarget, 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(PropertyChangeEvent anEvent)
      Implement to catch key value changes and forward to this key frame's property change listeners.
      Specified by:
      propertyChange in interface PropertyChangeListener
    • clone

      public RMTimeline clone()
      Standard clone implementation.
      Overrides:
      clone in class RMListenerList
    • clone

      public RMTimeline clone(Object aTarget)
      Standard clone implementation.
    • toXML

      public void toXML(RXArchiver anArchiver, RXElement anElement)
      XML archival (for shape).
    • fromXML

      public void fromXML(Object aTarget, RXArchiver anArchiver, RXElement anElement)
      XML unarchival for anim and shape.
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class RMObject