org.apache.batik.gvt

Class CompositeShapePainter

public class CompositeShapePainter extends Object implements ShapePainter

A shape painter which consists of multiple shape painters.
Field Summary
protected intcount
The number of shape painter.
protected ShapePainter[]painters
The enclosed ShapePainters of this composite shape painter.
protected Shapeshape
The shape associated with this painter
Constructor Summary
CompositeShapePainter(Shape shape)
Constructs a new empty CompositeShapePainter.
Method Summary
voidaddShapePainter(ShapePainter shapePainter)
Adds the specified shape painter to the shape painter..
ShapegetPaintedArea()
Returns the area painted by this shape painter.
Rectangle2DgetPaintedBounds2D()
Returns the bounds of the area painted by this shape painter
ShapegetSensitiveArea()
Returns the area covered by this shape painter (even if nothing is painted there).
Rectangle2DgetSensitiveBounds2D()
Returns the bounds of the area painted by this shape painter
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(Point2D pt)
Returns true if pt is in the area painted by this shape painter
booleaninSensitiveArea(Point2D pt)
Returns true if pt is in the area painted by this shape painter
voidpaint(Graphics2D g2d)
Paints the specified shape using the specified Graphics2D.
voidsetShape(Shape shape)
Sets the Shape this shape painter is associated with.

Field Detail

count

protected int count
The number of shape painter.

painters

protected ShapePainter[] painters
The enclosed ShapePainters of this composite shape painter.

shape

protected Shape shape
The shape associated with this painter

Constructor Detail

CompositeShapePainter

public CompositeShapePainter(Shape shape)
Constructs a new empty CompositeShapePainter.

Method Detail

addShapePainter

public void addShapePainter(ShapePainter shapePainter)
Adds the specified shape painter to the shape painter..

Parameters: shapePainter the shape painter to add

getPaintedArea

public Shape getPaintedArea()
Returns the area painted by this shape painter.

getPaintedBounds2D

public Rectangle2D getPaintedBounds2D()
Returns the bounds of the area painted by this shape painter

getSensitiveArea

public Shape getSensitiveArea()
Returns the area covered by this shape painter (even if nothing is painted there).

getSensitiveBounds2D

public Rectangle2D getSensitiveBounds2D()
Returns the bounds of the area painted by this shape painter

getShape

public Shape getShape()
Gets the Shape this shape painter is associated with.

Returns: shape associated with this painter

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.

inPaintedArea

public boolean inPaintedArea(Point2D pt)
Returns true if pt is in the area painted by this shape painter

inSensitiveArea

public boolean inSensitiveArea(Point2D pt)
Returns true if pt is in the area painted by this shape painter

paint

public void paint(Graphics2D g2d)
Paints the specified shape using the specified Graphics2D.

Parameters: g2d the Graphics2D to use

setShape

public void setShape(Shape shape)
Sets the Shape this shape painter is associated with.

Parameters: shape new shape this painter should be associated with. Should not be null.

Copyright B) 2007 Apache Software Foundation. All Rights Reserved.