Class RMShapeAnim

  • All Implemented Interfaces:
    RMArchiver.Archiving, java.lang.Cloneable

    public class RMShapeAnim
    extends RMObject
    This class holds animation record information for an RMShape.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  RMShapeAnim.Record
      An inner class to represent a time/value snapshot for an attribute.
      class  RMShapeAnim.RecordList
      An inner class to represent a List of Records for a given attribute.
    • Constructor Summary

      Constructors 
      Constructor Description
      RMShapeAnim​(RMShape aShape)
      Creates a new anim object for the given shape.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAgent​(RMAnimAgent anAgent)
      Adds an agent to the agent list.
      void addRecord​(java.lang.String anAttr, float aValue)
      Adds a record for an attribute/float-value pair.
      void addRecord​(java.lang.String anAttr, float aTime, java.lang.Object aValue)
      Adds a record for an attribute/value pair at a given time.
      void addRecord​(java.lang.String anAttr, java.lang.Object aValue)
      Adds a record for an attribute/value pair.
      java.lang.Object clone()
      Standard clone implementation.
      boolean equals​(java.lang.Object anObj)
      Standard equals implementation.
      RMAnimAgent getAgent​(int anIndex)
      Returns the specific agent at the given index.
      int getAgentCount()
      Returns the number of agents for this shape.
      java.util.List getAgents()
      Returns the list of agents.
      java.util.List getAttributesAtTime​(float aTime)
      Returns a List of attribute strings for any attribute that has a Record for the given time.
      static java.lang.String getMethod​(java.lang.String aName)  
      RMShapeAnim.RecordList getRecordList​(int anIndex)
      Returns the specific record list at the given index.
      RMShapeAnim.RecordList getRecordList​(java.lang.String anAttr)
      Returns the anim RecordList for a given named attribute (or null if none exists yet).
      RMShapeAnim.RecordList getRecordList​(java.lang.String anAttr, boolean create)
      Returns the anim RecordList for a given named attribute, with an option to create one if it doesn't exist yet.
      int getRecordListCount()
      Returns the number of record lists for the shape.
      RMShape getShape()
      Returns the shape this anim works for.
      boolean isEmpty()
      Returns whether this shape doesn't have any real animation.
      void loadKeyFrames​(java.util.List aList)
      Loads the given list with all unique anim Record times (list is ordered by time and avoids duplicates).
      void removeRecordsAtTime​(float aTime)
      Removes any records at a given time.
      void removeRecordsBetweenTimes​(float startTime, float endTime, boolean inclusive)
      Removes any records between the given two times (not inclusive).
      void scaleRecords​(float start, float length, float newLength)
      Scales records starting at a given start type over a given length to a new length.
      void setShape​(RMShape aShape)
      Sets the shape this anim works for.
      void setTime​(float aTime)
      Resets shape attributes from anim record values for given time.
      void shiftRecords​(float fromTime, float byTime)
      Shifts records starting at a given start time by a given amount of time.
      • Methods inherited from class java.lang.Object

        finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RMShapeAnim

        public RMShapeAnim​(RMShape aShape)
        Creates a new anim object for the given shape.
    • Method Detail

      • getShape

        public RMShape getShape()
        Returns the shape this anim works for.
      • setShape

        public void setShape​(RMShape aShape)
        Sets the shape this anim works for.
      • getRecordListCount

        public int getRecordListCount()
        Returns the number of record lists for the shape.
      • getRecordList

        public RMShapeAnim.RecordList getRecordList​(int anIndex)
        Returns the specific record list at the given index.
      • getRecordList

        public RMShapeAnim.RecordList getRecordList​(java.lang.String anAttr)
        Returns the anim RecordList for a given named attribute (or null if none exists yet).
      • getRecordList

        public RMShapeAnim.RecordList getRecordList​(java.lang.String anAttr,
                                                    boolean create)
        Returns the anim RecordList for a given named attribute, with an option to create one if it doesn't exist yet.
      • isEmpty

        public boolean isEmpty()
        Returns whether this shape doesn't have any real animation.
      • addRecord

        public void addRecord​(java.lang.String anAttr,
                              float aValue)
        Adds a record for an attribute/float-value pair.
      • addRecord

        public void addRecord​(java.lang.String anAttr,
                              java.lang.Object aValue)
        Adds a record for an attribute/value pair.
      • addRecord

        public void addRecord​(java.lang.String anAttr,
                              float aTime,
                              java.lang.Object aValue)
        Adds a record for an attribute/value pair at a given time.
      • removeRecordsAtTime

        public void removeRecordsAtTime​(float aTime)
        Removes any records at a given time.
      • removeRecordsBetweenTimes

        public void removeRecordsBetweenTimes​(float startTime,
                                              float endTime,
                                              boolean inclusive)
        Removes any records between the given two times (not inclusive).
      • shiftRecords

        public void shiftRecords​(float fromTime,
                                 float byTime)
        Shifts records starting at a given start time by a given amount of time.
      • scaleRecords

        public void scaleRecords​(float start,
                                 float length,
                                 float newLength)
        Scales records starting at a given start type over a given length to a new length.
      • setTime

        public void setTime​(float aTime)
        Resets shape attributes from anim record values for given time.
      • loadKeyFrames

        public void loadKeyFrames​(java.util.List aList)
        Loads the given list with all unique anim Record times (list is ordered by time and avoids duplicates).
      • getAttributesAtTime

        public java.util.List getAttributesAtTime​(float aTime)
        Returns a List of attribute strings for any attribute that has a Record for the given time.
      • getAgentCount

        public int getAgentCount()
        Returns the number of agents for this shape.
      • getAgent

        public RMAnimAgent getAgent​(int anIndex)
        Returns the specific agent at the given index.
      • getAgents

        public java.util.List getAgents()
        Returns the list of agents.
      • addAgent

        public void addAgent​(RMAnimAgent anAgent)
        Adds an agent to the agent list.
      • equals

        public boolean equals​(java.lang.Object anObj)
        Standard equals implementation.
        Overrides:
        equals in class java.lang.Object
      • clone

        public java.lang.Object clone()
        Standard clone implementation.
        Overrides:
        clone in class RMObject
      • getMethod

        public static java.lang.String getMethod​(java.lang.String aName)