Package org.apache.batik.gvt
Class CompositeShapePainter
- java.lang.Object
-
- org.apache.batik.gvt.CompositeShapePainter
-
- All Implemented Interfaces:
ShapePainter
public class CompositeShapePainter extends java.lang.Object implements ShapePainter
A shape painter which consists of multiple shape painters.- Version:
- $Id: CompositeShapePainter.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected intcountThe number of shape painter.protected ShapePainter[]paintersThe enclosedShapePainters of this composite shape painter.protected java.awt.ShapeshapeThe shape associated with this painter
-
Constructor Summary
Constructors Constructor Description CompositeShapePainter(java.awt.Shape shape)Constructs a new emptyCompositeShapePainter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddShapePainter(ShapePainter shapePainter)Adds the specified shape painter to the shape painter..java.awt.ShapegetPaintedArea()Returns the area painted by this shape painter.java.awt.geom.Rectangle2DgetPaintedBounds2D()Returns the bounds of the area painted by this shape painterjava.awt.ShapegetSensitiveArea()Returns the area covered by this shape painter (even if nothing is painted there).java.awt.geom.Rectangle2DgetSensitiveBounds2D()Returns the bounds of the area painted by this shape painterjava.awt.ShapegetShape()Gets the Shape this shape painter is associated with.ShapePaintergetShapePainter(int index)Returns the shape painter at the specified index.intgetShapePainterCount()Returns the number of shape painter of this composite shape painter.booleaninPaintedArea(java.awt.geom.Point2D pt)Returns true if pt is in the area painted by this shape painterbooleaninSensitiveArea(java.awt.geom.Point2D pt)Returns true if pt is in the area painted by this shape paintervoidpaint(java.awt.Graphics2D g2d)Paints the specified shape using the specified Graphics2D.voidsetShape(java.awt.Shape shape)Sets the Shape this shape painter is associated with.
-
-
-
Field Detail
-
shape
protected java.awt.Shape shape
The shape associated with this painter
-
painters
protected ShapePainter[] painters
The enclosedShapePainters of this composite shape painter.
-
count
protected int count
The number of shape painter.
-
-
Method Detail
-
addShapePainter
public void addShapePainter(ShapePainter shapePainter)
Adds the specified shape painter to the shape painter..- Parameters:
shapePainter- the shape painter to add
-
getShapePainter
public ShapePainter getShapePainter(int index)
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
public void paint(java.awt.Graphics2D g2d)
Paints the specified shape using the specified Graphics2D.- Specified by:
paintin interfaceShapePainter- Parameters:
g2d- the Graphics2D to use
-
getPaintedArea
public java.awt.Shape getPaintedArea()
Returns the area painted by this shape painter.- Specified by:
getPaintedAreain interfaceShapePainter
-
getPaintedBounds2D
public java.awt.geom.Rectangle2D getPaintedBounds2D()
Returns the bounds of the area painted by this shape painter- Specified by:
getPaintedBounds2Din interfaceShapePainter
-
inPaintedArea
public boolean inPaintedArea(java.awt.geom.Point2D pt)
Returns true if pt is in the area painted by this shape painter- Specified by:
inPaintedAreain interfaceShapePainter
-
getSensitiveArea
public java.awt.Shape getSensitiveArea()
Returns the area covered by this shape painter (even if nothing is painted there).- Specified by:
getSensitiveAreain interfaceShapePainter
-
getSensitiveBounds2D
public java.awt.geom.Rectangle2D getSensitiveBounds2D()
Returns the bounds of the area painted by this shape painter- Specified by:
getSensitiveBounds2Din interfaceShapePainter
-
inSensitiveArea
public boolean inSensitiveArea(java.awt.geom.Point2D pt)
Returns true if pt is in the area painted by this shape painter- Specified by:
inSensitiveAreain interfaceShapePainter
-
setShape
public void setShape(java.awt.Shape shape)
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.
-
getShape
public java.awt.Shape getShape()
Gets the Shape this shape painter is associated with.- Specified by:
getShapein interfaceShapePainter- Returns:
- shape associated with this painter
-
-