org.apache.batik.gvt
Class StrokeShapePainter

java.lang.Object
  extended by org.apache.batik.gvt.StrokeShapePainter
All Implemented Interfaces:
ShapePainter

public class StrokeShapePainter
extends Object
implements ShapePainter

A shape painter that can be used to draw the outline of a shape.


Field Summary
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 Summary
StrokeShapePainter(Shape shape)
          Constructs a new ShapePainter that can be used to draw the outline of a Shape.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shape

protected Shape shape
Shape painted by this painter.


strokedShape

protected Shape strokedShape
Stroked version of the shape.


stroke

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


paint

protected Paint paint
The paint attribute used to draw the outline 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

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

getStroke

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


setPaint

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

Parameters:
newPaint - the paint object used to draw the shape

getPaint

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


paint

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

Specified by:
paint in interface ShapePainter
Parameters:
g2d - the Graphics2D to use

getPaintedArea

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

Specified by:
getPaintedArea in interface ShapePainter

getPaintedBounds2D

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

Specified by:
getPaintedBounds2D in interface ShapePainter

inPaintedArea

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

Specified by:
inPaintedArea in interface ShapePainter

getSensitiveArea

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

Specified by:
getSensitiveArea in interface ShapePainter

getSensitiveBounds2D

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

Specified by:
getSensitiveBounds2D in interface ShapePainter

inSensitiveArea

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

Specified by:
inSensitiveArea in interface ShapePainter

setShape

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

Specified by:
setShape in interface ShapePainter
Parameters:
shape - new shape this painter should be associated with. Should not be null.

getShape

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

Specified by:
getShape in interface ShapePainter
Returns:
shape associated with this painter.


Copyright © 2008 Apache Software Foundation. All Rights Reserved.