public class RMAnimator extends RMObject
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()
Creates a new animator.
|
Modifier and Type | Method and Description |
---|---|
void |
activateAgents()
Tells animator owner's children's agents to activate.
|
void |
addFreezeFrame()
Adds a freeze frame for the animator's current time to the freeze-frame list.
|
void |
addListener(java.lang.Object aListner)
Adds an Listener to animator's listener 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.
|
java.lang.Object |
clone()
Standard clone implementation.
|
void |
copy(java.lang.Object anObj)
Copies the attributes of the given object.
|
boolean |
equals(java.lang.Object anObj)
Standard equals 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(RXArchiver anArchiver,
RXElement anElement)
XML unarchival.
|
boolean |
getAgentsEnabled()
Returns whether agents are enabled (useful to disable when editing).
|
float |
getFrameInterval()
Returns the length of time for a single frame (1/frame-rate).
|
float |
getFrameRate()
Returns the frame rate for this animator.
|
java.util.List |
getKeyFrames()
Returns the list of key-frames present in animator owner's children.
|
java.util.List |
getKeyFrames(java.util.List shapeList,
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.
|
float |
getMaxTime()
Returns the max time for this animator.
|
RMShape |
getOwner()
Returns the owner of the animator.
|
boolean |
getResetTimeOnStop()
Returns whether the time is reset to start value when animator stops.
|
java.lang.Number |
getScopedKeyFrame()
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.
|
float |
getStillFrame() |
java.lang.String |
getStillFramesString()
Returns the frames that should be used when generating a non animated document (say in PDF).
|
float |
getTime()
Returns the current time of the animator.
|
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 |
removeFramesAtTime(float aTime)
Removes records of the animator owner's children at a given time.
|
void |
removeFramesBetweenTimes(float startTime,
float endTime,
boolean inclusive)
Removes records of the animator owner's children in the given time range.
|
void |
removeListener(java.lang.Object aListner)
Remove an Listener from animator's listener list.
|
void |
scaleFrames(float start,
float length,
float newLength)
Scales records of the animator owner's children in the range from start to start + length to a given new length.
|
void |
setAgentsEnabled(boolean aValue)
Sets whether agents are enabled (useful to disable when editing).
|
void |
setEnabled(boolean aFlag)
Sets whether the animator owner's children should accept changes.
|
void |
setFrameRate(float aValue)
Sets the frame rate for this animator.
|
void |
setLoops(boolean aValue)
Sets whether this animator loops when time hits max time.
|
void |
setMaxTime(float maxTime)
Sets the max time for this animator.
|
void |
setOwner(RMShape anObject)
Sets the owner of the animator.
|
void |
setResetTimeOnStop(boolean aFlag)
Sets whether the time is reset to start value when animator stops.
|
void |
setScopedKeyFrame(java.lang.Number aValue)
Sets the key-frame time that new anim records should be made from.
|
void |
setStillFramesString(java.lang.String aString) |
void |
setTime(float aTime)
Sets the current time of the animator (clamped to maxTime), tells owner to setTime as well.
|
void |
shiftFrames(float fromTime,
float byTime)
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.
|
RXElement |
toXML(RXArchiver anArchiver)
XML archival.
|
void |
willChange()
Called as a notification that the animator is about to change state (registers for undo).
|
didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
public RMShape getOwner()
public void setOwner(RMShape anObject)
public float getTime()
public void setTime(float aTime)
public float getMaxTime()
public void setMaxTime(float maxTime)
public float getFrameRate()
public void setFrameRate(float aValue)
public float getFrameInterval()
public boolean getLoops()
public void setLoops(boolean aValue)
public boolean getResetTimeOnStop()
public void setResetTimeOnStop(boolean aFlag)
public java.util.List getKeyFrames()
public java.util.List getKeyFrames(java.util.List shapeList, boolean includeImplied)
public boolean canFreezeFrame()
public void addFreezeFrame()
public java.lang.Number getScopedKeyFrame()
public void setScopedKeyFrame(java.lang.Number aValue)
public java.lang.String getStillFramesString()
public void setStillFramesString(java.lang.String aString)
public float getStillFrame()
public boolean getAgentsEnabled()
public void setAgentsEnabled(boolean aValue)
public void activateAgents()
public void play()
public void stop()
public void frameForward()
public void frameBackward()
public boolean isRunning()
public float getSecondsElapsed()
public void shiftFrames(float fromTime, float byTime)
public void scaleFrames(float start, float length, float newLength)
public boolean isEmpty()
public void removeFramesAtTime(float aTime)
public void removeFramesBetweenTimes(float startTime, float endTime, boolean inclusive)
public boolean isEnabled()
public void setEnabled(boolean aFlag)
public void addListener(java.lang.Object aListner)
public void removeListener(java.lang.Object aListner)
public boolean isNewborn(java.lang.Object anObj)
public void addNewborn(java.lang.Object anObj)
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public java.lang.Object clone()
public void copy(java.lang.Object anObj)
public RXElement toXML(RXArchiver anArchiver)
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
public void willChange()
public java.lang.String toString()
toString
in class java.lang.Object