public class CompositeShapePainter extends java.lang.Object implements ShapePainter
Modifier and Type | Field and Description |
---|---|
protected int |
count
The number of shape painter.
|
protected ShapePainter[] |
painters
The enclosed
ShapePainter s of this composite shape painter. |
protected java.awt.Shape |
shape
The shape associated with this painter
|
Constructor and Description |
---|
CompositeShapePainter(java.awt.Shape shape)
Constructs a new empty
CompositeShapePainter . |
Modifier and Type | Method and Description |
---|---|
void |
addShapePainter(ShapePainter shapePainter)
Adds the specified shape painter to the shape painter..
|
java.awt.Shape |
getPaintedArea()
Returns the area painted by this shape painter.
|
java.awt.geom.Rectangle2D |
getPaintedBounds2D()
Returns the bounds of the area painted by this shape painter
|
java.awt.Shape |
getSensitiveArea()
Returns the area covered by this shape painter (even if nothing
is painted there).
|
java.awt.geom.Rectangle2D |
getSensitiveBounds2D()
Returns the bounds of the area painted by this shape painter
|
java.awt.Shape |
getShape()
Gets the Shape this shape painter is associated with.
|
ShapePainter |
getShapePainter(int index)
Returns the shape painter at the specified index.
|
int |
getShapePainterCount()
Returns the number of shape painter of this composite shape painter.
|
boolean |
inPaintedArea(java.awt.geom.Point2D pt)
Returns true if pt is in the area painted by this shape painter
|
boolean |
inSensitiveArea(java.awt.geom.Point2D pt)
Returns true if pt is in the area painted by this shape painter
|
void |
paint(java.awt.Graphics2D g2d)
Paints the specified shape using the specified Graphics2D.
|
void |
setShape(java.awt.Shape shape)
Sets the Shape this shape painter is associated with.
|
protected java.awt.Shape shape
protected ShapePainter[] painters
ShapePainter
s of this composite shape painter.protected int count
public CompositeShapePainter(java.awt.Shape shape)
CompositeShapePainter
.public void addShapePainter(ShapePainter shapePainter)
shapePainter
- the shape painter to addpublic ShapePainter getShapePainter(int index)
index
- the index of the shape painter to returnpublic int getShapePainterCount()
public void paint(java.awt.Graphics2D g2d)
paint
in interface ShapePainter
g2d
- the Graphics2D to usepublic java.awt.Shape getPaintedArea()
getPaintedArea
in interface ShapePainter
public java.awt.geom.Rectangle2D getPaintedBounds2D()
getPaintedBounds2D
in interface ShapePainter
public boolean inPaintedArea(java.awt.geom.Point2D pt)
inPaintedArea
in interface ShapePainter
public java.awt.Shape getSensitiveArea()
getSensitiveArea
in interface ShapePainter
public java.awt.geom.Rectangle2D getSensitiveBounds2D()
getSensitiveBounds2D
in interface ShapePainter
public boolean inSensitiveArea(java.awt.geom.Point2D pt)
inSensitiveArea
in interface ShapePainter
public void setShape(java.awt.Shape shape)
setShape
in interface ShapePainter
shape
- new shape this painter should be associated with.
Should not be null.public java.awt.Shape getShape()
getShape
in interface ShapePainter
Copyright © 2022 Apache Software Foundation. All Rights Reserved.