|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.batik.gvt.MarkerShapePainter
public class MarkerShapePainter
A shape painter that can be used to paint markers on a shape.
| Field Summary | |
|---|---|
protected Marker |
endMarker
End Marker |
protected ExtendedShape |
extShape
The Shape to be painted. |
protected Marker |
middleMarker
Middle Marker |
protected Marker |
startMarker
Start Marker |
| Constructor Summary | |
|---|---|
MarkerShapePainter(Shape shape)
Constructs a new MarkerShapePainter that can be used to markers
on top of a shape. |
|
| Method Summary | |
|---|---|
protected ProxyGraphicsNode |
buildEndMarkerProxy()
Builds a proxy GraphicsNode for the input Marker to be
drawn at the end position. |
protected void |
buildMarkerGroup()
Builds a new marker group with the current set of markers. |
protected ProxyGraphicsNode[] |
buildMiddleMarkerProxies()
Builds a proxy GraphicsNode for the input
Marker to be drawn at the middle positions |
protected ProxyGraphicsNode |
buildStartMarkerProxy()
Builds a proxy GraphicsNode for the input Marker to be
drawn at the start position |
Marker |
getEndMarker()
Returns the marker that shall be drawn at the last vertex of the given shape. |
ExtendedShape |
getExtShape()
Gets the Shape this shape painter is associated with as an Extended Shape. |
Marker |
getMiddleMarker()
Returns the marker that shall be drawn at every other vertex (not the first or the last one) of the given shape. |
Shape |
getPaintedArea()
Returns the area painted by this shape painter. |
Rectangle2D |
getPaintedBounds2D()
Returns the bounds of the area painted by this shape painter |
protected Point2D |
getSegmentTerminatingPoint(double[] coords,
int segType)
Extracts the terminating point, depending on the segment type. |
Shape |
getSensitiveArea()
Returns the area covered by this shape painter (even if not painted). |
Rectangle2D |
getSensitiveBounds2D()
Returns the bounds of the area covered by this shape painte (even if not painted). |
Shape |
getShape()
Gets the Shape this shape painter is associated with. |
Marker |
getStartMarker()
Returns the marker that shall be drawn at the first vertex of the given shape. |
boolean |
inPaintedArea(Point2D pt)
Returns true if pt is in the area painted by this shape painter |
boolean |
inSensitiveArea(Point2D pt)
Returns true if pt is in the sensitive area. |
double[] |
normalize(double[] v)
Normalizes the input vector. |
void |
paint(Graphics2D g2d)
Paints the specified shape using the specified Graphics2D. |
void |
setEndMarker(Marker endMarker)
Sets the marker that shall be drawn at the last vertex of the given shape. |
void |
setMiddleMarker(Marker middleMarker)
Sets the marker that shall be drawn at every other vertex (not the first or the last one) of the given shape. |
void |
setShape(Shape shape)
Sets the Shape this shape painter is associated with. |
void |
setStartMarker(Marker startMarker)
Sets the marker that shall be drawn at the first vertex of the given shape. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ExtendedShape extShape
protected Marker startMarker
protected Marker middleMarker
protected Marker endMarker
| Constructor Detail |
|---|
public MarkerShapePainter(Shape shape)
MarkerShapePainter that can be used to markers
on top of a shape.
shape - Shape to be painted by this painter.
Should not be null| Method Detail |
|---|
public void paint(Graphics2D g2d)
paint in interface ShapePainterg2d - the Graphics2D to usepublic Shape getPaintedArea()
getPaintedArea in interface ShapePainterpublic Rectangle2D getPaintedBounds2D()
getPaintedBounds2D in interface ShapePainterpublic boolean inPaintedArea(Point2D pt)
inPaintedArea in interface ShapePainterpublic Shape getSensitiveArea()
getSensitiveArea in interface ShapePainterpublic Rectangle2D getSensitiveBounds2D()
getSensitiveBounds2D in interface ShapePainterpublic boolean inSensitiveArea(Point2D pt)
inSensitiveArea in interface ShapePainterpublic void setShape(Shape shape)
setShape in interface ShapePaintershape - new shape this painter should be associated with.
Should not be null.public ExtendedShape getExtShape()
public Shape getShape()
getShape in interface ShapePainterpublic Marker getStartMarker()
public void setStartMarker(Marker startMarker)
startMarker - the start markerpublic Marker getMiddleMarker()
public void setMiddleMarker(Marker middleMarker)
middleMarker - the middle markerpublic Marker getEndMarker()
public void setEndMarker(Marker endMarker)
endMarker - the end markerprotected void buildMarkerGroup()
protected ProxyGraphicsNode buildStartMarkerProxy()
GraphicsNode for the input Marker to be
drawn at the start position
protected ProxyGraphicsNode buildEndMarkerProxy()
GraphicsNode for the input Marker to be
drawn at the end position.
protected ProxyGraphicsNode[] buildMiddleMarkerProxies()
GraphicsNode for the input
Marker to be drawn at the middle positions
public double[] normalize(double[] v)
protected Point2D getSegmentTerminatingPoint(double[] coords,
int segType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||