org.apache.batik.gvt

Class ImageNode

public class ImageNode extends CompositeGraphicsNode

A graphics node that represents an image described as a graphics node.
Field Summary
protected booleanhitCheckChildren
Constructor Summary
ImageNode()
Constructs a new empty ImageNode.
Method Summary
booleancontains(Point2D p)
Returns true if the specified Point2D is inside the boundary of this node, false otherwise.
booleangetHitCheckChildren()
GraphicsNodegetImage()
Returns the graphics node that represents the image.
Rectangle2DgetPrimitiveBounds()
GraphicsNodenodeHitAt(Point2D p)
Returns the GraphicsNode containing point p if this node or one of its children is sensitive to mouse events at p.
voidpaint(Graphics2D g2d)
Paints this node.
voidsetHitCheckChildren(boolean hitCheckChildren)
If hitCheckChildren is true then nodeHitAt will return child nodes of this image.
voidsetImage(GraphicsNode newImage)
Sets the graphics node that represents the image.
voidsetVisible(boolean isVisible)

Field Detail

hitCheckChildren

protected boolean hitCheckChildren

Constructor Detail

ImageNode

public ImageNode()
Constructs a new empty ImageNode.

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

getHitCheckChildren

public boolean getHitCheckChildren()

getImage

public GraphicsNode getImage()
Returns the graphics node that represents the image.

getPrimitiveBounds

public Rectangle2D getPrimitiveBounds()

nodeHitAt

public GraphicsNode nodeHitAt(Point2D p)
Returns the GraphicsNode containing point p if this node or one of its children is sensitive to mouse events at p.

Parameters: p the specified Point2D in the user space

paint

public void paint(Graphics2D g2d)
Paints this node.

Parameters: g2d the Graphics2D to use

setHitCheckChildren

public void setHitCheckChildren(boolean hitCheckChildren)
If hitCheckChildren is true then nodeHitAt will return child nodes of this image. Otherwise it will only return this node (if the point is in the image).

setImage

public void setImage(GraphicsNode newImage)
Sets the graphics node that represents the image.

Parameters: newImage the new graphics node that represents the image

setVisible

public void setVisible(boolean isVisible)
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.