org.apache.batik.gvt

Class StrokeShapePainter

public class StrokeShapePainter extends Object implements ShapePainter

A shape painter that can be used to draw the outline of a shape.
Field Summary
protected Paintpaint
The paint attribute used to draw the outline of the shape.
protected Shapeshape
Shape painted by this painter.
protected Strokestroke
The stroke attribute used to draw the outline of the shape.
protected ShapestrokedShape
Stroked version of the shape.
Constructor Summary
StrokeShapePainter(Shape shape)
Constructs a new ShapePainter that can be used to draw the outline of a Shape.
Method Summary
PaintgetPaint()
Gets the paint used to draw the outline of the shape.
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 not painted).
Rectangle2DgetSensitiveBounds2D()
Returns the bounds of the area covered by this shape painter (even if not painted).
ShapegetShape()
Gets the Shape this shape painter is associated with.
StrokegetStroke()
Gets the stroke used to draw the outline of the shape.
booleaninPaintedArea(Point2D pt)
Returns the bounds of the area covered by this shape painter
booleaninSensitiveArea(Point2D pt)
Returns the bounds of the area covered by this shape painter (even if not painted).
voidpaint(Graphics2D g2d)
Paints the outline of the specified shape using the specified Graphics2D.
voidsetPaint(Paint newPaint)
Sets the paint used to fill a shape.
voidsetShape(Shape shape)
Sets the Shape this shape painter is associated with.
voidsetStroke(Stroke newStroke)
Sets the stroke used to draw the outline of a shape.

Field Detail

paint

protected Paint paint
The paint attribute used to draw the outline of the shape.

shape

protected Shape shape
Shape painted by this painter.

stroke

protected Stroke stroke
The stroke attribute used to draw the outline of the shape.

strokedShape

protected Shape strokedShape
Stroked version of the shape.

Constructor Detail

StrokeShapePainter

public StrokeShapePainter(Shape shape)
Constructs a new ShapePainter that can be used to draw the outline of a Shape.

Parameters: shape shape to be painted by this painter. Should not be null.

Method Detail

getPaint

public Paint getPaint()
Gets the paint used to draw the outline of the shape.

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 not painted).

getSensitiveBounds2D

public Rectangle2D getSensitiveBounds2D()
Returns the bounds of the area covered by this shape painter (even if not painted).

getShape

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

Returns: shape associated with this painter.

getStroke

public Stroke getStroke()
Gets the stroke used to draw the outline of the shape.

inPaintedArea

public boolean inPaintedArea(Point2D pt)
Returns the bounds of the area covered by this shape painter

inSensitiveArea

public boolean inSensitiveArea(Point2D pt)
Returns the bounds of the area covered by this shape painter (even if not painted).

paint

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

Parameters: g2d the Graphics2D to use

setPaint

public void setPaint(Paint newPaint)
Sets the paint used to fill a shape.

Parameters: newPaint the paint object used to draw the shape

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.

setStroke

public void setStroke(Stroke newStroke)
Sets the stroke used to draw the outline of a shape.

Parameters: newStroke the stroke object used to draw the outline of the shape

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