public class RMAnimator
extends SnapObject
Modifier and Type | Class and Description |
---|---|
static interface |
RMAnimator.Listener
An interface for classes that want to receive notification of certain animator events.
|
Constructor and Description |
---|
RMAnimator() |
Modifier and Type | Method and Description |
---|---|
void |
addAnimatorListener(RMAnimator.Listener aListener)
Adds an animator listener.
|
void |
addFreezeFrame()
Adds a freeze frame for the animator's current time to the freeze-frame list.
|
void |
addNewborn(java.lang.Object anObj)
Declare newBorn shapes so that if they are added at non-zero time, we won't get bogus initial values
(after an explicit time change, they will start to accept changes).
|
boolean |
canFreezeFrame()
Returns whether the current time is not currently a key-frame.
|
RMAnimator |
clone()
Standard clone implementation.
|
void |
frameBackward()
This method tells the animator to move one frame backward (based on the frame rate).
|
void |
frameForward()
This method tells the animator to move one frame forward (based on the frame rate).
|
java.lang.Object |
fromXML(XMLArchiver anArchiver,
XMLElement anElement)
XML unarchival.
|
java.lang.String |
getEndAction()
Returns the action to be performed at the end of animation.
|
float |
getFrameRate()
Returns the frame rate for this animator.
|
int |
getInterval()
Returns the update interval of the animator in milliseconds.
|
java.util.List<java.lang.Integer> |
getKeyFrameTimes()
Returns the list of key-frames present in animator owner's children.
|
java.util.List<java.lang.Integer> |
getKeyFrameTimes(java.util.List<RMShape> theShapes,
boolean includeImplied)
Returns the list of key-frames present in the given list of shapes (assumed to be animator owner's descendants).
|
boolean |
getLoops()
Returns whether this animator loops when time hits max time.
|
int |
getMaxTime()
Returns the max time for this animator.
|
float |
getMaxTimeSeconds()
Returns the animator max time in seconds.
|
RMParentShape |
getOwner()
Returns the owner of the animator.
|
int |
getPlayStartTime()
Returns the play start time.
|
boolean |
getResetTimeOnStop()
Returns whether the time is reset to start value when animator stops.
|
int |
getScopeTime()
Returns the key-frame time that new anim records should be made relative to.
|
float |
getSecondsElapsed()
Returns the number of seconds the animator has been playing for.
|
int |
getTime()
Returns the current time of the animator.
|
float |
getTimeSeconds()
Returns the animator time in seconds.
|
boolean |
isEmpty()
Returns whether animator owner's children are devoid of any animation records.
|
boolean |
isEnabled()
Returns whether the animator owner's children should accept changes.
|
boolean |
isNewborn(java.lang.Object anObj)
Returns whether the given objects was created while at the current time.
|
boolean |
isRunning()
Returns whether the animator is currently in the act of playing.
|
void |
play()
Initiates a Swing timer to start automatically incrementing the animator's time (by frame rate increments).
|
void |
removeAnimatorListener(RMAnimator.Listener aListener)
Removes an animator listener.
|
void |
removeFramesAtTime(int aTime)
Removes records of the animator owner's children at a given time.
|
void |
removeFramesBetweenTimes(int startTime,
int endTime,
boolean inclusive)
Removes records of the animator owner's children in the given time range.
|
void |
scaleFrames(int aStartTime,
int newMaxTime)
Scales records of the animator owner's children in the range from start to start + length to a given new length.
|
void |
setEnabled(boolean aFlag)
Sets whether the animator owner's children should accept changes.
|
void |
setEndAction(java.lang.String anAction)
Sets the action to be performed at the end of animation.
|
void |
setFrameRate(float aValue)
Sets the frame rate for this animator.
|
void |
setInterval(int anInterval)
Sets the update interval of the animator in milliseconds.
|
void |
setLoops(boolean aValue)
Sets whether this animator loops when time hits max time.
|
void |
setMaxTime(int aMaxTime)
Sets the max time for this animator.
|
void |
setMaxTimeSeconds(float aTime)
Sets the max time in seconds.
|
void |
setOwner(RMParentShape anObj)
Sets the owner of the animator.
|
void |
setResetTimeOnStop(boolean aFlag)
Sets whether the time is reset to start value when animator stops.
|
void |
setScopeTime(java.lang.Integer aValue)
Sets the key-frame time that new anim records should be made from.
|
void |
setTime(int aTime)
Sets the current time of the animator (clamped to maxTime), tells owner to setTime as well.
|
void |
setTimeSeconds(float aTime)
Sets the time in seconds.
|
void |
shiftFrames(int fromTime,
int aShiftTime)
Shifts records of animator owner's children from the given from-time on, by the given by-time.
|
void |
stop()
Disables the Swing timer to stop automatically incrementing the animator's time.
|
java.lang.String |
toString()
Returns a string description of the animator.
|
XMLElement |
toXML(XMLArchiver anArchiver)
XML archival.
|
public RMParentShape getOwner()
public void setOwner(RMParentShape anObj)
public int getTime()
public void setTime(int aTime)
public int getMaxTime()
public void setMaxTime(int aMaxTime)
public float getTimeSeconds()
public void setTimeSeconds(float aTime)
public float getMaxTimeSeconds()
public void setMaxTimeSeconds(float aTime)
public int getInterval()
public void setInterval(int anInterval)
public float getFrameRate()
public void setFrameRate(float aValue)
public java.lang.String getEndAction()
public void setEndAction(java.lang.String anAction)
public boolean getLoops()
public void setLoops(boolean aValue)
public boolean getResetTimeOnStop()
public void setResetTimeOnStop(boolean aFlag)
public java.util.List<java.lang.Integer> getKeyFrameTimes()
public java.util.List<java.lang.Integer> getKeyFrameTimes(java.util.List<RMShape> theShapes, boolean includeImplied)
public boolean canFreezeFrame()
public void addFreezeFrame()
public int getScopeTime()
public void setScopeTime(java.lang.Integer aValue)
public void play()
public void stop()
public void frameForward()
public void frameBackward()
public boolean isRunning()
public float getSecondsElapsed()
public int getPlayStartTime()
public void addAnimatorListener(RMAnimator.Listener aListener)
public void removeAnimatorListener(RMAnimator.Listener aListener)
public void shiftFrames(int fromTime, int aShiftTime)
public void scaleFrames(int aStartTime, int newMaxTime)
public boolean isEmpty()
public void removeFramesAtTime(int aTime)
public void removeFramesBetweenTimes(int startTime, int endTime, boolean inclusive)
public boolean isEnabled()
public void setEnabled(boolean aFlag)
public boolean isNewborn(java.lang.Object anObj)
public void addNewborn(java.lang.Object anObj)
public RMAnimator clone()
public XMLElement toXML(XMLArchiver anArchiver)
public java.lang.Object fromXML(XMLArchiver anArchiver, XMLElement anElement)
public java.lang.String toString()