Package org.apache.batik.gvt
Class CompositeShapePainter
java.lang.Object
org.apache.batik.gvt.CompositeShapePainter
- All Implemented Interfaces:
ShapePainter
A shape painter which consists of multiple shape painters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The number of shape painter.protected ShapePainter[]
The enclosedShapePainter
s of this composite shape painter.protected Shape
The shape associated with this painter -
Constructor Summary
ConstructorsConstructorDescriptionCompositeShapePainter
(Shape shape) Constructs a new emptyCompositeShapePainter
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addShapePainter
(ShapePainter shapePainter) Adds the specified shape painter to the shape painter..Returns the area painted by this shape painter.Returns the bounds of the area painted by this shape painterReturns the area covered by this shape painter (even if nothing is painted there).Returns the bounds of the area painted by this shape paintergetShape()
Gets the Shape this shape painter is associated with.getShapePainter
(int index) Returns the shape painter at the specified index.int
Returns the number of shape painter of this composite shape painter.boolean
inPaintedArea
(Point2D pt) Returns true if pt is in the area painted by this shape painterboolean
Returns true if pt is in the area painted by this shape paintervoid
paint
(Graphics2D g2d) Paints the specified shape using the specified Graphics2D.void
Sets the Shape this shape painter is associated with.
-
Field Details
-
shape
The shape associated with this painter -
painters
The enclosedShapePainter
s of this composite shape painter. -
count
protected int countThe number of shape painter.
-
-
Constructor Details
-
CompositeShapePainter
Constructs a new emptyCompositeShapePainter
.
-
-
Method Details
-
addShapePainter
Adds the specified shape painter to the shape painter..- Parameters:
shapePainter
- the shape painter to add
-
getShapePainter
Returns the shape painter at the specified index.- Parameters:
index
- the index of the shape painter to return
-
getShapePainterCount
public int getShapePainterCount()Returns the number of shape painter of this composite shape painter. -
paint
Paints the specified shape using the specified Graphics2D.- Specified by:
paint
in interfaceShapePainter
- Parameters:
g2d
- the Graphics2D to use
-
getPaintedArea
Returns the area painted by this shape painter.- Specified by:
getPaintedArea
in interfaceShapePainter
-
getPaintedBounds2D
Returns the bounds of the area painted by this shape painter- Specified by:
getPaintedBounds2D
in interfaceShapePainter
-
inPaintedArea
Returns true if pt is in the area painted by this shape painter- Specified by:
inPaintedArea
in interfaceShapePainter
-
getSensitiveArea
Returns the area covered by this shape painter (even if nothing is painted there).- Specified by:
getSensitiveArea
in interfaceShapePainter
-
getSensitiveBounds2D
Returns the bounds of the area painted by this shape painter- Specified by:
getSensitiveBounds2D
in interfaceShapePainter
-
inSensitiveArea
Returns true if pt is in the area painted by this shape painter- Specified by:
inSensitiveArea
in interfaceShapePainter
-
setShape
Sets the Shape this shape painter is associated with.- Specified by:
setShape
in interfaceShapePainter
- Parameters:
shape
- new shape this painter should be associated with. Should not be null.
-
getShape
Gets the Shape this shape painter is associated with.- Specified by:
getShape
in interfaceShapePainter
- Returns:
- shape associated with this painter
-