JMSLTM Numerical Library 5.0.1

com.imsl.chart3d
Class Canvas3DChart

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by javax.media.j3d.Canvas3D
              extended by com.imsl.chart3d.Canvas3DChart
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

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/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces 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, isShadingLanguageSupported, 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, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, 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.

Overrides:
paint in class Canvas3D

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.

Overrides:
postRender in class Canvas3D

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.

Overrides:
postSwap in class Canvas3D

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.

Overrides:
preRender in class Canvas3D

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, javax.imageio.stream.ImageOutputStream)

JMSLTM Numerical Library 5.0.1

Copyright © 1970-2008 Visual Numerics, Inc.
Built July 8 2008.