org.jzy3d.plot3d.rendering.canvas
Class OffscreenCanvas

java.lang.Object
  extended by org.jzy3d.plot3d.rendering.canvas.OffscreenCanvas
All Implemented Interfaces:
javax.media.opengl.ComponentEvents, javax.media.opengl.GLAutoDrawable, javax.media.opengl.GLDrawable, javax.media.opengl.GLPbuffer, ICanvas

public class OffscreenCanvas
extends java.lang.Object
implements ICanvas, javax.media.opengl.GLPbuffer

Offscreen canvas for use in headless environments. Currently, no axes are drawn and output size is either set using the specific constructor, or has a default size of 800x800 pixels.

Author:
Martin Pernollet, Nils Hoffmann

Field Summary
 
Fields inherited from interface javax.media.opengl.GLPbuffer
APPLE_FLOAT, ATI_FLOAT, NV_FLOAT
 
Constructor Summary
OffscreenCanvas(Scene scene, Quality quality)
          Initialize a Canvas3d attached to a Scene, with a given rendering Quality.
OffscreenCanvas(Scene scene, Quality quality, int width, int height)
          Initialize a Canvas3d attached to a Scene, with a given rendering Quality.
 
Method Summary
 void addComponentListener(java.awt.event.ComponentListener cl)
           
 void addFocusListener(java.awt.event.FocusListener fl)
           
 void addGLEventListener(javax.media.opengl.GLEventListener gl)
           
 void addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener hl)
           
 void addHierarchyListener(java.awt.event.HierarchyListener hl)
           
 void addInputMethodListener(java.awt.event.InputMethodListener il)
           
 void addKeyListener(java.awt.event.KeyListener kl)
           
 void addMouseListener(java.awt.event.MouseListener ml)
           
 void addMouseMotionListener(java.awt.event.MouseMotionListener ml)
           
 void addMouseWheelListener(java.awt.event.MouseWheelListener ml)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener pl)
           
 void addPropertyChangeListener(java.lang.String string, java.beans.PropertyChangeListener pl)
           
 void bindTexture()
           
 javax.media.opengl.GLContext createContext(javax.media.opengl.GLContext glc)
           
 void destroy()
           
 void display()
           
 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).
 boolean getAutoSwapBufferMode()
           
 javax.media.opengl.GLCapabilities getChosenGLCapabilities()
           
 javax.media.opengl.GLContext getContext()
           
 int getFloatingPointMode()
           
 javax.media.opengl.GL getGL()
           
 int getHeight()
           
 int getRendererHeight()
          Provide the actual renderer height for the open gl camera settings, which is obtained after a resize event.
 int getRendererWidth()
          Provide the actual renderer width for the open gl camera settings, which is obtained after a resize event.
 View getView()
          Provide a reference to the View that renders into this canvas.
 int getWidth()
           
 void releaseTexture()
           
 void removeComponentListener(java.awt.event.ComponentListener cl)
           
 void removeFocusListener(java.awt.event.FocusListener fl)
           
 void removeGLEventListener(javax.media.opengl.GLEventListener gl)
           
 void removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener hl)
           
 void removeHierarchyListener(java.awt.event.HierarchyListener hl)
           
 void removeInputMethodListener(java.awt.event.InputMethodListener il)
           
 void removeKeyListener(java.awt.event.KeyListener kl)
           
 void removeMouseListener(java.awt.event.MouseListener ml)
           
 void removeMouseMotionListener(java.awt.event.MouseMotionListener ml)
           
 void removeMouseWheelListener(java.awt.event.MouseWheelListener ml)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener pl)
           
 void removePropertyChangeListener(java.lang.String string, java.beans.PropertyChangeListener pl)
           
 void repaint()
           
 java.awt.image.BufferedImage screenshot()
          Returns an image with the current renderer's size
 void setAutoSwapBufferMode(boolean bln)
           
 void setGL(javax.media.opengl.GL gl)
           
 void setRealized(boolean bln)
           
 void setSize(int i, int i1)
           
 void swapBuffers()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OffscreenCanvas

