|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.opengl.util.AnimatorBase
public abstract class AnimatorBase
Base implementation of GLAnimatorControl
The change synchronization is done via synchronized blocks on the AnimatorBase instance.
Status get / set activity is synced with a RecursiveLock, used as a memory barrier.
This is suitable, since all change requests are allowed to be expensive
as they are not expected to be called at every frame.
Nested Class Summary | |
---|---|
static interface |
AnimatorBase.AnimatorImpl
|
Field Summary | |
---|---|
protected Thread |
animThread
|
protected String |
baseName
|
protected long |
curTime
|
protected static boolean |
DEBUG
|
protected ArrayList |
drawables
|
protected boolean |
drawablesEmpty
|
protected boolean |
ignoreExceptions
|
protected AnimatorBase.AnimatorImpl |
impl
|
protected boolean |
printExceptions
|
protected long |
startTime
|
protected RecursiveLock |
stateSync
|
protected int |
totalFrames
|
Constructor Summary | |
---|---|
AnimatorBase()
Creates a new, empty Animator. |
Method Summary | |
---|---|
void |
add(GLAutoDrawable drawable)
|
protected void |
display()
Called every frame to cause redrawing of all of the GLAutoDrawables this Animator manages. |
protected abstract String |
getBaseName(String prefix)
|
long |
getCurrentTime()
|
long |
getDuration()
|
long |
getStartTime()
|
Thread |
getThread()
|
int |
getTotalFrames()
|
void |
remove(GLAutoDrawable drawable)
Removes a drawable from the animator's list of rendering drawables. This method should get called in case a drawable becomes invalid, and will not be recovered. This allows the animator thread to become idle in case the last drawable has reached it's end of life. |
void |
resetCounter()
Reset all performance counter (startTime, currentTime, frame number) |
void |
setIgnoreExceptions(boolean ignoreExceptions)
Sets a flag causing this Animator to ignore exceptions produced while redrawing the drawables. |
void |
setPrintExceptions(boolean printExceptions)
Sets a flag indicating that when exceptions are being ignored by this Animator (see setIgnoreExceptions(boolean) ), to print the
exceptions' stack traces for diagnostic information. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.media.opengl.GLAnimatorControl |
---|
isAnimating, isPaused, isStarted, pause, resume, start, stop |
Field Detail |
---|
protected static final boolean DEBUG
protected ArrayList drawables
protected boolean drawablesEmpty
protected AnimatorBase.AnimatorImpl impl
protected String baseName
protected Thread animThread
protected boolean ignoreExceptions
protected boolean printExceptions
protected long startTime
protected long curTime
protected int totalFrames
protected RecursiveLock stateSync
Constructor Detail |
---|
public AnimatorBase()
Method Detail |
---|
protected abstract String getBaseName(String prefix)
public void add(GLAutoDrawable drawable)
public void remove(GLAutoDrawable drawable)
GLAnimatorControl
remove
in interface GLAnimatorControl
drawable
- the to be removed drawableprotected void display()
public long getCurrentTime()
getCurrentTime
in interface GLAnimatorControl
GLAnimatorControl.start()
,
GLAnimatorControl.resume()
public long getDuration()
getDuration
in interface GLAnimatorControl
getCurrentTime() - getStartTime()
.GLAnimatorControl.getStartTime()
,
GLAnimatorControl.getCurrentTime()
public long getStartTime()
getStartTime
in interface GLAnimatorControl
GLAnimatorControl.start()
,
GLAnimatorControl.resume()
public int getTotalFrames()
getTotalFrames
in interface GLAnimatorControl
getStartTime()
.
This value is reset if started or resumed.GLAnimatorControl.start()
,
GLAnimatorControl.resume()
public final Thread getThread()
getThread
in interface GLAnimatorControl
GLAnimatorControl.start()
,
GLAnimatorControl.stop()
public void resetCounter()
GLAnimatorControl
resetCounter
in interface GLAnimatorControl
public void setIgnoreExceptions(boolean ignoreExceptions)
public void setPrintExceptions(boolean printExceptions)
setIgnoreExceptions(boolean)
), to print the
exceptions' stack traces for diagnostic information. Defaults to
false.
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |