|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.render.AbstractShapeRenderer prefuse.render.PolygonRenderer
public class PolygonRenderer
Renderer for drawing a polygon, either as a closed shape, or as a
series of potentially unclosed curves. VisualItems must have a data field
containing an array of floats that tores the polyon. A Float.NaN
value can be used to mark the end point of the polygon for float arrays
larger than their contained points. By default, this renderer will
create closed paths, joining the first and last points in the point
array if necessary. The setClosePath(boolean)
method can be
used to render open paths, such as poly-lines or poly-curves.
A polygon edge type parameter (one of
Constants.POLY_TYPE_LINE
,
Constants.POLY_TYPE_CURVE
, or
Constants.POLY_TYPE_STACK
) determines how the
edges of the polygon are drawn. The LINE type result in a standard polygon,
with straight lines drawn between each sequential point. The CURVE type
causes the edges of the polygon to be interpolated as a cardinal spline,
giving a smooth blob-like appearance to the shape. The STACK type is similar
to the curve type except that straight line segments (not curves) are used
when the slope of the line between two adjacent points is zero or infinity.
This is useful for drawing stacks of data with otherwise curved edges.
Field Summary | |
---|---|
static java.lang.String |
POLYGON
Default data field for storing polygon (float array) values. |
static Schema |
POLYGON_SCHEMA
A Schema describing the polygon specification. |
Fields inherited from class prefuse.render.AbstractShapeRenderer |
---|
m_manageBounds, m_transform, RENDER_TYPE_DRAW, RENDER_TYPE_DRAW_AND_FILL, RENDER_TYPE_FILL, RENDER_TYPE_NONE |
Fields inherited from interface prefuse.render.Renderer |
---|
DEFAULT_GRAPHICS |
Constructor Summary | |
---|---|
PolygonRenderer()
Create a new PolygonRenderer supporting straight lines. |
|
PolygonRenderer(int polyType)
Create a new PolygonRenderer. |
Method Summary | |
---|---|
float |
getCurveSlack()
Gets the slack parameter for curved lines. |
int |
getPolyType()
Get the polygon line type. |
protected java.awt.Shape |
getRawShape(VisualItem item)
Return a non-transformed shape for the visual representation of the item. |
boolean |
isClosePath()
Indicates if this renderer uses a closed or open path. |
void |
setClosePath(boolean closePath)
Sets if this renderer uses a closed or open path. |
void |
setCurveSlack(float slack)
Sets the slack parameter for curved lines. |
void |
setPolyType(int polyType)
Set the polygon line type. |
Methods inherited from class prefuse.render.AbstractShapeRenderer |
---|
drawShape, getRenderType, getShape, getStroke, getTransform, locatePoint, render, setBounds, setManageBounds, setRenderType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String POLYGON
public static final Schema POLYGON_SCHEMA
Constructor Detail |
---|
public PolygonRenderer()
public PolygonRenderer(int polyType)
polyType
- the polygon edge type, one of
Constants.POLY_TYPE_LINE
,
Constants.POLY_TYPE_CURVE
, or
Constants.POLY_TYPE_STACK
).Method Detail |
---|
public int getPolyType()
Constants.POLY_TYPE_LINE
,
Constants.POLY_TYPE_CURVE
, or
Constants.POLY_TYPE_STACK
).public void setPolyType(int polyType)
polyType
- the polygon edge type, one of
Constants.POLY_TYPE_LINE
,
Constants.POLY_TYPE_CURVE
, or
Constants.POLY_TYPE_STACK
).public boolean isClosePath()
public void setClosePath(boolean closePath)
closePath
- true to close paths, false otherwise.public float getCurveSlack()
public void setCurveSlack(float slack)
slack
- the curve slack parameter to useprotected java.awt.Shape getRawShape(VisualItem item)
AbstractShapeRenderer
getRawShape
in class AbstractShapeRenderer
item
- the VisualItem being drawn
AbstractShapeRenderer.getRawShape(prefuse.visual.VisualItem)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |