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 |
|---|---|
| public static interface | |
| protected static interface | |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| protected Thread | |
| private static final Class | |
| protected String | |
| protected static final boolean | |
| protected ArrayList | |
| protected boolean | |
| protected boolean | |
| protected FPSCounterImpl | |
| protected boolean | |
| protected AnimatorBase. | |
| public static final int | MODE_EXPECT_AWT_RENDERING_THREAD
If present in |
| protected int | |
| protected static final long | |
| protected boolean | |
| private static int | |
| protected static final long | TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION
A 1s timeout while waiting for a native action response, limiting |
| protected GLAnimatorControl. | |
| protected Thread | |
| private final AnimatorBase. |
| Access | Constructor and Description |
|---|---|
| public | AnimatorBase()
Creates a new, empty Animator instance while expecting an AWT rendering thread if AWT is available. |
| Modifier and Type | Method and Description |
|---|---|
| public final synchronized void | add(final GLAutoDrawable
the drawable to be added drawable)Implements com. |
| protected final void | |
| protected final synchronized boolean | finishLifecycleAction(final AnimatorBase.
method will wait until TO is reached or waitCondition,waitCondition. returns false.if pollPeriod)0, method will wait until TO is reached or being notified.
if > 0, method will wait for the given pollPeriod in milliseconds.
|
| protected final void | flushGLRunnables()
Should be called in case of an uncaught exception from within the animator thread to flush all animator. |
| protected abstract String | |
| public final synchronized Thread | getExclusiveContextThread()
Returns the exclusive context thread if |
| public final long | getFPSStartTime()
Implements com. setUpdateFPSFrames(int, PrintStream).
|
| public final float | |
| public final long | |
| public final long | getLastFPSUpdateTime()
Implements com. setUpdateFPSFrames(int, PrintStream).
|
| public synchronized int | |
| public final synchronized Thread | |
| protected static String | |
| public final float | |
| public final long | |
| public final int | |
| public final GLAnimatorControl. | getUncaughtExceptionHandler()
Implements com. UncaughtExceptionHandler invoked when this animator abruptly stops
due to an uncaught exception from one of its GLAutoDrawables.
|
| public final int | |
| protected final synchronized boolean | Returns: true if handled, otherwise false. In case of false,
caller needs to propagate the exception.Should be called in case of an uncaught exception from within the animator thread, throws given exception if no handler has been installed. |
| protected final synchronized void | initImpl(final boolean force)
Initializes implementation details post setup,
invoked at |
| public final synchronized boolean | isExclusiveContextEnabled()
Returns |
| public synchronized boolean | isStarted()
Implements com. started.
|
| public final synchronized void | remove(final GLAutoDrawable
the drawable to be removed drawable)Implements com. |
| public final void | resetFPSCounter()
Implements com. |
| protected final synchronized void | setDrawablesExclCtxState(final boolean enable)
Should be called at |
| public final synchronized Thread | Returns: previous valueDedicate all |
| public final boolean | Returns: previous valueDedicate all |
| public final void | setIgnoreExceptions(final boolean ignoreExceptions)
Sets a flag causing this Animator to ignore exceptions produced while redrawing the drawables. |
| public final synchronized void | setModeBits(final boolean enable, final int bitValues)
Enables or disables the given |
| public final void | setPrintExceptions(final boolean printExceptions)
Sets a flag indicating that when exceptions are being ignored by
this Animator (see |
| public final void | setUncaughtExceptionHandler(final GLAnimatorControl.
the handlerUncaughtExceptionHandler to use as this animator's uncaught exception
handler. Pass null to unset the handler.Implements com. animator abruptly stops
due to an uncaught exception from one of its GLAutoDrawables.
|
| public final void | setUpdateFPSFrames(final int
Update interval in frames. frames, final PrintStream At every rendered frames interval the currentTime and fps values are updated. If the frames interval is <= 0, no update will be issued, ie the FPSCounter feature is turned off. You may choose DEFAULT_FRAMES_PER_INTERVAL.optional print stream where the fps values gets printed if not null at every frames interval out)Implements com. |
| public String | |
| private static final boolean | |
| protected final boolean |
| animThread | back to summary |
|---|---|
| protected Thread animThread | |
| awtAnimatorImplClazz | back to summary |
|---|---|
| private static final Class<?> awtAnimatorImplClazz | |
| baseName | back to summary |
|---|---|
| protected String baseName | |
| DEBUG | back to summary |
|---|---|
| protected static final boolean DEBUG | |
| drawables | back to summary |
|---|---|
| protected ArrayList<GLAutoDrawable> drawables | |
| drawablesEmpty | back to summary |
|---|---|
| protected boolean drawablesEmpty | |
| exclusiveContext | back to summary |
|---|---|
| protected boolean exclusiveContext | |
| fpsCounter | back to summary |
|---|---|
| protected FPSCounterImpl fpsCounter | |
| ignoreExceptions | back to summary |
|---|---|
| protected boolean ignoreExceptions | |
| impl | back to summary |
|---|---|
| protected AnimatorBase. | |
| MODE_EXPECT_AWT_RENDERING_THREAD | back to summary |
|---|---|
| public static final int MODE_EXPECT_AWT_RENDERING_THREAD If present in This is the default.
| |
| modeBits | back to summary |
|---|---|
| protected int modeBits | |
| POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION | back to summary |
|---|---|
| protected static final long POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION | |
| printExceptions | back to summary |
|---|---|
| protected boolean printExceptions | |
| seqInstanceNumber | back to summary |
|---|---|
| private static int seqInstanceNumber | |
| TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION | back to summary |
|---|---|
| protected static final long TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION A 1s timeout while waiting for a native action response, limiting | |
| uncaughtExceptionHandler | back to summary |
|---|---|
| protected GLAnimatorControl. | |
| userExclusiveContextThread | back to summary |
|---|---|
| protected Thread userExclusiveContextThread | |
| waitForNotAnimatingIfEmptyCondition | back to summary |
|---|---|
| private final AnimatorBase. | |
| AnimatorBase | back to summary |
|---|---|
| public AnimatorBase() Creates a new, empty Animator instance while expecting an AWT rendering thread if AWT is available.
| |
| add | back to summary |
|---|---|
| public final synchronized void add(final GLAutoDrawable drawable) Implements com. Doc from com. Adds a drawable to this animator's list of rendering drawables.
This allows the animator thread to become
| |
| display | back to summary |
|---|---|
| protected final void display() throws UncaughtAnimatorException Called every frame to cause redrawing of all of the GLAutoDrawables this Animator manages. Subclasses should call this to get the most optimized painting behavior for the set of components this Animator manages, in particular when multiple lightweight widgets are continually being redrawn. | |
| finishLifecycleAction | back to summary |
|---|---|
protected final synchronized boolean finishLifecycleAction(final AnimatorBase.
| |
| flushGLRunnables | back to summary |
|---|---|
| protected final void flushGLRunnables() Should be called in case of an uncaught exception from within the animator thread to flush all animator. The animator instance shall not be locked when calling this method! | |
| getBaseName | back to summary |
|---|---|
| protected abstract String getBaseName(String prefix) | |
| getExclusiveContextThread | back to summary |
|---|---|
| public final synchronized Thread getExclusiveContextThread() Returns the exclusive context thread if
If exclusive context is enabled via
If exclusive context is enabled via | |
| getFPSStartTime | back to summary |
|---|---|
| public final long getFPSStartTime() Implements com. Doc from com. Returns the time of the first display call in milliseconds after enabling this feature via
| |
| getLastFPS | back to summary |
|---|---|
| public final float getLastFPS() Implements com.
| |
| getLastFPSPeriod | back to summary |
|---|---|
| public final long getLastFPSPeriod() Implements com.
| |
| getLastFPSUpdateTime | back to summary |
|---|---|
| public final long getLastFPSUpdateTime() Implements com. Doc from com. Returns the time of the last update interval in milliseconds, if this feature is enabled via
| |
| getModeBits | back to summary |
|---|---|
| public synchronized int getModeBits() | |
| getThread | back to summary |
|---|---|
| public final synchronized Thread getThread() Implements com.
| |
| getThreadName | back to summary |
|---|---|
| protected static String getThreadName() | |
| getTotalFPS | back to summary |
|---|---|
| public final float getTotalFPS() Implements com.
| |
| getTotalFPSDuration | back to summary |
|---|---|
| public final long getTotalFPSDuration() Implements com.
| |
| getTotalFPSFrames | back to summary |
|---|---|
| public final int getTotalFPSFrames() Implements com.
| |
| getUncaughtExceptionHandler | back to summary |
|---|---|
| public final GLAnimatorControl. Implements com. Doc from com. Returns the
Default is
| |
| getUpdateFPSFrames | back to summary |
|---|---|
| public final int getUpdateFPSFrames() Implements com.
| |
| handleUncaughtException | back to summary |
|---|---|
| protected final synchronized boolean handleUncaughtException(final AnimatorBase. Should be called in case of an uncaught exception from within the animator thread, throws given exception if no handler has been installed.
| |
| initImpl | back to summary |
|---|---|
| protected final synchronized void initImpl(final boolean force) Initializes implementation details post setup,
invoked at
Operation is a NOP if
| |
| isExclusiveContextEnabled | back to summary |
|---|---|
| public final synchronized boolean isExclusiveContextEnabled() Returns | |
| isStarted | back to summary |
|---|---|
| public synchronized boolean isStarted() Implements com. Doc from com. Indicates whether this animator has been
| |
| remove | back to summary |
|---|---|
| public final synchronized void remove(final GLAutoDrawable drawable) Implements com. Doc from com. 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
| |
| resetFPSCounter | back to summary |
|---|---|
| public final void resetFPSCounter() Implements com. Doc from com. Reset all performance counter (startTime, currentTime, frame number)
| |
| setDrawablesExclCtxState | back to summary |
|---|---|
| protected final synchronized void setDrawablesExclCtxState(final boolean enable) Should be called at
At | |
| setExclusiveContext | back to summary |
|---|---|
| public final synchronized Thread setExclusiveContext(final Thread t) Dedicate all
The given thread will be exclusive to all
If already started and disabling, method waits
until change is propagated to all Note Utilizing this feature w/ AWT could lead to an AWT-EDT deadlock, depending on the AWT implementation. Hence it is advised not to use it with native AWT GLAutoDrawable like GLCanvas.
| |
| setExclusiveContext | back to summary |
|---|---|
| public final boolean setExclusiveContext(final boolean enable) Dedicate all
The given thread will be exclusive to all
If already started and disabling, method waits
until change is propagated to all Note Utilizing this feature w/ AWT could lead to an AWT-EDT deadlock, depending on the AWT implementation. Hence it is advised not to use it with native AWT GLAutoDrawable like GLCanvas.
| |
| setIgnoreExceptions | back to summary |
|---|---|
| public final void setIgnoreExceptions(final boolean ignoreExceptions) Sets a flag causing this Animator to ignore exceptions produced while redrawing the drawables. By default this flag is set to false, causing any exception thrown to halt the Animator. | |
| setModeBits | back to summary |
|---|---|
| public final synchronized void setModeBits(final boolean enable, final int bitValues) throws GLException Enables or disables the given
| |
| setPrintExceptions | back to summary |
|---|---|
| public final void setPrintExceptions(final boolean printExceptions) Sets a flag indicating that when exceptions are being ignored by
this Animator (see | |
| setUncaughtExceptionHandler | back to summary |
|---|---|
| public final void setUncaughtExceptionHandler(final GLAnimatorControl. Implements com. Doc from com. Set the handler invoked when this
| |
| setUpdateFPSFrames | back to summary |
|---|---|
| public final void setUpdateFPSFrames(final int frames, final PrintStream out) Implements com.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| useAWTAnimatorImpl | back to summary |
|---|---|
| private static final boolean useAWTAnimatorImpl(final int modeBits) | |
| validateDrawablesExclCtxState | back to summary |
|---|---|
| protected final boolean validateDrawablesExclCtxState(final Thread expected) | |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | display(final ArrayList<GLAutoDrawable> drawables, final boolean ignoreExceptions, final boolean printExceptions)
|
| blockUntilDone | back to summary |
|---|---|
| public boolean blockUntilDone(final Thread thread) | |
| display | back to summary |
|---|---|
public void display(final ArrayList<GLAutoDrawable> drawables, final boolean ignoreExceptions, final boolean printExceptions) throws UncaughtAnimatorException
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| eval | back to summary |
|---|---|
public boolean eval()
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final GLAutoDrawable |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final GLAutoDrawable |
| drawable | back to summary |
|---|---|
| pack-priv final GLAutoDrawable drawable | |
| UncaughtAnimatorException | back to summary |
|---|---|
| public UncaughtAnimatorException(final GLAutoDrawable drawable, final Throwable cause) | |
| getGLAutoDrawable | back to summary |
|---|---|
| public final GLAutoDrawable getGLAutoDrawable() | |