JMSLTM Numerical Library 4.0

com.imsl.chart3d
Class BufferedPaint

java.lang.Object
  extended bycom.imsl.chart3d.BufferedPaint
All Implemented Interfaces:
Canvas3DChart.Paint

public class BufferedPaint
extends Object
implements Canvas3DChart.Paint

A Paint object cached into an image.

This is used to cache a static image that will be painted into the canvas containing a 3D chart. Since the 3D chart canvas will be repainted many times each second, it is faster to compose the image once.


Constructor Summary
BufferedPaint(Canvas3DChart.Paint paint, int x, int y, int width, int height, Component component)
          The paint method in Canvas3DChart.Paint is written into an image of size width by height.
 
Method Summary
 void paint(Graphics g)
          Paint the image onto the canvas.
 void trim()
          Returns a subimage with the white space trimmed off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedPaint

public BufferedPaint(Canvas3DChart.Paint paint,
                     int x,
                     int y,
                     int width,
                     int height,
                     Component component)

The paint method in Canvas3DChart.Paint is written into an image of size width by height. Any whitespace around the image is trimmed. The trimmed image is then used to paint onto the canvas.

Parameters:
paint - is the Canvas3DChart.Paint object to be cached.
x - is the pixel position in the canvas of the left edge of the image. If x is negative then |x| is the distance from the right edge of the image to the right edge of the component.
y - is the pixel position in the canvas of the top edge of the image. If y is negative then |y| is the distance from the bottom edge of the image to the bottom edge of the component.
width - is the maximum width of the image.
height - is the maximum height of the image.
component - is the Component in which the image is to be painted.
Method Detail

paint

public void paint(Graphics g)
Paint the image onto the canvas. This method should be called by the canvas, not by any application.

Specified by:
paint in interface Canvas3DChart.Paint
Parameters:
g - is the Graphics object.

trim

public void trim()
Returns a subimage with the white space trimmed off.


JMSLTM Numerical Library 4.0

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