|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.approximatrix.charting.render.AbstractRenderer
public abstract class AbstractRenderer
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.
| Field Summary | |
|---|---|
(package private) java.awt.Rectangle |
bounds
|
| Constructor Summary | |
|---|---|
AbstractRenderer()
Creates new AbstractRenderer |
|
| Method Summary | |
|---|---|
java.awt.Rectangle |
getBounds()
Gets the bounds for this renderer. |
abstract void |
paintDefault(java.awt.Graphics2D g)
This method is called by the paint method to do the actual painting. |
void |
render(java.awt.Graphics2D g)
Renders the Object in the Graphics object. |
void |
setBounds(java.awt.Rectangle bounds)
Sets the bounds the layout manager has assigned to this renderer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.approximatrix.charting.render.Renderer |
|---|
getPreferredSize |
| Field Detail |
|---|
java.awt.Rectangle bounds
| Constructor Detail |
|---|
public AbstractRenderer()
| Method Detail |
|---|
public void setBounds(java.awt.Rectangle bounds)
setBounds in interface Rendererbounds - the new bounds for the renderer.public java.awt.Rectangle getBounds()
getBounds in interface RenderersetBounds has not
been called before, the bounds computed from
getPreferredSize is returned.public void render(java.awt.Graphics2D g)
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.
render in interface Rendererg - the Graphics2D object in which to renderpublic abstract void paintDefault(java.awt.Graphics2D g)
g - the Graphics2D object to paint in.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||