org.jzy3d.plot3d.rendering.canvas
Interface ICanvas

All Known Subinterfaces:
IScreenCanvas
All Known Implementing Classes:
CanvasAWT, CanvasSwing, OffscreenCanvas

public interface ICanvas

A ICanvas holds a Renderer3d and a View. It moreover allows adding and removing listeners for handling mouse or key events. In the case a user wants to override a concrete ICanvas painting policy, such as introducing layers in a CanvasAWT or CanvasSwing, he must be aware that the canvas may be repainted either by forceRepaint() or by its "original" paint function (that is, the paint function provided by the Component it extends (GLJpanel, GLCanvas, etc)).

Author:
Martin Pernollet

Method Summary
 void addKeyListener(java.awt.event.KeyListener listener)
           
 void addMouseListener(java.awt.event.MouseListener listener)
           
 void addMouseMotionListener(java.awt.event.MouseMotionListener listener)
           
 void addMouseWheelListener(java.awt.event.MouseWheelListener listener)
           
 void dispose()
          Performs all required cleanup when destroying a Canvas.
 void forceRepaint()
          Invoked when a user requires the Canvas to be repainted (e.g. a non 3d layer has changed).
 int getRendererHeight()
          Returns the renderer's height, i.e. the display height.
 int getRendererWidth()
          Returns the renderer's width, i.e. the display width.
 View getView()
          Returns a reference to the held view.
 void removeKeyListener(java.awt.event.KeyListener listener)
           
 void removeMouseListener(java.awt.event.MouseListener listener)
           
 void removeMouseMotionListener(java.awt.event.MouseMotionListener listener)
           
 void removeMouseWheelListener(java.awt.event.MouseWheelListener listener)
           
 java.awt.image.BufferedImage screenshot()
          Returns an image with the current renderer's size
 

Method Detail

getView

View getView()
Returns a reference to the held view.


getRendererWidth

int getRendererWidth()
Returns the renderer's width, i.e. the display width.


getRendererHeight

int getRendererHeight()
Returns the renderer's height, i.e. the display height.


forceRepaint

void forceRepaint()
Invoked when a user requires the Canvas to be repainted (e.g. a non 3d layer has changed).


screenshot

java.awt.image.BufferedImage screenshot()
Returns an image with the current renderer's size


dispose

void dispose()
Performs all required cleanup when destroying a Canvas.


addMouseListener

void addMouseListener(java.awt.event.MouseListener listener)

removeMouseListener

void removeMouseListener(java.awt.event.MouseListener listener)

addMouseWheelListener

void addMouseWheelListener(java.awt.event.MouseWheelListener listener)

removeMouseWheelListener

void removeMouseWheelListener(java.awt.event.MouseWheelListener listener)

addMouseMotionListener

void addMouseMotionListener(java.awt.event.MouseMotionListener listener)

removeMouseMotionListener

void removeMouseMotionListener(java.awt.event.MouseMotionListener listener)

addKeyListener

void addKeyListener(java.awt.event.KeyListener listener)

removeKeyListener

void removeKeyListener(java.awt.event.KeyListener listener)