javax.media.opengl
Interface GLAnimatorControl

All Known Implementing Classes:
Animator, AnimatorBase, FPSAnimator

public interface GLAnimatorControl

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


Method Summary
 long getCurrentTime()
           
 long getDuration()
           
 long getStartTime()
           
 Thread getThread()
           
 int getTotalFrames()
           
 boolean isAnimating()
          Indicates whether this animator is running and animating,
the latter is true if it has GLAutoDrawables to render and is not paused.
 boolean isPaused()
          Indicates whether this animator is running and paused.
 boolean isStarted()
          Indicates whether this animator is running, ie.
 boolean pause()
          Pauses this animator.
 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)
 boolean resume()
          Resumes animation if paused.
 boolean start()
          Starts this animator, if not running.
 boolean stop()
          Stops this animator.
 

Method Detail

getStartTime

long getStartTime()
Returns:
Time of the first display call in milliseconds. This value is reset if started or resumed.
See Also:
start(), resume()

getCurrentTime

long getCurrentTime()
Returns:
Time of the last display call in milliseconds. This value is reset if started or resumed.
See Also:
start(), resume()

getDuration

long getDuration()
Returns:
Duration getCurrentTime() - getStartTime().
See Also:
getStartTime(), getCurrentTime()

getTotalFrames

int getTotalFrames()
Returns:
Number of frame cycles displayed since the first display call, ie getStartTime(). This value is reset if started or resumed.
See Also:
start(), resume()

resetCounter

void resetCounter()
Reset all performance counter (startTime, currentTime, frame number)


isStarted

boolean isStarted()
Indicates whether this animator is running, ie. has been started and not stopped.

See Also:
start(), stop(), pause(), resume()

isAnimating

boolean isAnimating()
Indicates whether this animator is running and animating,
the latter is true if it has GLAutoDrawables to render and is not paused.

See Also:
start(), stop(), pause(), resume()

isPaused

boolean isPaused()
Indicates whether this animator is running and paused.

See Also:
start(), stop(), pause(), resume()

getThread

Thread getThread()
Returns:
The animation thread if running, otherwise null.
See Also:
start(), stop()

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.

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(), 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 if not started or already paused, 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 if not started or not paused, otherwise true
See Also:
pause(), isAnimating()

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 idle in case the last drawable has reached it's end of life.

Parameters:
drawable - the to be removed drawable


Copyright 2010 JogAmp Community.