public OffscreenCanvas(Scene scene,
                       Quality quality,
                       int width,
                       int height)
Initialize a Canvas3d attached to a Scene, with a given rendering Quality.


OffscreenCanvas

public OffscreenCanvas(Scene scene,
                       Quality quality)
Initialize a Canvas3d attached to a Scene, with a given rendering Quality.

Method Detail

swapBuffers

public void swapBuffers()
                 throws javax.media.opengl.GLException
Specified by:
swapBuffers in interface javax.media.opengl.GLDrawable
Throws:
javax.media.opengl.GLException

setSize

public void setSize(int i,
                    int i1)
Specified by:
setSize in interface javax.media.opengl.GLDrawable

setRealized

public void setRealized(boolean bln)
Specified by:
setRealized in interface javax.media.opengl.GLDrawable

getWidth

public int getWidth()
Specified by:
getWidth in interface javax.media.opengl.GLDrawable

getHeight

public int getHeight()
Specified by:
getHeight in interface javax.media.opengl.GLDrawable

getChosenGLCapabilities

public javax.media.opengl.GLCapabilities getChosenGLCapabilities()
Specified by:
getChosenGLCapabilities in interface javax.media.opengl.GLDrawable

createContext

public javax.media.opengl.GLContext createContext(javax.media.opengl.GLContext glc)
Specified by:
createContext in interface javax.media.opengl.GLDrawable

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String string,
                                         java.beans.PropertyChangeListener pl)
Specified by:
removePropertyChangeListener in interface javax.media.opengl.ComponentEvents

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener pl)
Specified by:
removePropertyChangeListener in interface javax.media.opengl.ComponentEvents

removeMouseWheelListener

public void removeMouseWheelListener(java.awt.event.MouseWheelListener ml)
Specified by:
removeMouseWheelListener in interface javax.media.opengl.ComponentEvents
Specified by:
removeMouseWheelListener in interface ICanvas

removeMouseMotionListener

public void removeMouseMotionListener(java.awt.event.MouseMotionListener ml)
Specified by:
removeMouseMotionListener in interface javax.media.opengl.ComponentEvents
Specified by:
removeMouseMotionListener in interface ICanvas

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener ml)
Specified by:
removeMouseListener in interface javax.media.opengl.ComponentEvents
Specified by:
removeMouseListener in interface ICanvas

removeKeyListener

public void removeKeyListener(java.awt.event.KeyListener kl)
Specified by:
removeKeyListener in interface javax.media.opengl.ComponentEvents
Specified by:
removeKeyListener in interface ICanvas

removeInputMethodListener

public void removeInputMethodListener(java.awt.event.InputMethodListener il)
Specified by:
removeInputMethodListener in interface javax.media.opengl.ComponentEvents

removeHierarchyListener

public void removeHierarchyListener(java.awt.event.HierarchyListener hl)
Specified by:
removeHierarchyListener in interface javax.media.opengl.ComponentEvents

removeHierarchyBoundsListener

public void removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener hl)
Specified by:
removeHierarchyBoundsListener in interface javax.media.opengl.ComponentEvents

removeFocusListener

public void removeFocusListener(java.awt.event.FocusListener fl)
Specified by:
removeFocusListener in interface javax.media.opengl.ComponentEvents

removeComponentListener

public void removeComponentListener(java.awt.event.ComponentListener cl)
Specified by:
removeComponentListener in interface javax.media.opengl.ComponentEvents

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String string,
                                      java.beans.PropertyChangeListener pl)
Specified by:
addPropertyChangeListener in interface javax.media.opengl.ComponentEvents

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener pl)
Specified by:
addPropertyChangeListener in interface javax.media.opengl.ComponentEvents

addMouseWheelListener

public void addMouseWheelListener(java.awt.event.MouseWheelListener ml)
Specified by:
addMouseWheelListener in interface javax.media.opengl.ComponentEvents
Specified by:
addMouseWheelListener in interface ICanvas

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener ml)
Specified by:
addMouseMotionListener in interface javax.media.opengl.ComponentEvents
Specified by:
addMouseMotionListener in interface ICanvas

addMouseListener

