Package com.reportmill.graphics
Class RMAnimator
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.graphics.RMAnimator
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- java.lang.Cloneable
 
 public class RMAnimator extends RMObject This class represents a timer for animation, holding things like a current time and max time.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceRMAnimator.ListenerAn interface for classes that want to receive notification of certain animator events.
 - 
Constructor SummaryConstructors Constructor Description RMAnimator()Creates a new animator.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateAgents()Tells animator owner's children's agents to activate.voidaddFreezeFrame()Adds a freeze frame for the animator's current time to the freeze-frame list.voidaddListener(java.lang.Object aListner)Adds an Listener to animator's listener list.voidaddNewborn(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).booleancanFreezeFrame()Returns whether the current time is not currently a key-frame.java.lang.Objectclone()Standard clone implementation.voidcopy(java.lang.Object anObj)Copies the attributes of the given object.booleanequals(java.lang.Object anObj)Standard equals implementation.voidframeBackward()This method tells the animator to move one frame backward (based on the frame rate).voidframeForward()This method tells the animator to move one frame forward (based on the frame rate).java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.booleangetAgentsEnabled()Returns whether agents are enabled (useful to disable when editing).floatgetFrameInterval()Returns the length of time for a single frame (1/frame-rate).floatgetFrameRate()Returns the frame rate for this animator.java.util.ListgetKeyFrames()Returns the list of key-frames present in animator owner's children.java.util.ListgetKeyFrames(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).booleangetLoops()Returns whether this animator loops when time hits max time.floatgetMaxTime()Returns the max time for this animator.RMShapegetOwner()Returns the owner of the animator.booleangetResetTimeOnStop()Returns whether the time is reset to start value when animator stops.java.lang.NumbergetScopedKeyFrame()Returns the key-frame time that new anim records should be made relative to.floatgetSecondsElapsed()Returns the number of seconds the animator has been playing for.floatgetStillFrame()java.lang.StringgetStillFramesString()Returns the frames that should be used when generating a non animated document (say in PDF).floatgetTime()Returns the current time of the animator.booleanisEmpty()Returns whether animator owner's children are devoid of any animation records.booleanisEnabled()Returns whether the animator owner's children should accept changes.booleanisNewborn(java.lang.Object anObj)Returns whether the given objects was created while at the current time.booleanisRunning()Returns whether the animator is currently in the act of playing.voidplay()Initiates a Swing timer to start automatically incrementing the animator's time (by frame rate increments).voidremoveFramesAtTime(float aTime)Removes records of the animator owner's children at a given time.voidremoveFramesBetweenTimes(float startTime, float endTime, boolean inclusive)Removes records of the animator owner's children in the given time range.voidremoveListener(java.lang.Object aListner)Remove an Listener from animator's listener list.voidscaleFrames(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.voidsetAgentsEnabled(boolean aValue)Sets whether agents are enabled (useful to disable when editing).voidsetEnabled(boolean aFlag)Sets whether the animator owner's children should accept changes.voidsetFrameRate(float aValue)Sets the frame rate for this animator.voidsetLoops(boolean aValue)Sets whether this animator loops when time hits max time.voidsetMaxTime(float maxTime)Sets the max time for this animator.voidsetOwner(RMShape anObject)Sets the owner of the animator.voidsetResetTimeOnStop(boolean aFlag)Sets whether the time is reset to start value when animator stops.voidsetScopedKeyFrame(java.lang.Number aValue)Sets the key-frame time that new anim records should be made from.voidsetStillFramesString(java.lang.String aString)voidsetTime(float aTime)Sets the current time of the animator (clamped to maxTime), tells owner to setTime as well.voidshiftFrames(float fromTime, float byTime)Shifts records of animator owner's children from the given from-time on, by the given by-time.voidstop()Disables the Swing timer to stop automatically incrementing the animator's time.java.lang.StringtoString()Returns a string description of the animator.RXElementtoXML(RXArchiver anArchiver)XML archival.voidwillChange()Called as a notification that the animator is about to change state (registers for undo).- 
Methods inherited from class com.reportmill.base.RMObjectdidChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
 
- 
 
- 
- 
- 
Method Detail- 
getOwnerpublic RMShape getOwner() Returns the owner of the animator.
 - 
setOwnerpublic void setOwner(RMShape anObject) Sets the owner of the animator.
 - 
getTimepublic float getTime() Returns the current time of the animator.
 - 
setTimepublic void setTime(float aTime) Sets the current time of the animator (clamped to maxTime), tells owner to setTime as well.
 - 
getMaxTimepublic float getMaxTime() Returns the max time for this animator.
 - 
setMaxTimepublic void setMaxTime(float maxTime) Sets the max time for this animator. May also call setTime() if animator's current time is beyond new max.
 - 
