com.hermetica.magician
Interface GLDrawable

All Known Implementing Classes:
GLOffscreenBuffer, GLComponent

public abstract interface GLDrawable

This interface presents an abstracted view of GUI objects that Magician can render onto, for example, Sun VM Canvas objects, Microsoft-specific heavyweight classes and lightweight Swing/JFC/WFC-based components. This interface also is used by the GLEventListener interface for passing common events around Magician components.

Version:
$Id: GLDrawable.java,v 1.2 1999/06/03 23:11:48 descarte Exp $
Author:
Alligator Descartes
See Also:
GLEventListener, GLComponent

Method Summary
 void addGLEventListener(GLEventListener listener)
          This method registers a component listener with this component.
 void destroy()
          Destroys the component completely.
 GLContext getContext()
          Returns the rendering context associated with this component
 GLEventListener getListener()
          Returns the listener chain associated with a component
 boolean initialize()
          Initializes the component.
 boolean isInitialized()
          Tests to see whether the component is initialized
 boolean isOffscreen()
          Returns whether or not this component is onscreen or offscreen
 boolean isRunning()
          Returns whether or not the internal thread is running
 boolean isSuspended()
          Returns whether or not the component is suspended
 void processDisplayEvent(GLEventListener listener)
          Processes an display event.
 void processInitializeEvent(GLEventListener listener)
          Processes an initialize event.
 void processReshapeEvent(GLEventListener listener)
          Processes an reshape event.
 void removeGLEventListener(GLEventListener listener)
          This method removes a GLEventListener from the listener chain
 void restart()
          Reinitializes the component completely.
 void resume()
          Resumes the component allowing it to process reshape, repaint and initialize events.
 void start()
          Starts up the component handling.
 void stop()
          Shuts down the internal thread safely.
 void suspend()
          Stops the component from processing reshape, repaint and initialize events.
 

Method Detail

getContext

public GLContext getContext()
Returns the rendering context associated with this component

addGLEventListener

public void addGLEventListener(GLEventListener listener)
This method registers a component listener with this component. The GLEventListener is used to route any resizing and refreshing events through to the main program which handles them accordingly

Parameters:
listener - The GLEventListener to add

removeGLEventListener

public void removeGLEventListener(GLEventListener listener)
This method removes a GLEventListener from the listener chain

Parameters:
listener - The GLEventListener to remove

getListener

public GLEventListener getListener()
Returns the listener chain associated with a component

initialize

public boolean initialize()
Initializes the component. This MUST be called before anything will happen with the component.

restart

public void restart()
Reinitializes the component completely. This leaves the component in the same state as if the constructor had just been called.

destroy

public void destroy()
Destroys the component completely. This has the effect of freeing up all internal resources of this component.

start

public void start()
Starts up the component handling. Without calling start(), no reshape, repaint or initialize events will be processed.

stop

public void stop()
Shuts down the internal thread safely. This is used when both stopping the component ( if you wished to change its mode of operation from dynamic to static ) and when destroying the component completely

suspend

public void suspend()
Stops the component from processing reshape, repaint and initialize events. This is useful in cases where you might have minimised the component and do not wish it to continue processing.

resume

public void resume()
Resumes the component allowing it to process reshape, repaint and initialize events.

isRunning

public boolean isRunning()
Returns whether or not the internal thread is running

isSuspended

public boolean isSuspended()
Returns whether or not the component is suspended

isInitialized

public boolean isInitialized()
Tests to see whether the component is initialized

isOffscreen

public boolean isOffscreen()
Returns whether or not this component is onscreen or offscreen

processInitializeEvent

public void processInitializeEvent(GLEventListener listener)
Processes an initialize event. This is generally not used outwith the Magician core, but can be used to alter component behaviour.

processReshapeEvent

public void processReshapeEvent(GLEventListener listener)
Processes an reshape event. This is generally not used outwith the Magician core, but can be used to alter component behaviour.

processDisplayEvent

public void processDisplayEvent(GLEventListener listener)
Processes an display event. This is generally not used outwith the Magician core, but can be used to alter component behaviour.