public abstract class AnimatorBase extends Object implements 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.
| Modifier and Type | Class and Description |
|---|---|
static interface |
AnimatorBase.AnimatorImpl |
DEFAULT_FRAMES_PER_INTERVAL| Constructor and Description |
|---|
AnimatorBase()
Creates a new, empty Animator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(GLAutoDrawable drawable) |
long |
getFPSStartTime()
Returns the time of the first display call in milliseconds after enabling this feature via
FPSCounter.setUpdateFPSFrames(int, PrintStream).This value is reset via FPSCounter.resetFPSCounter(). |
float |
getLastFPS() |
long |
getLastFPSPeriod() |
long |
getLastFPSUpdateTime()
Returns the time of the last update interval in milliseconds, if this feature is enabled via
FPSCounter.setUpdateFPSFrames(int, PrintStream).This value is reset via FPSCounter.resetFPSCounter(). |
Thread |
getThread() |
float |
getTotalFPS() |
long |
getTotalFPSDuration() |
int |
getTotalFPSFrames() |
int |
getUpdateFPSFrames() |
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 |
resetFPSCounter()
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. |
void |
setUpdateFPSFrames(int frames,
PrintStream out) |
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitisAnimating, isPaused, isStarted, pause, resume, start, stoppublic void add(GLAutoDrawable drawable)
public void remove(GLAutoDrawable drawable)
GLAnimatorControlremove in interface GLAnimatorControldrawable - the to be removed drawablepublic final void setUpdateFPSFrames(int frames,
PrintStream out)
setUpdateFPSFrames in interface FPSCounterframes - Update interval in frames.FPSCounter.DEFAULT_FRAMES_PER_INTERVAL.out - optional print stream where the fps values gets printed if not null at every frames intervalpublic final void resetFPSCounter()
FPSCounterresetFPSCounter in interface FPSCounterpublic final int getUpdateFPSFrames()
getUpdateFPSFrames in interface FPSCounterFPSCounter.setUpdateFPSFrames(int, PrintStream)public final long getFPSStartTime()
FPSCounterFPSCounter.setUpdateFPSFrames(int, PrintStream).FPSCounter.resetFPSCounter().getFPSStartTime in interface FPSCounterFPSCounter.setUpdateFPSFrames(int, PrintStream),
FPSCounter.resetFPSCounter()public final long getLastFPSUpdateTime()
FPSCounterFPSCounter.setUpdateFPSFrames(int, PrintStream).FPSCounter.resetFPSCounter().getLastFPSUpdateTime in interface FPSCounterFPSCounter.setUpdateFPSFrames(int, PrintStream),
FPSCounter.resetFPSCounter()public final long getLastFPSPeriod()
getLastFPSPeriod in interface FPSCounterFPSCounter.setUpdateFPSFrames(int, PrintStream),
FPSCounter.resetFPSCounter()public final float getLastFPS()
getLastFPS in interface FPSCounterFPSCounter.getUpdateFPSFrames() / FPSCounter.getLastFPSPeriod()FPSCounter.setUpdateFPSFrames(int, PrintStream),
FPSCounter.resetFPSCounter()public final int getTotalFPSFrames()
getTotalFPSFrames in interface FPSCounterFPSCounter.getFPSStartTime() up to FPSCounter.getLastFPSUpdateTime()FPSCounter.setUpdateFPSFrames(int, PrintStream),
FPSCounter.resetFPSCounter()public final long getTotalFPSDuration()
getTotalFPSDuration in interface FPSCounterFPSCounter.getLastFPSUpdateTime() - FPSCounter.getFPSStartTime()FPSCounter.setUpdateFPSFrames(int, PrintStream),
FPSCounter.resetFPSCounter()public final float getTotalFPS()
getTotalFPS in interface FPSCounterFPSCounter.getTotalFPSFrames() / FPSCounter.getTotalFPSDuration()FPSCounter.setUpdateFPSFrames(int, PrintStream),
FPSCounter.resetFPSCounter()public final Thread getThread()
getThread in interface GLAnimatorControlGLAnimatorControl.start(),
GLAnimatorControl.stop()public void setIgnoreExceptions(boolean ignoreExceptions)
public void setPrintExceptions(boolean printExceptions)
setIgnoreExceptions(boolean)), to print the
exceptions' stack traces for diagnostic information. Defaults to
false.Copyright 2010 JogAmp Community.