Class ImageNode

  • All Implemented Interfaces:
    java.lang.Iterable, java.util.Collection, java.util.List, GraphicsNode

    public class ImageNode
    extends CompositeGraphicsNode
    A graphics node that represents an image described as a graphics node.
    • Field Detail

      • hitCheckChildren

        protected boolean hitCheckChildren
    • Constructor Detail

      • ImageNode

        public ImageNode()
        Constructs a new empty ImageNode.
    • Method Detail

      • setVisible

        public void setVisible​(boolean isVisible)
        Description copied from class: CompositeGraphicsNode
        Sets if this node is visible or not depending on the specified value. Don't fire a graphicsNodeChange event because this doesn't really effect us (it effects our children through CSS inheritence).
        Specified by:
        setVisible in interface GraphicsNode
        Overrides:
        setVisible in class CompositeGraphicsNode
        Parameters:
        isVisible - If true this node is visible
      • 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).
      • getHitCheckChildren

        public boolean getHitCheckChildren()
      • paint

        public void paint​(java.awt.Graphics2D g2d)
        Paints this node.
        Specified by:
        paint in interface GraphicsNode
        Overrides:
        paint in class AbstractGraphicsNode
        Parameters:
        g2d - the Graphics2D to use
      • contains

        public boolean contains​(java.awt.geom.Point2D p)
        Returns true if the specified Point2D is inside the boundary of this node, false otherwise.
        Specified by:
        contains in interface GraphicsNode
        Overrides:
        contains in class CompositeGraphicsNode
        Parameters:
        p - the specified Point2D in the user space
      • nodeHitAt

        public GraphicsNode nodeHitAt​(java.awt.geom.Point2D p)
        Returns the GraphicsNode containing point p if this node or one of its children is sensitive to mouse events at p.
        Specified by:
        nodeHitAt in interface GraphicsNode
        Overrides:
        nodeHitAt in class CompositeGraphicsNode
        Parameters:
        p - the specified Point2D in the user space
      • setImage

        public void setImage​(GraphicsNode newImage)
        Sets the graphics node that represents the image.
        Parameters:
        newImage - the new graphics node that represents the image
      • getImage

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