org.apache.batik.refimpl.gvt
Class ConcreteShapeNode

java.lang.Object
  |
  +--org.apache.batik.refimpl.gvt.AbstractGraphicsNode
        |
        +--org.apache.batik.refimpl.gvt.ConcreteShapeNode
All Implemented Interfaces:
GraphicsNode, LeafGraphicsNode, ShapeNode

public class ConcreteShapeNode
extends AbstractGraphicsNode
implements ShapeNode

An implementation of the ShapeNode interface.


Field Summary
protected  java.awt.Shape shape
          The shape that describes this ShapeNode.
protected  ShapePainter shapePainter
          The shape painter used to paint the shape of this shape node.
 
Fields inherited from class org.apache.batik.refimpl.gvt.AbstractGraphicsNode
clip, composite, cursor, eventFilter, filter, hints, hitDetector, isVisible, listeners, mask, mememtos, parent, root, transform
 
Fields inherited from interface org.apache.batik.gvt.GraphicsNode
KEY_AREA_OF_INTEREST
 
Constructor Summary
ConcreteShapeNode()
          Constructs a new empty shape node.
 
Method Summary
 boolean contains(java.awt.geom.Point2D p)
          Tests if the specified Point2D is inside the boundary of this node.
 java.awt.geom.Rectangle2D getGeometryBounds()
          Returns the bounds of the area covered by this node, without taking any of its rendering attribute into account, i.e., exclusive of any clipping, masking, filtering or stroking, for example.
 java.awt.Shape getOutline()
          Returns the outline of this node.
 java.awt.geom.Rectangle2D getPrimitiveBounds()
          Returns the bounds of the area covered by this node's primitive paint.
 java.awt.Shape getShape()
          Returns the shape of this shape node.
 ShapePainter getShapePainter()
          Returns the ShapePainter used by this shape node to render the shape.
 boolean hasProgressivePaint()
          Returns true if this node needs a progressive paint, false otherwise.
 boolean intersects(java.awt.geom.Rectangle2D r)
          Tests if the interior of this node intersects the interior of a specified Rectangle2D.
protected  void invalidateGeometryCache()
          Invalidates the cached geometric bounds.
 void primitivePaint(java.awt.Graphics2D g2d, GraphicsNodeRenderContext rc)
          Paints this node without applying Filter, Mask, Composite and clip.
 void progressivePaint(java.awt.Graphics2D g2d, GraphicsNodeRenderContext rc)
          Paints one step of this node rendering operations.
 void setShape(java.awt.Shape newShape)
          Sets the shape of this shape node.
 void setShapePainter(ShapePainter newShapePainter)
          Sets the ShapePainter used by this shape node to render the shape.
 
Methods inherited from class org.apache.batik.refimpl.gvt.AbstractGraphicsNode
acceptEvent, addGraphicsNodeKeyListener, addGraphicsNodeMouseListener, addPropertyChangeListener, addPropertyChangeListener, dispatch, fireGraphicsNodePaintListener, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getClip, getComposite, getCursor, getFilter, getGlobalBounds, getGlobalTransform, getGraphicsNodeEventFilter, getGraphicsNodeHitDetector, getListeners, getMask, getMemento, getParent, getRenderingHints, getRoot, getTransform, isAntialiasedClip, isOffscreenBufferNeeded, isVisible, nodeHitAt, paint, processChangeEvent, processKeyEvent, processMouseEvent, putMemento, removeGraphicsNodeKeyListener, removeGraphicsNodeMouseListener, removeMemento, removePropertyChangeListener, setClip, setComposite, setCursor, setFilter, setGraphicsNodeEventFilter, setGraphicsNodeHitDetector, setMask, setRenderingHint, setRenderingHints, setRenderingHints, setRoot, setTransform, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.batik.gvt.GraphicsNode
addGraphicsNodeKeyListener, addGraphicsNodeMouseListener, addPropertyChangeListener, addPropertyChangeListener, dispatch, getBounds, getClip, getComposite, getCursor, getFilter, getGlobalTransform, getGraphicsNodeEventFilter, getGraphicsNodeHitDetector, getListeners, getMask, getMemento, getParent, getRenderingHints, getRoot, getTransform, isVisible, nodeHitAt, paint, processKeyEvent, processMouseEvent, putMemento, removeGraphicsNodeKeyListener, removeGraphicsNodeMouseListener, removeMemento, removePropertyChangeListener, setClip, setComposite, setCursor, setFilter, setGraphicsNodeEventFilter, setGraphicsNodeHitDetector, setMask, setRenderingHint, setRenderingHints, setRenderingHints, setTransform, setVisible
 

