Top Description Inners Fields Methods
com.jogamp.opengl

public Interface GLAnimatorControl

extends FPSCounter
Known Direct Implementers
com.jogamp.opengl.util.AnimatorBase

An animator control interface, which implementation may drive a com.jogamp.opengl.GLAutoDrawable animation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
GLAnimatorControl.UncaughtExceptionHandler

A registered UncaughtExceptionHandler instance is invoked when an animator abruptly stops due to an uncaught exception from one of its GLAutoDrawables.

Field Summary

Inherited from com.jogamp.opengl.FPSCounter:
DEFAULT_FRAMES_PER_INTERVAL

Method Summary

Modifier and TypeMethod and Description
public void
add(GLAutoDrawable
the drawable to be added
drawable
)

Adds a drawable to this animator's list of rendering drawables.

public Thread

Returns:

The animation thread if running, otherwise null.
getThread
()

public GLAnimatorControl.UncaughtExceptionHandler
getUncaughtExceptionHandler()

Returns the UncaughtExceptionHandler invoked when this animator abruptly stops due to an uncaught exception from one of its GLAutoDrawables.

public boolean
isAnimating()

Indicates whether this animator is started and is not paused.

public boolean
isPaused()

Indicates whether this animator is started and either manually paused or paused automatically due to no added GLAutoDrawables.

public boolean
isStarted()

Indicates whether this animator has been started.

public boolean

Returns:

false if not started, already paused or failed to pause, otherwise true
pause
()

Pauses this animator.

public void
remove(GLAutoDrawable
the drawable to be removed
drawable
)

Removes a drawable from the animator's list of rendering drawables.

public boolean

Returns:

false if not started, not paused or unable to resume, otherwise true
resume
()

Resumes animation if paused.

public void
setUncaughtExceptionHandler(final GLAnimatorControl.UncaughtExceptionHandler
the UncaughtExceptionHandler to use as this animator's uncaught exception handler. Pass null to unset the handler.
handler
)

Set the handler invoked when this animator abruptly stops due to an uncaught exception from one of its GLAutoDrawables.

public boolean

Returns:

true is started due to this call, otherwise false, ie started already or unable to start.
start
()

Starts this animator, if not running.

public boolean

Returns:

true is stopped due to this call, otherwise false, ie not started or unable to stop.
stop
()

Stops this animator.

Inherited from com.jogamp.opengl.FPSCounter:
getFPSStartTimegetLastFPSgetLastFPSPeriodgetLastFPSUpdateTimegetTotalFPSgetTotalFPSDurationgetTotalFPSFramesgetUpdateFPSFramesresetFPSCountersetUpdateFPSFrames

Method Detail

addback to summary
public void add(GLAutoDrawable drawable)

Adds a drawable to this animator's list of rendering drawables.

This allows the animator thread to become animating, in case the first drawable is added and the animator is started.

Parameters
drawable:GLAutoDrawable

the drawable to be added

Exceptions
IllegalArgumentException:
if drawable was already added to this animator
getThreadback to summary
public Thread getThread()
Returns:Thread

The animation thread if running, otherwise null.

See Also
start(), stop()
getUncaughtExceptionHandlerback to summary
public GLAnimatorControl.UncaughtExceptionHandler getUncaughtExceptionHandler()

Returns the UncaughtExceptionHandler invoked when this animator abruptly stops due to an uncaught exception from one of its GLAutoDrawables.

Default is null.

Since
2.2
isAnimatingback to summary
public boolean isAnimating()

Indicates whether this animator is started and is not paused.

See Also
start(), stop(), pause(), resume()
isPausedback to summary
public boolean isPaused()

Indicates whether this animator is started and either manually paused or paused automatically due to no added GLAutoDrawables.

See Also
start(), stop(), pause(), resume()
isStartedback to summary
public boolean isStarted()

Indicates whether this animator has been started.

See Also
start(), stop(), isPaused(), pause(), resume()
pauseback to summary
public boolean pause()

Pauses this animator.

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.

Returns:boolean

false if not started, already paused or failed to pause, otherwise true

See Also
resume(), isAnimating()
removeback to summary
public 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 not animating, in case the last drawable has been removed.

Parameters
drawable:GLAutoDrawable

the drawable to be removed

Exceptions
IllegalArgumentException:
if drawable was not added to this animator
resumeback to summary
public boolean resume()

Resumes animation if paused.

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.

Returns:boolean

false if not started, not paused or unable to resume, otherwise true

See Also
pause(), isAnimating()
setUncaughtExceptionHandlerback to summary
public void setUncaughtExceptionHandler(final GLAnimatorControl.UncaughtExceptionHandler handler)

Set the handler invoked when this animator abruptly stops due to an uncaught exception from one of its GLAutoDrawables.

Parameters
handler:GLAnimatorControl.UncaughtExceptionHandler

the UncaughtExceptionHandler to use as this animator's uncaught exception handler. Pass null to unset the handler.

Since
2.2
See Also
UncaughtExceptionHandler#uncaughtException(GLAnimatorControl, GLAutoDrawable, Throwable)
startback to summary
public boolean start()

Starts this animator, if not running.

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.

Note that an animator w/o added drawables will be paused automatically.

If started, all counters (time, frames, ..) are reset to zero.

Returns:boolean

true is started due to this call, otherwise false, ie started already or unable to start.

See Also
stop(), isAnimating(), isPaused(), getThread()
stopback to summary
public boolean stop()

Stops this animator.

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.

Returns:boolean

true is stopped due to this call, otherwise false, ie not started or unable to stop.

See Also
start(), isAnimating(), getThread()
com.jogamp.opengl back to summary

public Interface GLAnimatorControl.UncaughtExceptionHandler


A registered UncaughtExceptionHandler instance is invoked when an animator abruptly stops due to an uncaught exception from one of its GLAutoDrawables.
Since
2.2
See Also
uncaughtException(GLAnimatorControl, GLAutoDrawable, Throwable), GLAnimatorControl#setUncaughtExceptionHandler(UncaughtExceptionHandler)

Method Summary

Modifier and TypeMethod and Description
public void
uncaughtException(final GLAnimatorControl animator, final GLAutoDrawable
the causing GLAutoDrawable, may be null in case Throwable caused unrelated to any GLAutoDrawable.
drawable
,
final Throwable
the uncaught exception
cause
)

Method invoked when the given GLAnimatorControl is stopped due to the given uncaught exception happened on the given GLAutoDrawable.

Method Detail

uncaughtExceptionback to summary
public void uncaughtException(final GLAnimatorControl animator, final GLAutoDrawable drawable, final Throwable cause)

Method invoked when the given GLAnimatorControl is stopped due to the given uncaught exception happened on the given GLAutoDrawable.

The animator thread can still be retrieved via GLAnimatorControl#getThread().

All GLAnimatorControl states already reflect its stopped state.

After this handler method is called, the GLAnimatorControl is stopped.

Any exception thrown by this method will be ignored.

Parameters
animator:GLAnimatorControl

the GLAnimatorControl

drawable:GLAutoDrawable

the causing GLAutoDrawable, may be null in case Throwable caused unrelated to any GLAutoDrawable.

cause:Throwable

the uncaught exception

Since
2.2
See Also
GLAnimatorControl#setUncaughtExceptionHandler(UncaughtExceptionHandler)