getFrameRatepublic float getFrameRate() Returns the frame rate for this animator.
 - 
setFrameRatepublic void setFrameRate(float aValue) Sets the frame rate for this animator.
 - 
getFrameIntervalpublic float getFrameInterval() Returns the length of time for a single frame (1/frame-rate).
 - 
getLoopspublic boolean getLoops() Returns whether this animator loops when time hits max time.
 - 
setLoopspublic void setLoops(boolean aValue) Sets whether this animator loops when time hits max time.
 - 
getResetTimeOnStoppublic boolean getResetTimeOnStop() Returns whether the time is reset to start value when animator stops.
 - 
setResetTimeOnStoppublic void setResetTimeOnStop(boolean aFlag) Sets whether the time is reset to start value when animator stops.
 - 
getKeyFramespublic java.util.List getKeyFrames() Returns the list of key-frames present in animator owner's children.
 - 
getKeyFramespublic 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).
 - 
canFreezeFramepublic boolean canFreezeFrame() Returns whether the current time is not currently a key-frame.
 - 
addFreezeFramepublic void addFreezeFrame() Adds a freeze frame for the animator's current time to the freeze-frame list.
 - 
getScopedKeyFramepublic java.lang.Number getScopedKeyFrame() Returns the key-frame time that new anim records should be made relative to.
 - 
setScopedKeyFramepublic void setScopedKeyFrame(java.lang.Number aValue) Sets the key-frame time that new anim records should be made from.
 - 
getStillFramesStringpublic java.lang.String getStillFramesString() Returns the frames that should be used when generating a non animated document (say in PDF).
 - 
setStillFramesStringpublic void setStillFramesString(java.lang.String aString) 
 - 
getStillFramepublic float getStillFrame() 
 - 
getAgentsEnabledpublic boolean getAgentsEnabled() Returns whether agents are enabled (useful to disable when editing).
 - 
setAgentsEnabledpublic void setAgentsEnabled(boolean aValue) Sets whether agents are enabled (useful to disable when editing).
 - 
activateAgentspublic void activateAgents() Tells animator owner's children's agents to activate.
 - 
playpublic void play() Initiates a Swing timer to start automatically incrementing the animator's time (by frame rate increments).
 - 
stoppublic void stop() Disables the Swing timer to stop automatically incrementing the animator's time.
 - 
frameForwardpublic void frameForward() This method tells the animator to move one frame forward (based on the frame rate).
 - 
frameBackwardpublic void frameBackward() This method tells the animator to move one frame backward (based on the frame rate).
 - 
isRunningpublic boolean isRunning() Returns whether the animator is currently in the act of playing.
 - 
getSecondsElapsedpublic float getSecondsElapsed() Returns the number of seconds the animator has been playing for.
 - 
shiftFramespublic void shiftFrames(float fromTime, float byTime)Shifts records of animator owner's children from the given from-time on, by the given by-time.
 - 
scaleFramespublic 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.
 - 
isEmptypublic boolean isEmpty() Returns whether animator owner's children are devoid of any animation records.
 - 
removeFramesAtTimepublic void removeFramesAtTime(float aTime) Removes records of the animator owner's children at a given time.
 - 
removeFramesBetweenTimespublic void removeFramesBetweenTimes(float startTime, float endTime, boolean inclusive)Removes records of the animator owner's children in the given time range.
 - 
isEnabledpublic boolean isEnabled() Returns whether the animator owner's children should accept changes.
 - 
setEnabledpublic void setEnabled(boolean aFlag) Sets whether the animator owner's children should accept changes. This can be used strategically to disable the Animator so that it does not receive certain events (like each of the discrete moves in a mouse drag loop). Should be followed by enable (they can be nested).
 - 
addListenerpublic void addListener(java.lang.Object aListner) Adds an Listener to animator's listener list.
 - 
removeListenerpublic void removeListener(java.lang.Object aListner) Remove an Listener from animator's listener list.
 - 
isNewbornpublic boolean isNewborn(java.lang.Object anObj) Returns whether the given objects was created while at the current time.
 - 
addNewbornpublic 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).
 - 
equalspublic boolean equals(java.lang.Object anObj) Standard equals implementation.- Overrides:
- equalsin class- java.lang.Object
 
 - 
clonepublic java.lang.Object clone() Standard clone implementation.
 - 
copypublic void copy(java.lang.Object anObj) Copies the attributes of the given object.
 - 
toXMLpublic RXElement toXML(RXArchiver anArchiver) XML archival.
 - 
fromXMLpublic java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.
 - 
willChangepublic void willChange() Called as a notification that the animator is about to change state (registers for undo).
 - 
toStringpublic java.lang.String toString() Returns a string description of the animator.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-