org.apache.batik.gvt

Class ShapeNode

public class ShapeNode extends AbstractGraphicsNode

A graphics node that represents a shape.
Field Summary
protected Shapeshape
The shape that describes this ShapeNode.
protected ShapePaintershapePainter
The shape painter used to paint the shape of this shape node.
Constructor Summary
ShapeNode()
Constructs a new empty ShapeNode.
Method Summary
booleancontains(Point2D p)
Returns true if the specified Point2D is inside the boundary of this node, false otherwise.
Rectangle2DgetGeometryBounds()
Returns the bounds of the area covered by this node, without taking any of its rendering attribute into account.
ShapegetOutline()
Returns the outline of this node.
Rectangle2DgetPrimitiveBounds()
Returns the bounds of the area covered by this node's primitive paint.
ShapegetSensitiveArea()
Returns the shape that represents the sensitive area of this graphics node.
Rectangle2DgetSensitiveBounds()
Returns the bounds of the sensitive area covered by this node, This includes the stroked area but does not include the effects of clipping, masking or filtering.
ShapegetShape()
Returns the shape of this ShapeNode.
ShapePaintergetShapePainter()
Returns the ShapePainter used by this shape node to render its shape.
booleaninSensitiveArea(Point2D pt)
booleanintersects(Rectangle2D r)
Returns true if the interior of this node intersects the interior of a specified Rectangle2D, false otherwise.
protected voidinvalidateGeometryCache()
Invalidates this ShapeNode.
voidpaint(Graphics2D g2d)
Paints this node.
voidprimitivePaint(Graphics2D g2d)
Paints this node without applying Filter, Mask, Composite, and clip.
voidsetPointerEventType(int pointerEventType)
voidsetShape(Shape newShape)
Sets the shape of this ShapeNode.
voidsetShapePainter(ShapePainter newShapePainter)
Sets the ShapePainter used by this shape node to render its shape.

Field Detail

shape

protected Shape shape
The shape that describes this ShapeNode.

shapePainter

protected ShapePainter shapePainter
The shape painter used to paint the shape of this shape node.

Constructor Detail

ShapeNode

public ShapeNode()
Constructs a new empty ShapeNode.

Method Detail

contains

public boolean contains(Point2D p)
Returns true if the specified Point2D is inside the boundary of this node, false otherwise.

Parameters: p the specified Point2D in the user space

getGeometryBounds

public Rectangle2D getGeometryBounds()
Returns the bounds of the area covered by this node, without taking any of its rendering attribute into account. That is, exclusive of any clipping, masking, filtering or stroking, for example.

getOutline

public Shape getOutline()
Returns the outline of this node.

getPrimitiveBounds

public Rectangle2D getPrimitiveBounds()
Returns the bounds of the area covered by this node's primitive paint.

getSensitiveArea

public Shape getSensitiveArea()
Returns the shape that represents the sensitive area of this graphics node.

getSensitiveBounds

public Rectangle2D getSensitiveBounds()
Returns the bounds of the sensitive area covered by this node, This includes the stroked area but does not include the effects of clipping, masking or filtering.

getShape

public Shape getShape()
Returns the shape of this ShapeNode.

getShapePainter

public ShapePainter getShapePainter()
Returns the ShapePainter used by this shape node to render its shape.

inSensitiveArea

public boolean inSensitiveArea(Point2D pt)

intersects

public boolean intersects(Rectangle2D r)
Returns true if the interior of this node intersects the interior of a specified Rectangle2D, false otherwise.

Parameters: r the specified Rectangle2D in the user node space

invalidateGeometryCache

protected void invalidateGeometryCache()
Invalidates this ShapeNode. This node and all its ancestors have been informed that all its cached values related to its bounds must be recomputed.

paint

public void paint(Graphics2D g2d)
Paints this node.

Parameters: g2d the Graphics2D to use

primitivePaint

public void primitivePaint(Graphics2D g2d)
Paints this node without applying Filter, Mask, Composite, and clip.

Parameters: g2d the Graphics2D to use

setPointerEventType

public void setPointerEventType(int pointerEventType)

setShape

public void setShape(Shape newShape)
Sets the shape of this ShapeNode.

Parameters: newShape the new shape of this shape node

setShapePainter

public void setShapePainter(ShapePainter newShapePainter)
Sets the ShapePainter used by this shape node to render its shape.

Parameters: newShapePainter the new ShapePainter to use

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