|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.opengl.util.AnimatorBase
com.jogamp.opengl.util.Animator
public class Animator
An Animator can be attached to one or more GLAutoDrawables 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 |
| Field Summary |
|---|
| Fields inherited from class com.jogamp.opengl.util.AnimatorBase |
|---|
MODE_EXPECT_AWT_RENDERING_THREAD |
| Fields inherited from interface javax.media.opengl.FPSCounter |
|---|
DEFAULT_FRAMES_PER_INTERVAL |
| Constructor Summary | |
|---|---|
Animator()
Creates a new, empty Animator. |
|
Animator(GLAutoDrawable drawable)
Creates a new Animator for a particular drawable. |
|
Animator(ThreadGroup tg)
Creates a new Animator w/ an associated ThreadGroup. |
|
Animator(ThreadGroup tg,
GLAutoDrawable drawable)
Creates a new Animator w/ an associated ThreadGroup for a particular drawable. |
|
| Method Summary | |
|---|---|
boolean |
isAnimating()
Indicates whether this animator is started and is not paused. |
boolean |
isPaused()
Indicates whether this animator is started
and either manually paused or paused
automatically due to no added GLAutoDrawables. |
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. |
void |
setThreadGroup(ThreadGroup tg)
Set a ThreadGroup for the animation thread. |
boolean |
start()
Starts this animator, if not running. |
boolean |
stop()
Stops this animator. |
| Methods inherited from class com.jogamp.opengl.util.AnimatorBase |
|---|
add, getExclusiveContextThread, getFPSStartTime, getLastFPS, getLastFPSPeriod, getLastFPSUpdateTime, getModeBits, getThread, getTotalFPS, getTotalFPSDuration, getTotalFPSFrames, getUpdateFPSFrames, isExclusiveContextEnabled, isStarted, remove, resetFPSCounter, setExclusiveContext, setExclusiveContext, setIgnoreExceptions, setModeBits, setPrintExceptions, setUpdateFPSFrames, 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 isAnimating()
GLAnimatorControlis started and is not paused.
GLAnimatorControl.start(),
GLAnimatorControl.stop(),
GLAnimatorControl.pause(),
GLAnimatorControl.resume()public final boolean isPaused()
GLAnimatorControlis started
and either manually paused or paused
automatically due to no added GLAutoDrawables.
GLAnimatorControl.start(),
GLAnimatorControl.stop(),
GLAnimatorControl.pause(),
GLAnimatorControl.resume()
public final void setThreadGroup(ThreadGroup tg)
throws GLException
ThreadGroup for the animation thread.
tg - the ThreadGroup
GLException - if the animator has already been startedpublic final boolean start()
GLAnimatorControlIn 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.
Note that an animator w/o added drawables
will be paused automatically.
If started, all counters (time, frames, ..) are reset to zero.
GLAnimatorControl.stop(),
GLAnimatorControl.isAnimating(),
GLAnimatorControl.isPaused(),
GLAnimatorControl.getThread()public final boolean stop()
GLAnimatorControlIn 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 final boolean pause()
GLAnimatorControlIn 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 final boolean resume()
GLAnimatorControlIn 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 | ||||||||