JMSLTM Numerical Library 4.0

com.imsl.chart3d
Class Canvas3DChart

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended byjavax.media.j3d.Canvas3D
              extended bycom.imsl.chart3d.Canvas3DChart
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class Canvas3DChart
extends Canvas3D

A canvas for rendering a 3D chart.

See Also:
Serialized Form

Nested Class Summary
static interface Canvas3DChart.Paint
          Interface for 2D drawing on the canvas before or after the the 3D image is drawn.
 
Nested classes inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.media.j3d.Canvas3D
FIELD_ALL, FIELD_LEFT, FIELD_RIGHT
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Canvas3DChart()
          Creates a Canvas3DChart with a new Chart3D object.
Canvas3DChart(Chart3D chart)
          Creates a Canvas3DChart with a given Chart3D object.
 
Method Summary
 void addPostRenderPaint(Canvas3DChart.Paint paint)
          Adds a Paint object to draw to the canvas after the the 3D image is rendered.
 void addPreRenderPaint(Canvas3DChart.Paint paint)
          Adds a Paint object to draw to the canvas before the the 3D image is rendered.
 Chart3D getChart3D()
          Returns the Chart3D associated with this canvas.
 void paint(Graphics g)
          Paint method overriden to correct a problem in JDK 1.4.
 void postRender()
          Calls the Paint objects added to the post-render list.
 void postSwap()
          Writes the chart to a file as a bitmap image.
 void preRender()
          Calls the Paint objects added to the pre-render list.
 void removePostRenderPaint(Canvas3DChart.Paint paint)
          Removes a Paint object from the list of post-render Paint objects.
 void removePreRenderPaint(Canvas3DChart.Paint paint)
          Removes a Paint object from the list of pre-render Paint objects.
 void render()
          Creates a scene graph from the chart tree and starts rendering the scene graph into this canvas.
 void write(String filename, String format)
          Write the canvas as an image file after it is next redrawn.
 
Methods inherited from class javax.media.j3d.Canvas3D
addNotify, getBounds, getBounds, getCenterEyeInImagePlate, getDoubleBufferAvailable, getDoubleBufferEnable, getGraphics2D, getGraphicsContext3D, getHeight, getImagePlateToVworld, getInverseVworldProjection, getLeftEyeInImagePlate, getLeftManualEyeInImagePlate, getLocation, getLocation, getLocationOnScreen, getMonoscopicViewPolicy, getOffScreenBuffer, getOffScreenLocation, getOffScreenLocation, getPhysicalHeight, getPhysicalWidth, getPixelLocationFromImagePlate, getPixelLocationInImagePlate, getPixelLocationInImagePlate, getRightEyeInImagePlate, getRightManualEyeInImagePlate, getSceneAntialiasingAvailable, getScreen3D, getSize, getSize, getStereoAvailable, getStereoEnable, getView, getVworldProjection, getVworldToImagePlate, getWidth, getX, getY, isOffScreen, isRendererRunning, queryProperties, removeNotify, renderField, renderOffScreenBuffer, setDoubleBufferEnable, setLeftManualEyeInImagePlate, setMonoscopicViewPolicy, setOffScreenBuffer, setOffScreenLocation, setOffScreenLocation, setRightManualEyeInImagePlate, setStereoEnable, startRenderer, stopRenderer, swap, waitForOffScreenRendering
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Canvas3DChart

public Canvas3DChart()
Creates a Canvas3DChart with a new Chart3D object.


Canvas3DChart

public Canvas3DChart(Chart3D chart)
Creates a Canvas3DChart with a given Chart3D object.

Parameters:
chart - is the Chart3D object associated with this canvas.
Method Detail

addPostRenderPaint

public void addPostRenderPaint(Canvas3DChart.Paint paint)
Adds a Paint object to draw to the canvas after the the 3D image is rendered.

Parameters:
paint - is the Paint object to be removed.

addPreRenderPaint

public void addPreRenderPaint(Canvas3DChart.Paint paint)
Adds a Paint object to draw to the canvas before the the 3D image is rendered.

Parameters:
paint - implements the paint method to be called before the 3D image is rendered.

getChart3D

public Chart3D getChart3D()
Returns the Chart3D associated with this canvas.

Returns:
the Chart3D associated with this canvas.

paint

public void paint(Graphics g)
Paint method overriden to correct a problem in JDK 1.4. See bug ID Bug ID 4374079 for details.


postRender

public void postRender()
Calls the Paint objects added to the post-render list. This routine is called by the Java 3D rendering loop after completing all rendering to the canvas for this frame and before the buffer swap.

NOTE: Applications should not call this method.


postSwap

public void postSwap()
Writes the chart to a file as a bitmap image. Use the write method to trigger writing of the image.

NOTE: Applications should not call this method.


preRender

public void preRender()
Calls the Paint objects added to the pre-render list. This routine is called by the Java 3D rendering loop after clearing the canvas and before any rendering has been done for this frame.

NOTE: Applications should not call this method.


removePostRenderPaint

public void removePostRenderPaint(Canvas3DChart.Paint paint)
Removes a Paint object from the list of post-render Paint objects.

Parameters:
paint - is the Paint object to be removed.

removePreRenderPaint

public void removePreRenderPaint(Canvas3DChart.Paint paint)
Removes a Paint object from the list of pre-render Paint objects.

Parameters:
paint - implements the paint method to be called before the 3D image is rendered.

render

public void render()
Creates a scene graph from the chart tree and starts rendering the scene graph into this canvas. This method must be called after the chart tree has been created and associated with this canvas.


write

public void write(String filename,
                  String format)
Write the canvas as an image file after it is next redrawn.

Parameters:
filename - is the name of the file to which the image is to be written.
format - is the image format name, such as "PNG" or "JPEG". The supported formats are the same as for ImageIO.write.
See Also:
ImageIO.write(java.awt.image.RenderedImage, java.lang.String, java.io.File)

JMSLTM Numerical Library 4.0

Copyright 1970-2006 Visual Numerics, Inc.
Built June 1 2006.