Class MarkerShapePainter
java.lang.Object
org.apache.batik.gvt.MarkerShapePainter
- All Implemented Interfaces:
ShapePainter
A shape painter that can be used to paint markers on a shape.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MarkerEnd Markerprotected ExtendedShapeThe Shape to be painted.protected MarkerMiddle Markerprotected MarkerStart Marker -
Constructor Summary
ConstructorsConstructorDescriptionMarkerShapePainter(Shape shape) Constructs a newMarkerShapePainterthat can be used to markers on top of a shape. -
Method Summary
Modifier and TypeMethodDescriptionprotected ProxyGraphicsNodeBuilds a proxyGraphicsNodefor the inputMarkerto be drawn at the end position.protected voidBuilds a new marker group with the current set of markers.protected ProxyGraphicsNode[]Builds a proxyGraphicsNodefor the inputMarkerto be drawn at the middle positionsprotected ProxyGraphicsNodeBuilds a proxyGraphicsNodefor the inputMarkerto be drawn at the start positionReturns the marker that shall be drawn at the last vertex of the given shape.Gets the Shape this shape painter is associated with as an Extended Shape.Returns the marker that shall be drawn at every other vertex (not the first or the last one) of the given shape.Returns the area painted by this shape painter.Returns the bounds of the area painted by this shape painterprotected Point2DgetSegmentTerminatingPoint(double[] coords, int segType) Extracts the terminating point, depending on the segment type.Returns the area covered by this shape painter (even if not painted).Returns the bounds of the area covered by this shape painte (even if not painted).getShape()Gets the Shape this shape painter is associated with.Returns the marker that shall be drawn at the first vertex of the given shape.booleaninPaintedArea(Point2D pt) Returns true if pt is in the area painted by this shape painterbooleanReturns true if pt is in the sensitive area.double[]normalize(double[] v) Normalizes the input vector.voidpaint(Graphics2D g2d) Paints the specified shape using the specified Graphics2D.voidsetEndMarker(Marker endMarker) Sets the marker that shall be drawn at the last vertex of the given shape.voidsetMiddleMarker(Marker middleMarker) Sets the marker that shall be drawn at every other vertex (not the first or the last one) of the given shape.voidSets the Shape this shape painter is associated with.voidsetStartMarker(Marker startMarker) Sets the marker that shall be drawn at the first vertex of the given shape.
-
Field Details
-
extShape
The Shape to be painted. -
startMarker
Start Marker -
middleMarker
Middle Marker -
endMarker
End Marker
-
-
Constructor Details
-
MarkerShapePainter
Constructs a newMarkerShapePainterthat can be used to markers on top of a shape.- Parameters:
shape- Shape to be painted by this painter. Should not be null
-
-
Method Details
-
paint
Paints the specified shape using the specified Graphics2D.- Specified by:
paintin interfaceShapePainter- Parameters:
g2d- the Graphics2D to use
-
getPaintedArea
Returns the area painted by this shape painter.- Specified by:
getPaintedAreain interfaceShapePainter
-
getPaintedBounds2D
Returns the bounds of the area painted by this shape painter- Specified by:
getPaintedBounds2Din interfaceShapePainter
-
inPaintedArea
Returns true if pt is in the area painted by this shape painter- Specified by:
inPaintedAreain interfaceShapePainter
-
getSensitiveArea
Returns the area covered by this shape painter (even if not painted). This is always null for Markers.- Specified by:
getSensitiveAreain interfaceShapePainter
-
getSensitiveBounds2D
Returns the bounds of the area covered by this shape painte (even if not painted). This is always null for Markers.- Specified by:
getSensitiveBounds2Din interfaceShapePainter
-
inSensitiveArea
Returns true if pt is in the sensitive area. This is always false for Markers.- Specified by:
inSensitiveAreain interfaceShapePainter
-
setShape
Sets the Shape this shape painter is associated with.- Specified by:
setShapein interfaceShapePainter- Parameters:
shape- new shape this painter should be associated with. Should not be null.
-
getExtShape
Gets the Shape this shape painter is associated with as an Extended Shape.- Returns:
- shape associated with this painter
-
getShape
Gets the Shape this shape painter is associated with.- Specified by:
getShapein interfaceShapePainter- Returns:
- shape associated with this painter
-
getStartMarker
Returns the marker that shall be drawn at the first vertex of the given shape. -
setStartMarker
Sets the marker that shall be drawn at the first vertex of the given shape.- Parameters:
startMarker- the start marker
-
getMiddleMarker
Returns the marker that shall be drawn at every other vertex (not the first or the last one) of the given shape. -
setMiddleMarker
Sets the marker that shall be drawn at every other vertex (not the first or the last one) of the given shape.- Parameters:
middleMarker- the middle marker
-
getEndMarker
Returns the marker that shall be drawn at the last vertex of the given shape. -
setEndMarker
Sets the marker that shall be drawn at the last vertex of the given shape.- Parameters:
endMarker- the end marker
-
buildMarkerGroup
protected void buildMarkerGroup()Builds a new marker group with the current set of markers. -
buildStartMarkerProxy
Builds a proxyGraphicsNodefor the inputMarkerto be drawn at the start position -
buildEndMarkerProxy
Builds a proxyGraphicsNodefor the inputMarkerto be drawn at the end position. -
buildMiddleMarkerProxies
Builds a proxyGraphicsNodefor the inputMarkerto be drawn at the middle positions -
normalize
public double[] normalize(double[] v) Normalizes the input vector. This assumes an non-zero length -
getSegmentTerminatingPoint
Extracts the terminating point, depending on the segment type.
-