Interface GLAnimatorControl
-
- All Superinterfaces:
FPSCounter
- All Known Implementing Classes:
Animator
,AnimatorBase
,FPSAnimator
public interface GLAnimatorControl extends FPSCounter
An animator control interface, which implementation may drive aGLAutoDrawable
animation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
GLAnimatorControl.UncaughtExceptionHandler
Aregistered
GLAnimatorControl.UncaughtExceptionHandler
instance is invoked when ananimator
abruptlystops
due to an uncaught exception from one of itsGLAutoDrawable
s.
-
Field Summary
-
Fields inherited from interface com.jogamp.opengl.FPSCounter
DEFAULT_FRAMES_PER_INTERVAL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.Thread
getThread()
GLAnimatorControl.UncaughtExceptionHandler
getUncaughtExceptionHandler()
Returns theGLAnimatorControl.UncaughtExceptionHandler
invoked when thisanimator
abruptlystops
due to an uncaught exception from one of itsGLAutoDrawable
s.boolean
isAnimating()
Indicates whether this animatoris started
andis not paused
.boolean
isPaused()
Indicates whether this animatoris started
and eithermanually paused
or paused automatically due to noadded
GLAutoDrawable
s.boolean
isStarted()
Indicates whether this animator has beenstarted
.boolean
pause()
Pauses this animator.void
remove(GLAutoDrawable drawable)
Removes a drawable from the animator's list of rendering drawables.boolean
resume()
Resumes animation if paused.void
setUncaughtExceptionHandler(GLAnimatorControl.UncaughtExceptionHandler handler)
Set the handler invoked when thisanimator
abruptlystops
due to an uncaught exception from one of itsGLAutoDrawable
s.boolean
start()
Starts this animator, if not running.boolean
stop()
Stops this animator.-
Methods inherited from interface com.jogamp.opengl.FPSCounter
getFPSStartTime, getLastFPS, getLastFPSPeriod, getLastFPSUpdateTime, getTotalFPS, getTotalFPSDuration, getTotalFPSFrames, getUpdateFPSFrames, resetFPSCounter, setUpdateFPSFrames
-
-
-
-
Method Detail
-
isStarted
boolean isStarted()
Indicates whether this animator has beenstarted
.- See Also:
start()
,stop()
,isPaused()
,pause()
,resume()
-
isAnimating
boolean isAnimating()
Indicates whether this animatoris started
andis not paused
.
-
isPaused
boolean isPaused()
Indicates whether this animatoris started
and eithermanually paused
or paused automatically due to noadded
GLAutoDrawable
s.
-
getThread
Thread getThread()
-
start
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:
- true is started due to this call, otherwise false, ie started already or unable to start.
- See Also:
stop()
,isAnimating()
,isPaused()
,getThread()
-
stop
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:
- true is stopped due to this call, otherwise false, ie not started or unable to stop.
- See Also:
start()
,isAnimating()
,getThread()
-
pause
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:
- false if not started, already paused or failed to pause, otherwise true
- See Also:
resume()
,isAnimating()
-
resume
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:
- false if not started, not paused or unable to resume, otherwise true
- See Also:
pause()
,isAnimating()
-
add
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 animatoris started
.- Parameters:
drawable
- the drawable to be added- Throws:
IllegalArgumentException
- if drawable was already added to this animator
-
remove
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
- the drawable to be removed- Throws:
IllegalArgumentException
- if drawable was not added to this animator
-
getUncaughtExceptionHandler
GLAnimatorControl.UncaughtExceptionHandler getUncaughtExceptionHandler()
Returns theGLAnimatorControl.UncaughtExceptionHandler
invoked when thisanimator
abruptlystops
due to an uncaught exception from one of itsGLAutoDrawable
s.Default is
null
.- Since:
- 2.2
-
setUncaughtExceptionHandler
void setUncaughtExceptionHandler(GLAnimatorControl.UncaughtExceptionHandler handler)
Set the handler invoked when thisanimator
abruptlystops
due to an uncaught exception from one of itsGLAutoDrawable
s.- Parameters:
handler
- theGLAnimatorControl.UncaughtExceptionHandler
to use as thisanimator
's uncaught exception handler. Passnull
to unset the handler.- Since:
- 2.2
- See Also:
GLAnimatorControl.UncaughtExceptionHandler.uncaughtException(GLAnimatorControl, GLAutoDrawable, Throwable)
-
-