org.apache.batik.gvt
Class StrokeShapePainter

java.lang.Object
  |
  +--org.apache.batik.gvt.StrokeShapePainter
All Implemented Interfaces:
ShapePainter

public class StrokeShapePainter
extends java.lang.Object
implements ShapePainter

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


Field Summary
protected  java.awt.Paint paint
          The paint attribute used to draw the outline of the shape.
protected  java.awt.Shape shape
          Shape painted by this painter
protected  java.awt.Stroke stroke
          The stroke attribute used to draw the outline of the shape.
 
Constructor Summary
StrokeShapePainter(java.awt.Shape shape)
          Constructs a new ShapePainter that can be used to draw the outline of a Shape.
 
Method Summary
 java.awt.Shape getPaintedArea(GraphicsNodeRenderContext rc)
          Returns the area painted by this painter for a given input shape
 java.awt.Shape getShape()
          Gets the Shape this painter is associated with.
 void paint(java.awt.Graphics2D g2d, GraphicsNodeRenderContext ctx)
          Paints the outline of the specified shape using the specified Graphics2D and context.
 void setPaint(java.awt.Paint newPaint)
          Sets the paint used to fill a shape.
 void setShape(java.awt.Shape shape)
          Sets the Shape this painter is associated with.
 void setStroke(java.awt.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 java.awt.Shape shape
Shape painted by this painter

stroke

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

paint

protected java.awt.Paint paint
The paint attribute used to draw the outline of the shape.
Constructor Detail

StrokeShapePainter

public StrokeShapePainter(java.awt.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(java.awt.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

setPaint

public void setPaint(java.awt.Paint newPaint)
Sets the paint used to fill a shape.
Parameters:
newPaint - the paint object used to draw the shape

paint

public void paint(java.awt.Graphics2D g2d,
                  GraphicsNodeRenderContext ctx)
Paints the outline of the specified shape using the specified Graphics2D and context.
Specified by:
paint in interface ShapePainter
Parameters:
shape - the shape to paint
g2d - the Graphics2D to use
ctx - the render context to use

getPaintedArea

public java.awt.Shape getPaintedArea(GraphicsNodeRenderContext rc)
Returns the area painted by this painter for a given input shape
Specified by:
getPaintedArea in interface ShapePainter
Parameters:
shape - the shape to paint

setShape

public void setShape(java.awt.Shape shape)
Sets the Shape this 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 java.awt.Shape getShape()
Gets the Shape this painter is associated with.
Specified by:
getShape in interface ShapePainter
Returns:
shape associated with this Painter.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.