prefuse.render
Interface Renderer

All Known Implementing Classes:
AbstractShapeRenderer, AxisRenderer, EdgeRenderer, LabelRenderer, NullRenderer, PolygonRenderer, ShapeRenderer

public interface Renderer

Interface for rendering VisualItems, providing drawing as well as location checking and bounding box routines.

Author:
jeffrey heer, alan newberger

Field Summary
static java.awt.Graphics2D DEFAULT_GRAPHICS
          Provides a default graphics context for renderers to do useful things like compute string widths when an external graphics context has not yet been provided.
 
Method Summary
 boolean locatePoint(java.awt.geom.Point2D p, VisualItem item)
          Returns true if the Point is located inside the extents of the item.
 void render(java.awt.Graphics2D g, VisualItem item)
          Render item into a Graphics2D context.
 void setBounds(VisualItem item)
          Calculates and sets the bounding rectangle for an item.
 

Field Detail

DEFAULT_GRAPHICS

static final java.awt.Graphics2D DEFAULT_GRAPHICS
Provides a default graphics context for renderers to do useful things like compute string widths when an external graphics context has not yet been provided.

Method Detail

render

void render(java.awt.Graphics2D g,
            VisualItem item)
Render item into a Graphics2D context.

Parameters:
g - the Graphics2D context
item - the visual item to draw

locatePoint

boolean locatePoint(java.awt.geom.Point2D p,
                    VisualItem item)
Returns true if the Point is located inside the extents of the item. This calculation matches against the exaxt item shape, and so is more sensitive than just checking within a bounding box.

Parameters:
p - the point to test for containment
item - the item to test containment against
Returns:
true if the point is contained within the the item, else false

setBounds

void setBounds(VisualItem item)
Calculates and sets the bounding rectangle for an item. This is called by a VisualItem when it validates its bounds.

Parameters:
item - the item to compute the bounding box for


Copyright © 2007 Regents of the University of California