Field Detail

shape

protected java.awt.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

ConcreteShapeNode

public ConcreteShapeNode()
Constructs a new empty shape node.
Method Detail

setShape

public void setShape(java.awt.Shape newShape)
Description copied from interface: ShapeNode
Sets the shape of this shape node.
Specified by:
setShape in interface ShapeNode
Following copied from interface: org.apache.batik.gvt.ShapeNode
Parameters:
newShape - the new shape of this shape node

getShape

public java.awt.Shape getShape()
Description copied from interface: ShapeNode
Returns the shape of this shape node.
Specified by:
getShape in interface ShapeNode
Following copied from interface: org.apache.batik.gvt.ShapeNode
Returns:
the shape of this shape node

setShapePainter

public void setShapePainter(ShapePainter newShapePainter)
Description copied from interface: ShapeNode
Sets the ShapePainter used by this shape node to render the shape.
Specified by:
setShapePainter in interface ShapeNode
Following copied from interface: org.apache.batik.gvt.ShapeNode
Parameters:
newShapePainter - the new ShapePainter to use

getShapePainter

public ShapePainter getShapePainter()
Description copied from interface: ShapeNode
Returns the ShapePainter used by this shape node to render the shape.
Specified by:
getShapePainter in interface ShapeNode
Following copied from interface: org.apache.batik.gvt.ShapeNode
Returns:
the ShapePainter used to render the shape

hasProgressivePaint

public boolean hasProgressivePaint()
Description copied from interface: GraphicsNode
Returns true if this node needs a progressive paint, false otherwise.
Specified by:
hasProgressivePaint in interface GraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Returns:
true if this node needs a progressive paint

progressivePaint

public void progressivePaint(java.awt.Graphics2D g2d,
                             GraphicsNodeRenderContext rc)
Description copied from interface: GraphicsNode
Paints one step of this node rendering operations.
Specified by:
progressivePaint in interface GraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Parameters:
g2d - the Graphics2D to use
rc - the GraphicsNodeRenderContext to use

primitivePaint

public void primitivePaint(java.awt.Graphics2D g2d,
                           GraphicsNodeRenderContext rc)
Description copied from interface: GraphicsNode
Paints this node without applying Filter, Mask, Composite and clip.
Specified by:
primitivePaint in interface GraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Parameters:
g2d - the Graphics2D to use
rc - the GraphicsNodeRenderContext to use

invalidateGeometryCache

protected void invalidateGeometryCache()
Description copied from class: AbstractGraphicsNode
Invalidates the cached geometric bounds. This method is called each time an attribute that affects the bounds of this node changed.
Overrides:
invalidateGeometryCache in class AbstractGraphicsNode

contains

public boolean contains(java.awt.geom.Point2D p)
Description copied from interface: GraphicsNode
Tests if the specified Point2D is inside the boundary of this node.
Specified by:
contains in interface GraphicsNode
Overrides:
contains in class AbstractGraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Parameters:
p - the specified Point2D in the user space
Returns:
true if the coordinates are inside, false otherwise

intersects

public boolean intersects(java.awt.geom.Rectangle2D r)
Description copied from interface: GraphicsNode
Tests if the interior of this node intersects the interior of a specified Rectangle2D.
Specified by:
intersects in interface GraphicsNode
Overrides:
intersects in class AbstractGraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Parameters:
r - the specified Rectangle2D in the user node space
Returns:
true if the rectangle intersects, false otherwise

getPrimitiveBounds

public java.awt.geom.Rectangle2D getPrimitiveBounds()
Description copied from interface: GraphicsNode
Returns the bounds of the area covered by this node's primitive paint.
Specified by:
getPrimitiveBounds in interface GraphicsNode

getGeometryBounds

public java.awt.geom.Rectangle2D getGeometryBounds()
Description copied from interface: GraphicsNode
Returns the bounds of the area covered by this node, without taking any of its rendering attribute into account, i.e., exclusive of any clipping, masking, filtering or stroking, for example.
Specified by:
getGeometryBounds in interface GraphicsNode

getOutline

public java.awt.Shape getOutline()
Description copied from interface: GraphicsNode
Returns the outline of this node.
Specified by:
getOutline in interface GraphicsNode
Following copied from interface: org.apache.batik.gvt.GraphicsNode
Returns:
the outline of this node


Copyright © 2000 Apache Software Foundation. All Rights Reserved.