javax.media.opengl
Interface GLAnimatorControl


public interface GLAnimatorControl

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

Note that the methods start(), stop(), pause() and resume() shall be implemented to fail-fast, ie start() fails if not started, etc. This way an implementation can find implementation errors faster.


Method Summary
 long getCurrentTime()
           
 long getDuration()
           
 long getStartTime()
           
 Thread getThread()
           
 int getTotalFrames()
           
 boolean isAnimating()
          Indicates whether this animator is currently running and not paused.
 boolean isPaused()
          Indicates whether this animator is currently running and paused.
 boolean isStarted()
          Indicates whether this animator is currently running, ie started.
 void pause()
          Pauses this animator.
 void resetCounter()
          Reset all performance counter (startTime, currentTime, frame number)
 void resume()
          Resumes animation if paused.
 void start()
          Starts this animator, if not running.
 void 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 currently running, ie started.

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

isAnimating

boolean isAnimating()
Indicates whether this animator is currently running and not paused.

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

isPaused

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

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

getThread

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

start

void 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.

Throws:
GLException - if started already
See Also:
stop(), isAnimating(), getThread()

stop

void 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.

Throws:
GLException - if not started
See Also:
start(), isAnimating(), getThread()

pause

void 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.

Throws:
GLException - if not started or not animating or already paused
See Also:
resume(), isAnimating()

resume

void 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.

Throws:
GLException - if not started or not paused
See Also:
pause(), isAnimating()


Copyright 2010 JogAmp Community.