Class 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 Detail

      • RMTimeline

        public RMTimeline()
        Creates a new timeline.
      • RMTimeline

        public RMTimeline​(java.lang.Object anOwner)
        Creates a new timeline with owner.
    • 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 interface java.beans.PropertyChangeListener
      • 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.
      • toString

        public java.lang.String toString()
        Standard toString implementation.
        toString in class RMObject