| java.lang.Object prefuse.render.AbstractShapeRenderer
All known Subclasses: prefuse.render.AxisRenderer, prefuse.render.LabelRenderer, prefuse.render.EdgeRenderer, prefuse.render.ShapeRenderer, prefuse.render.PolygonRenderer,
AbstractShapeRenderer | abstract public class AbstractShapeRenderer implements Renderer(Code) | | Abstract base class implementation of the Renderer interface for
supporting the drawing of basic shapes. Subclasses should override the
AbstractShapeRenderer.getRawShape(VisualItem) getRawShape method,
which returns the shape to draw. Optionally, subclasses can also override the
AbstractShapeRenderer.getTransform(VisualItem) getTransform method to apply a desired
AffineTransform to the shape.
NOTE: For more efficient rendering, subclasses should use a
single shape instance in memory, and update its parameters on each call
to getRawShape, rather than allocating a new Shape object each time.
Otherwise, a new object will be allocated every time something needs to
be drawn, and then subsequently be arbage collected. This can significantly
reduce performance, especially when there are many things to draw.
version: 1.0 author: alan newberger author: jeffrey heer |
Method Summary | |
protected void | drawShape(Graphics2D g, VisualItem item, Shape shape) Draws the specified shape into the provided Graphics context, using
stroke and fill color values from the specified VisualItem. | abstract protected Shape | getRawShape(VisualItem item) Return a non-transformed shape for the visual representation of the
item. | public int | getRenderType(VisualItem item) Returns a value indicating if a shape is drawn by its outline, by a
fill, or both. | public Shape | getShape(VisualItem item) Returns the shape describing the boundary of an item. | protected BasicStroke | getStroke(VisualItem item) Retursn the stroke to use for drawing lines and shape outlines. | protected AffineTransform | getTransform(VisualItem item) Return the graphics space transform applied to this item's shape, if any. | public boolean | locatePoint(Point2D p, VisualItem item) | public void | render(Graphics2D g, VisualItem item) | public void | setBounds(VisualItem item) | public void | setManageBounds(boolean b) | public void | setRenderType(int type) Sets a value indicating if a shape is drawn by its outline, by a fill,
or both. |
RENDER_TYPE_DRAW | final public static int RENDER_TYPE_DRAW(Code) | | |
RENDER_TYPE_DRAW_AND_FILL | final public static int RENDER_TYPE_DRAW_AND_FILL(Code) | | |
RENDER_TYPE_FILL | final public static int RENDER_TYPE_FILL(Code) | | |
RENDER_TYPE_NONE | final public static int RENDER_TYPE_NONE(Code) | | |
m_manageBounds | protected boolean m_manageBounds(Code) | | |
drawShape | protected void drawShape(Graphics2D g, VisualItem item, Shape shape)(Code) | | Draws the specified shape into the provided Graphics context, using
stroke and fill color values from the specified VisualItem. This method
can be called by subclasses in custom rendering routines.
|
getRawShape | abstract protected Shape getRawShape(VisualItem item)(Code) | | Return a non-transformed shape for the visual representation of the
item. Subclasses must implement this method.
Parameters: item - the VisualItem being drawn the "raw", untransformed shape. |
getRenderType | public int getRenderType(VisualItem item)(Code) | | Returns a value indicating if a shape is drawn by its outline, by a
fill, or both. The default is to draw both.
the rendering type |
getShape | public Shape getShape(VisualItem item)(Code) | | Returns the shape describing the boundary of an item. The shape's
coordinates should be in abolute (item-space) coordinates.
Parameters: item - the item for which to get the Shape |
getStroke | protected BasicStroke getStroke(VisualItem item)(Code) | | Retursn the stroke to use for drawing lines and shape outlines. By
default returns the value of
VisualItem.getStroke .
Subclasses can override this method to implement custom stroke
assignment, though changing the VisualItem 's stroke
value is preferred.
Parameters: item - the VisualItem the strok to use for drawing lines and shape outlines |
getTransform | protected AffineTransform getTransform(VisualItem item)(Code) | | Return the graphics space transform applied to this item's shape, if any.
Subclasses can implement this method, otherwise it will return null
to indicate no transformation is needed.
Parameters: item - the VisualItem the graphics space transform, or null if none |
setManageBounds | public void setManageBounds(boolean b)(Code) | | |
|
|