Class RMAnimator
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.graphics.RMAnimator
- All Implemented Interfaces:
- Archivable,- RMPropertyChanger,- Cloneable
This class represents a timer for animation, holding things like a current time and max time.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface for classes that want to receive notification of certain animator events.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAnimatorListener(RMAnimator.Listener aListener) Adds an animator listener.voidAdds a freeze frame for the animator's current time to the freeze-frame list.voidaddNewborn(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).booleanReturns whether the current time is not currently a key-frame.clone()Standard clone implementation.voidThis method tells the animator to move one frame backward (based on the frame rate).voidThis method tells the animator to move one frame forward (based on the frame rate).fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.Returns the action to be performed at the end of animation.floatReturns the frame rate for this animator.intReturns the update interval of the animator in milliseconds.Returns the list of key-frames present in animator owner's children.getKeyFrameTimes(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).booleangetLoops()Returns whether this animator loops when time hits max time.intReturns the max time for this animator.floatReturns the animator max time in seconds.getOwner()Returns the owner of the animator.intReturns the play start time.booleanReturns whether the time is reset to start value when animator stops.intReturns the key-frame time that new anim records should be made relative to.floatReturns the number of seconds the animator has been playing for.intgetTime()Returns the current time of the animator.floatReturns the animator time in seconds.booleanisEmpty()Returns whether animator owner's children are devoid of any animation records.booleanReturns whether the animator owner's children should accept changes.booleanReturns whether the given objects was created while at the current time.booleanReturns 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).voidremoveAnimatorListener(RMAnimator.Listener aListener) Removes an animator listener.voidremoveFramesAtTime(int aTime) Removes records of the animator owner's children at a given time.voidremoveFramesBetweenTimes(int startTime, int endTime, boolean inclusive) Removes records of the animator owner's children in the given time range.protected voidresetShapeTimeline(RMShape aShape) Resets a shape's timeline.voidscaleFrames(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.voidsetEnabled(boolean aFlag) Sets whether the animator owner's children should accept changes.voidsetEndAction(String anAction) Sets the action to be performed at the end of animation.voidsetFrameRate(float aValue) Sets the frame rate for this animator.voidsetInterval(int anInterval) Sets the update interval of the animator in milliseconds.voidsetLoops(boolean aValue) Sets whether this animator loops when time hits max time.voidsetMaxTime(int aMaxTime) Sets the max time for this animator.voidsetMaxTimeSeconds(float aTime) Sets the max time in seconds.voidsetOwner(RMParentShape anObj) Sets the owner of the animator.voidsetResetTimeOnStop(boolean aFlag) Sets whether the time is reset to start value when animator stops.voidsetScopeTime(Integer aValue) Sets the key-frame time that new anim records should be made from.voidsetTime(int aTime) Sets the current time of the animator (clamped to maxTime), tells owner to setTime as well.voidsetTimeSeconds(float aTime) Sets the time in seconds.voidshiftFrames(int fromTime, int aShiftTime) 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.toString()Returns a string description of the animator.toXML(RXArchiver anArchiver) XML archival.Methods inherited from class com.inductiveautomation.rm.base.RMObjectaddPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChangeMethods inherited from class com.inductiveautomation.rm.base.RMListenerListaddListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
- 
Constructor Details- 
RMAnimatorpublic RMAnimator()
 
- 
- 
Method Details- 
getOwnerReturns the owner of the animator.
- 
setOwnerSets the owner of the animator.
- 
getTimepublic int getTime()Returns the current time of the animator.
- 
setTimepublic void setTime(int aTime) Sets the current time of the animator (clamped to maxTime), tells owner to setTime as well.
- 
getMaxTimepublic int getMaxTime()Returns the max time for this animator.
- 
setMaxTimepublic void setMaxTime(int aMaxTime) Sets the max time for this animator. May also call setTime() if animator's current time is beyond new max.
- 
getTimeSecondspublic float getTimeSeconds()Returns the animator time in seconds.
- 
setTimeSecondspublic void setTimeSeconds(float aTime) Sets the time in seconds.
- 
getMaxTimeSecondspublic float getMaxTimeSeconds()Returns the animator max time in seconds.
- 
setMaxTimeSecondspublic void setMaxTimeSeconds(float aTime) Sets the max time in seconds.
- 
getIntervalpublic int getInterval()Returns the update interval of the animator in milliseconds.
- 
setIntervalpublic void setInterval(int anInterval) Sets the update interval of the animator in milliseconds.
- 
getFrameRatepublic float getFrameRate()Returns the frame rate for this animator.
- 
setFrameRatepublic void setFrameRate(float aValue) Sets the frame rate for this animator.
- 
getEndActionReturns the action to be performed at the end of animation. For example: Loop, Loop:5, Loop:5,3, Page:Next, Page:Last, etc.
- 
setEndActionSets the action to be performed at the end of animation.
- 
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.
- 
getKeyFrameTimesReturns the list of key-frames present in animator owner's children.
- 
getKeyFrameTimesReturns 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.
- 
getScopeTimepublic int getScopeTime()Returns the key-frame time that new anim records should be made relative to.
- 
setScopeTimeSets the key-frame time that new anim records should be made from.
- 
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.
- 
getPlayStartTimepublic int getPlayStartTime()Returns the play start time.
- 
addAnimatorListenerAdds an animator listener.
- 
removeAnimatorListenerRemoves an animator listener.
- 
shiftFramespublic void shiftFrames(int fromTime, int aShiftTime) Shifts records of animator owner's children from the given from-time on, by the given by-time.
- 
scaleFramespublic 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.
- 
isEmptypublic boolean isEmpty()Returns whether animator owner's children are devoid of any animation records.
- 
removeFramesAtTimepublic void removeFramesAtTime(int aTime) Removes records of the animator owner's children at a given time.
- 
removeFramesBetweenTimespublic void removeFramesBetweenTimes(int startTime, int endTime, boolean inclusive) Removes records of the animator owner's children in the given time range.
- 
resetShapeTimelineResets a shape's timeline.
- 
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).
- 
isNewbornReturns whether the given objects was created while at the current time.
- 
addNewbornDeclare 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).
- 
cloneStandard clone implementation.- Overrides:
- clonein class- RMListenerList
 
- 
toXMLXML archival.- Specified by:
- toXMLin interface- Archivable
 
- 
fromXMLXML unarchival.- Specified by:
- fromXMLin interface- Archivable
 
- 
toStringReturns a string description of the animator.
 
-