public class StrokeShapePainter extends Object implements ShapePainter
Modifier and Type | Field and Description |
---|---|
protected Paint |
paint
The paint attribute used to draw the outline of the shape.
|
protected Shape |
shape
Shape painted by this painter.
|
protected Stroke |
stroke
The stroke attribute used to draw the outline of the shape.
|
protected Shape |
strokedShape
Stroked version of the shape.
|
Constructor and Description |
---|
StrokeShapePainter(Shape shape)
Constructs a new
ShapePainter that can be used to draw the
outline of a Shape . |
Modifier and Type | Method and Description |
---|---|
Paint |
getPaint()
Gets the paint used to draw the outline of the shape.
|
Shape |
getPaintedArea()
Returns the area painted by this shape painter.
|
Rectangle2D |
getPaintedBounds2D()
Returns the bounds of the area painted by this shape painter
|
Shape |
getSensitiveArea()
Returns the area covered by this shape painter (even if not painted).
|
Rectangle2D |
getSensitiveBounds2D()
Returns the bounds of the area covered by this shape painter
(even if not painted).
|
Shape |
getShape()
Gets the Shape this shape painter is associated with.
|
Stroke |
getStroke()
Gets the stroke used to draw the outline of the shape.
|
boolean |
inPaintedArea(Point2D pt)
Returns the bounds of the area covered by this shape painter
|
boolean |
inSensitiveArea(Point2D pt)
Returns the bounds of the area covered by this shape painter
(even if not painted).
|
void |
paint(Graphics2D g2d)
Paints the outline of the specified shape using the specified
Graphics2D.
|
void |
setPaint(Paint newPaint)
Sets the paint used to fill a shape.
|
void |
setShape(Shape shape)
Sets the Shape this shape painter is associated with.
|
void |
setStroke(Stroke newStroke)
Sets the stroke used to draw the outline of a shape.
|
protected Shape shape
protected Shape strokedShape
protected Stroke stroke
protected Paint paint
public StrokeShapePainter(Shape shape)
ShapePainter
that can be used to draw the
outline of a Shape
.shape
- shape to be painted by this painter.
Should not be null.public void setStroke(Stroke newStroke)
newStroke
- the stroke object used to draw the outline of the shapepublic Stroke getStroke()
public void setPaint(Paint newPaint)
newPaint
- the paint object used to draw the shapepublic Paint getPaint()
public void paint(Graphics2D g2d)
paint
in interface ShapePainter
g2d
- the Graphics2D to usepublic Shape getPaintedArea()
getPaintedArea
in interface ShapePainter
public Rectangle2D getPaintedBounds2D()
getPaintedBounds2D
in interface ShapePainter
public boolean inPaintedArea(Point2D pt)
inPaintedArea
in interface ShapePainter
public Shape getSensitiveArea()
getSensitiveArea
in interface ShapePainter
public Rectangle2D getSensitiveBounds2D()
getSensitiveBounds2D
in interface ShapePainter
public boolean inSensitiveArea(Point2D pt)
inSensitiveArea
in interface ShapePainter
public void setShape(Shape shape)
setShape
in interface ShapePainter
shape
- new shape this painter should be associated with.
Should not be null.public Shape getShape()
getShape
in interface ShapePainter
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.