public class BufferedPaint extends Object implements Canvas3DChart.Paint, Cloneable
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 and Description |
---|
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 . |
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.
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.public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void paint(Graphics g)
paint
in interface Canvas3DChart.Paint
g
- is the Graphics
object.public void trim()
Copyright © 1970-2015 Rogue Wave Software
Built October 13 2015.