|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprefuse.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 stores 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 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.
Nested Class Summary | |
---|---|
static class |
PolygonRenderer.PolygonType
|
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 |
Fields inherited from interface prefuse.render.Renderer |
---|
DEFAULT_GRAPHICS |
Constructor Summary | |
---|---|
PolygonRenderer()
Create a new PolygonRenderer supporting straight lines. |
|
PolygonRenderer(PolygonRenderer.PolygonType polyType)
Create a new PolygonRenderer. |
Method Summary | |
---|---|
float |
getCurveSlack()
Gets the slack parameter for curved lines. |
PolygonRenderer.PolygonType |
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(PolygonRenderer.PolygonType polyType)
Set the polygon line type. |
Methods inherited from class prefuse.render.AbstractShapeRenderer |
---|
calculateBounds, drawShape, getFillColor, getRenderType, getShape, getStroke, getStrokeColor, getTransform, locatePoint, managesBounds, render, 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(PolygonRenderer.PolygonType polyType)
polyType
- the polygon edge typeMethod Detail |
---|
public PolygonRenderer.PolygonType getPolyType()
public void setPolyType(PolygonRenderer.PolygonType polyType)
polyType
- the polygon edge typepublic 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 |