| java.lang.Object de.progra.charting.render.AbstractRenderer
All known Subclasses: de.progra.charting.Title, de.progra.charting.AbstractChart, de.progra.charting.Legend, de.progra.charting.CoordSystem,
AbstractRenderer | abstract public class AbstractRenderer implements Renderer(Code) | | The AbstractRenderer provides default implementations for the set and
get methods of every Renderer. Especially it provides a default mechanism
for scaling Renderer instances whose actual bounds are smaller than their
preferred size. As a consequence, every Renderer instance only needs
to implement paintDefault() which has to render the object from coordinates
0,0 onwards using the preferred size.
author: mueller version: 1.0 |
Method Summary | |
public Rectangle | getBounds() Gets the bounds for this renderer.
the bounds of this renderer. | abstract public void | paintDefault(Graphics2D g) This method is called by the paint method to do the actual painting.
The painting is supposed to start at point (0,0) and the size is
always the same as the preferred size. | public void | render(Graphics2D g) Renders the Object in the Graphics object. | public void | setBounds(Rectangle bounds) Sets the bounds the layout manager has assigned to
this renderer. |
AbstractRenderer | public AbstractRenderer()(Code) | | Creates new AbstractRenderer
|
getBounds | public Rectangle getBounds()(Code) | | Gets the bounds for this renderer.
the bounds of this renderer. If setBounds has notbeen called before, the bounds computed fromgetPreferredSize is returned. |
paintDefault | abstract public void paintDefault(Graphics2D g)(Code) | | This method is called by the paint method to do the actual painting.
The painting is supposed to start at point (0,0) and the size is
always the same as the preferred size. The paint method performs
the possible scaling.
Parameters: g - the Graphics2D object to paint in. |
render | public void render(Graphics2D g)(Code) | | Renders the Object in the Graphics object. Creates a BufferedImage
and the corresponding Graphics2D object to paint in. The Image is
created using the preferred size. Afterwards paintDefault
is called to perform a standard painting in the Graphics object.
If the bounds and the preferred size don't match the image is
scaled afterwards.
Parameters: g - the Graphics2D object in which to render |
setBounds | public void setBounds(Rectangle bounds)(Code) | | Sets the bounds the layout manager has assigned to
this renderer. Those, of course, have to be
considered in the rendering process.
Parameters: bounds - the new bounds for the renderer. |
|
|