Package 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.- Version:
- $Id: StrokeShapePainter.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.PaintpaintThe paint attribute used to draw the outline of the shape.protected java.awt.ShapeshapeShape painted by this painter.protected java.awt.StrokestrokeThe stroke attribute used to draw the outline of the shape.protected java.awt.ShapestrokedShapeStroked version of the shape.
-
Constructor Summary
Constructors Constructor Description StrokeShapePainter(java.awt.Shape shape)Constructs a newShapePainterthat can be used to draw the outline of aShape.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.PaintgetPaint()Gets the paint used to draw the outline of the shape.java.awt.ShapegetPaintedArea()Returns the area painted by this shape painter.java.awt.geom.Rectangle2DgetPaintedBounds2D()Returns the bounds of the area painted by this shape painterjava.awt.ShapegetSensitiveArea()Returns the area covered by this shape painter (even if not painted).java.awt.geom.Rectangle2DgetSensitiveBounds2D()Returns the bounds of the area covered by this shape painter (even if not painted).java.awt.ShapegetShape()Gets the Shape this shape painter is associated with.java.awt.StrokegetStroke()Gets the stroke used to draw the outline of the shape.booleaninPaintedArea(java.awt.geom.Point2D pt)Returns the bounds of the area covered by this shape painterbooleaninSensitiveArea(java.awt.geom.Point2D pt)Returns the bounds of the area covered by this shape painter (even if not painted).voidpaint(java.awt.Graphics2D g2d)Paints the outline of the specified shape using the specified Graphics2D.voidsetPaint(java.awt.Paint newPaint)Sets the paint used to fill a shape.voidsetShape(java.awt.Shape shape)Sets the Shape this shape painter is associated with.voidsetStroke(java.awt.Stroke newStroke)Sets the stroke used to draw the outline of a shape.
-
-
-
Field Detail
-
shape
protected java.awt.Shape shape
Shape painted by this painter.
-
strokedShape
protected java.awt.Shape strokedShape
Stroked version of the shape.
-
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.
-
-
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
-
getStroke
public java.awt.Stroke getStroke()
Gets the stroke 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
-
getPaint
public java.awt.Paint getPaint()
Gets the paint used to draw the outline of the shape.
-
paint
public void paint(java.awt.Graphics2D g2d)
Paints the outline of the specified shape using the specified Graphics2D.- Specified by:
paintin interfaceShapePainter- Parameters:
g2d- the Graphics2D to use
-
getPaintedArea
public java.awt.Shape getPaintedArea()
Returns the area painted by this shape painter.- Specified by:
getPaintedAreain interfaceShapePainter
-
getPaintedBounds2D
public java.awt.geom.Rectangle2D getPaintedBounds2D()
Returns the bounds of the area painted by this shape painter- Specified by:
getPaintedBounds2Din interfaceShapePainter
-
inPaintedArea
public boolean inPaintedArea(java.awt.geom.Point2D pt)
Returns the bounds of the area covered by this shape painter- Specified by:
inPaintedAreain interfaceShapePainter
-
getSensitiveArea
public java.awt.Shape getSensitiveArea()
Returns the area covered by this shape painter (even if not painted).- Specified by:
getSensitiveAreain interfaceShapePainter
-
getSensitiveBounds2D
public java.awt.geom.Rectangle2D getSensitiveBounds2D()
Returns the bounds of the area covered by this shape painter (even if not painted).- Specified by:
getSensitiveBounds2Din interfaceShapePainter
-
inSensitiveArea
public boolean inSensitiveArea(java.awt.geom.Point2D pt)
Returns the bounds of the area covered by this shape painter (even if not painted).- Specified by:
inSensitiveAreain interfaceShapePainter
-
setShape
public void setShape(java.awt.Shape shape)
Sets the Shape this shape painter is associated with.- Specified by:
setShapein interfaceShapePainter- Parameters:
shape- new shape this painter should be associated with. Should not be null.
-
getShape
public java.awt.Shape getShape()
Gets the Shape this shape painter is associated with.- Specified by:
getShapein interfaceShapePainter- Returns:
- shape associated with this painter.
-
-