Class Animator
java.lang.Object
java.lang.Thread
jmt.jmch.animation.Animator
- All Implemented Interfaces:
Runnable
Animator of JMCH: the thread that drives the animation of the scheduling and routing algorithms.
-
Nested Class Summary
Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AnimationTheAnimationimplementing class that has to be updated to show the animation.Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisPaused()To know if the animator is pausedvoidpause()Pause the animation, save also the time at which the animation was pausedvoidrestart()Restart the animation, update also the components of animation to let them know the animation was paused for a certain period of timevoidrun()Performs update of the handled animation as far as terminate() method has not been called.voidstart()Starts the handled animation, otherwise if the Animator is paused it restarts the animationvoidTerminates current animationMethods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, stop, threadId, toString, yield
-
Field Details
-
animation
-
-
Constructor Details
-
Animator
Creates a new instance of Animator. Frame rate is set by default at 30 frames per seconds.- Parameters:
a- : Animation to be updated by this animator.
-
Animator
Creates a new instance of Animator with explicit definition of framerate.- Parameters:
fps- : framerate for this animation.a- : Animation to be updated by this animator.
-
-
Method Details
-
start
-
pause
public void pause()Pause the animation, save also the time at which the animation was paused -
restart
public void restart()Restart the animation, update also the components of animation to let them know the animation was paused for a certain period of time -
run
-
terminate
public void terminate()Terminates current animation -
isPaused
public boolean isPaused()To know if the animator is paused
-