|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jogamp.opengl.util.AnimatorBase com.jogamp.opengl.util.Animator
public class Animator
An Animator can be attached to one or more GLAutoDrawable
s to drive their display() methods in a loop.
The Animator class creates a background thread in which the
calls to display()
are performed. After each drawable
has been redrawn, a brief pause is performed to avoid swamping the
CPU, unless setRunAsFastAsPossible(boolean)
has been called.
The Animator execution thread does not run as a daemon thread,
so it is able to keep an application from terminating.
Call stop()
to terminate the animation and it's execution thread.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jogamp.opengl.util.AnimatorBase |
---|
AnimatorBase.AnimatorImpl |
Constructor Summary | |
---|---|
Animator()
|
|
Animator(GLAutoDrawable drawable)
Creates a new Animator for a particular drawable. |
|
Animator(ThreadGroup tg)
|
|
Animator(ThreadGroup tg,
GLAutoDrawable drawable)
Creates a new Animator for a particular drawable. |
Method Summary | |
---|---|
boolean |
isAnimating()
Indicates whether this animator is running and animating, the latter is true if it has GLAutoDrawable s to render and is not paused. |
boolean |
isPaused()
Indicates whether this animator is running and paused. |
boolean |
isStarted()
Indicates whether this animator is running, ie. |
boolean |
pause()
Pauses this animator. |
boolean |
resume()
Resumes animation if paused. |
void |
setRunAsFastAsPossible(boolean runFast)
Sets a flag in this Animator indicating that it is to run as fast as possible. |
boolean |
start()
Starts this animator, if not running. |
boolean |
stop()
Stops this animator. |
Methods inherited from class com.jogamp.opengl.util.AnimatorBase |
---|
add, getCurrentTime, getDuration, getStartTime, getThread, getTotalFrames, remove, resetCounter, setIgnoreExceptions, setPrintExceptions, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Animator()
public Animator(ThreadGroup tg)
public Animator(GLAutoDrawable drawable)
public Animator(ThreadGroup tg, GLAutoDrawable drawable)
Method Detail |
---|
public final void setRunAsFastAsPossible(boolean runFast)
public final boolean isStarted()
GLAnimatorControl
GLAnimatorControl.start()
,
GLAnimatorControl.stop()
,
GLAnimatorControl.pause()
,
GLAnimatorControl.resume()
public final boolean isAnimating()
GLAnimatorControl
GLAutoDrawable
s to render and is not paused.
GLAnimatorControl.start()
,
GLAnimatorControl.stop()
,
GLAnimatorControl.pause()
,
GLAnimatorControl.resume()
public final boolean isPaused()
GLAnimatorControl
GLAnimatorControl.start()
,
GLAnimatorControl.stop()
,
GLAnimatorControl.pause()
,
GLAnimatorControl.resume()
public boolean start()
GLAnimatorControl
In most situations this method blocks until completion, except when called from the animation thread itself or in some cases from an implementation-internal thread like the AWT event queue thread.
If started, all counters (time, frames, ..) are reset to zero.
GLAnimatorControl.stop()
,
GLAnimatorControl.isAnimating()
,
GLAnimatorControl.getThread()
public boolean stop()
GLAnimatorControl
In most situations this method blocks until completion, except when called from the animation thread itself or in some cases from an implementation-internal thread like the AWT event queue thread.
GLAnimatorControl.start()
,
GLAnimatorControl.isAnimating()
,
GLAnimatorControl.getThread()
public boolean pause()
GLAnimatorControl
In most situations this method blocks until completion, except when called from the animation thread itself or in some cases from an implementation-internal thread like the AWT event queue thread.
GLAnimatorControl.resume()
,
GLAnimatorControl.isAnimating()
public boolean resume()
GLAnimatorControl
In most situations this method blocks until completion, except when called from the animation thread itself or in some cases from an implementation-internal thread like the AWT event queue thread.
If resumed, all counters (time, frames, ..) are reset to zero.
GLAnimatorControl.pause()
,
GLAnimatorControl.isAnimating()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |