agile2d
Interface PluggableRenderer


public interface PluggableRenderer

Interface implemented by pluggable renderers. Each AgileJFrame has an instance of a PluggableRenderer associated with it - the PluggableRenderer is forwarded update, paint and repaint messages from the AgileJFrame. It is responsible for rendering the contents of the frame.


Method Summary
 void addAWTEventListener(AWTEventListener evt)
          Adds an event listener that is called for all events that are dispatched to the frame by the underlying rendering surface.
 void dispose()
          Discards any device data used by this renderer.
 void flush(Image image)
          Flush an image from video memory.
 BufferedImage getImage()
           
 String getName()
          Returns the name of this renderer.
 boolean isDoubleBuffered()
          Returns true if the renderer uses harware double-buffering.
 void notifyAfterSetRootPane(JRootPane pane)
          Called by the AgileJFrame associated with this renderer to inform the renderer that the frame has had its root pane set.
 void notifyBeforeSetRootPane(JRootPane pane)
          Called by the AgileJFrame associated with this renderer to inform the renderer that the frame is about to change its root pane.
 boolean notifyPaint(Graphics g)
          Called by the AgileJFrame associated with this renderer to inform the renderer that it is being painted.
 boolean notifyRepaint(long tm, int x, int y, int width, int height)
          Called by the AgileJFrame associated with this renderer to inform the renderer that repaint has been called.
 boolean notifyUpdate(Graphics g)
          Called by the AgileJFrame associated with this renderer to inform the renderer that is being updated.
 void removeAWTEventListener(AWTEventListener evt)
          Removes event listeners added by addAWTEventListener.
 void setCursor(Cursor c)
           
 void setDoubleBuffered(boolean v)
          Tells the renderer whether to use hardware double buffering if it is available.
 

Method Detail

getName

public String getName()
Returns the name of this renderer. Currently this is either "java2d" (indicating the default renderer provided with Java) or "opengl" (the Agile2D OpenGL Pluggable Renderer).

Returns:
the name of this renderer.

isDoubleBuffered

public boolean isDoubleBuffered()
Returns true if the renderer uses harware double-buffering.

Returns:
true if the renderer uses harware double-buffering.

setDoubleBuffered

public void setDoubleBuffered(boolean v)
Tells the renderer whether to use hardware double buffering if it is available. The default is true. Setting this to false may disable double buffering.


flush

public void flush(Image image)
Flush an image from video memory.

Pluggable renderers may cache the contents of an images using video memory on the graphics card. Unfortunately, because Java AWT provides no notification mechanism for discovering when an image's contents have changed, renderers are unable to detect changes to the image, and hence the renderer's version of an image can become out of date. Applications must call this method to force the current renderer to discard any copies of the image that cached in video memory.


dispose

public void dispose()
Discards any device data used by this renderer. This is called by the Frame's dispose method.


notifyBeforeSetRootPane

public void notifyBeforeSetRootPane(JRootPane pane)
Called by the AgileJFrame associated with this renderer to inform the renderer that the frame is about to change its root pane.


notifyAfterSetRootPane

public void notifyAfterSetRootPane(JRootPane pane)
Called by the AgileJFrame associated with this renderer to inform the renderer that the frame has had its root pane set.


notifyRepaint

public boolean notifyRepaint(long tm,
                             int x,
                             int y,
                             int width,
                             int height)
Called by the AgileJFrame associated with this renderer to inform the renderer that repaint has been called.

Returns:
true if the AgileJFrame should forward the message to its superclass, or false if it should discontinue dispatching the method.

notifyPaint

public boolean notifyPaint(Graphics g)
Called by the AgileJFrame associated with this renderer to inform the renderer that it is being painted.

Returns:
true if the AgileJFrame should forward the message to its superclass, or false if it should discontinue dispatching the method.

notifyUpdate

public boolean notifyUpdate(Graphics g)
Called by the AgileJFrame associated with this renderer to inform the renderer that is being updated.

Returns:
true if the AgileJFrame should forward the message to its superclass, or false if it should discontinue dispatching the method.

setCursor

public void setCursor(Cursor c)

getImage

public BufferedImage getImage()

addAWTEventListener

public void addAWTEventListener(AWTEventListener evt)
Adds an event listener that is called for all events that are dispatched to the frame by the underlying rendering surface.


removeAWTEventListener

public void removeAWTEventListener(AWTEventListener evt)
Removes event listeners added by addAWTEventListener.



Copyright © 2002 by University of Maryland, USA All rights reserved.