public void addMouseListener(java.awt.event.MouseListener ml)
Specified by:
addMouseListener in interface javax.media.opengl.ComponentEvents
Specified by:
addMouseListener in interface ICanvas

addKeyListener

public void addKeyListener(java.awt.event.KeyListener kl)
Specified by:
addKeyListener in interface javax.media.opengl.ComponentEvents
Specified by:
addKeyListener in interface ICanvas

addInputMethodListener

public void addInputMethodListener(java.awt.event.InputMethodListener il)
Specified by:
addInputMethodListener in interface javax.media.opengl.ComponentEvents

addHierarchyListener

public void addHierarchyListener(java.awt.event.HierarchyListener hl)
Specified by:
addHierarchyListener in interface javax.media.opengl.ComponentEvents

addHierarchyBoundsListener

public void addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener hl)
Specified by:
addHierarchyBoundsListener in interface javax.media.opengl.ComponentEvents

addFocusListener

public void addFocusListener(java.awt.event.FocusListener fl)
Specified by:
addFocusListener in interface javax.media.opengl.ComponentEvents

addComponentListener

public void addComponentListener(java.awt.event.ComponentListener cl)
Specified by:
addComponentListener in interface javax.media.opengl.ComponentEvents

setGL

public void setGL(javax.media.opengl.GL gl)
Specified by:
setGL in interface javax.media.opengl.GLAutoDrawable

setAutoSwapBufferMode

public void setAutoSwapBufferMode(boolean bln)
Specified by:
setAutoSwapBufferMode in interface javax.media.opengl.GLAutoDrawable

repaint

public void repaint()
Specified by:
repaint in interface javax.media.opengl.GLAutoDrawable

removeGLEventListener

public void removeGLEventListener(javax.media.opengl.GLEventListener gl)
Specified by:
removeGLEventListener in interface javax.media.opengl.GLAutoDrawable

getGL

public javax.media.opengl.GL getGL()
Specified by:
getGL in interface javax.media.opengl.GLAutoDrawable

getContext

public javax.media.opengl.GLContext getContext()
Specified by:
getContext in interface javax.media.opengl.GLAutoDrawable

getAutoSwapBufferMode

public boolean getAutoSwapBufferMode()
Specified by:
getAutoSwapBufferMode in interface javax.media.opengl.GLAutoDrawable

display

public void display()
Specified by:
display in interface javax.media.opengl.GLAutoDrawable

addGLEventListener

public void addGLEventListener(javax.media.opengl.GLEventListener gl)
Specified by:
addGLEventListener in interface javax.media.opengl.GLAutoDrawable

releaseTexture

public void releaseTexture()
Specified by:
releaseTexture in interface javax.media.opengl.GLPbuffer

getFloatingPointMode

public int getFloatingPointMode()
Specified by:
getFloatingPointMode in interface javax.media.opengl.GLPbuffer

destroy

public void destroy()
Specified by:
destroy in interface javax.media.opengl.GLPbuffer

bindTexture

public void bindTexture()
Specified by:
bindTexture in interface javax.media.opengl.GLPbuffer

dispose

public void dispose()
Description copied from interface: ICanvas
Performs all required cleanup when destroying a Canvas.

Specified by:
dispose in interface ICanvas

forceRepaint

public void forceRepaint()
Description copied from interface: ICanvas
Invoked when a user requires the Canvas to be repainted (e.g. a non 3d layer has changed).

Specified by:
forceRepaint in interface ICanvas

screenshot

public java.awt.image.BufferedImage screenshot()
Description copied from interface: ICanvas
Returns an image with the current renderer's size

Specified by:
screenshot in interface ICanvas

getView

public View getView()
Provide a reference to the View that renders into this canvas.

Specified by:
getView in interface ICanvas

getRendererWidth

public int getRendererWidth()
Provide the actual renderer width for the open gl camera settings, which is obtained after a resize event.

Specified by:
getRendererWidth in interface ICanvas

getRendererHeight

public int getRendererHeight()
Provide the actual renderer height for the open gl camera settings, which is obtained after a resize event.

Specified by:
getRendererHeight in interface ICanvas