jarp
Class DisplayScheduler

java.lang.Object
  extended by jarp.DisplayScheduler
All Implemented Interfaces:
ThreadCompletionChecker

public class DisplayScheduler
extends java.lang.Object
implements ThreadCompletionChecker

A DisplayScheduler sets up a thread to drive the display() method of a GLDrawable. For efficiency, it sets up the rendering thread for the drawable to be its own internal thread, so it can not be combined with manual repaints of the surface.


Field Summary
static int PERIOD_MS
           
 
Constructor Summary
DisplayScheduler(javax.media.opengl.GLAutoDrawable jadrawable)
          Creates a new GLDisplayScheduler for the given drawable.
 
Method Summary
 FrameAnimationSynch getFrameAnimationSynch()
          Returns this display-scheduler's frame-animation-synchronisation object.
 void requestDisplayNow()
          Registers a request for display to be invoked on our GLDrawable.
 void start()
          Starts this display scheduler.
 void stop()
          Stops this display scheduler, blocking until the display sheduling thread has finished.
 void waitForCompletion()
          Thread completion checker method: assumes we've previously had a stop() call and now wish to wait until it is known that the display-scheduler thread has indeed stopped.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERIOD_MS

public static final int PERIOD_MS
See Also:
Constant Field Values
Constructor Detail

DisplayScheduler

public DisplayScheduler(javax.media.opengl.GLAutoDrawable jadrawable)
Creates a new GLDisplayScheduler for the given drawable.

Method Detail

getFrameAnimationSynch

public FrameAnimationSynch getFrameAnimationSynch()
Returns this display-scheduler's frame-animation-synchronisation object.


start

public void start()
Starts this display scheduler.


stop

public void stop()
Stops this display scheduler, blocking until the display sheduling thread has finished.


waitForCompletion

public void waitForCompletion()
                       throws java.lang.InterruptedException
Thread completion checker method: assumes we've previously had a stop() call and now wish to wait until it is known that the display-scheduler thread has indeed stopped.

Specified by:
waitForCompletion in interface ThreadCompletionChecker
Throws:
java.lang.InterruptedException

requestDisplayNow

public void requestDisplayNow()
Registers a request for display to be invoked on our GLDrawable.