Interface Shape

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean contains​(double x, double y)
      Test if the shape contains the point (x,y)
      boolean contains​(double x, double y, double w, double h)
      Test if the shape contains the rectangle with top left at (x,y), width w and height h.
      boolean contains​(Point2D p)
      Test if the shape contains the Point2D
      boolean contains​(Rectangle2D r)
      Test if the shape contains the Rectangle2D
      RectangleInt32 getBounds()
      Get the bounding Rectangle for the shape
      Rectangle2D getBounds2D()
      Get the bounding Rectangle2D for the shape
      boolean intersects​(double x, double y, double w, double h)
      Test if the shape intersects the rectangle with top left at (x,y), width w and height h.
      boolean intersects​(Rectangle2D r)
      Test if the shape intersects the Rectangle2D r
    • Method Detail

      • getBounds

        RectangleInt32 getBounds()
        Get the bounding Rectangle for the shape
        Returns:
        the bounding Rectangle
      • getBounds2D

        Rectangle2D getBounds2D()
        Get the bounding Rectangle2D for the shape
        Returns:
        the bounding Rectangle2D
      • contains

        boolean contains​(double x,
                         double y)
        Test if the shape contains the point (x,y)
        Parameters:
        x - the x co-ordinate of the point
        y - the y co-ordinate of the point
        Returns:
        true iff the shape contains the point
      • contains

        boolean contains​(Point2D p)
        Test if the shape contains the Point2D
        Parameters:
        p - the Point2D
        Returns:
        true iff the shape contains the point
      • intersects

        boolean intersects​(double x,
                           double y,
                           double w,
                           double h)
        Test if the shape intersects the rectangle with top left at (x,y), width w and height h.
        Parameters:
        x - the x-coordinate of the top left point of the rectangle
        y - the y-coordinate of the top left point of the rectangle
        w - the width of the rectangle
        h - the height of the rectangle
        Returns:
        true iff the shape intersects the rectangle
      • intersects

        boolean intersects​(Rectangle2D r)
        Test if the shape intersects the Rectangle2D r
        Parameters:
        r - the Recangle2D
        Returns:
        true iff the shape intersects the Rectangle2D
      • contains

        boolean contains​(double x,
                         double y,
                         double w,
                         double h)
        Test if the shape contains the rectangle with top left at (x,y), width w and height h.
        Parameters:
        x - the x-coordinate of the top left point of the rectangle
        y - the y-coordinate of the top left point of the rectangle
        w - the width of the rectangle
        h - the height of the rectangle
        Returns:
        true iff the shape contains the rectangle
      • contains

        boolean contains​(Rectangle2D r)
        Test if the shape contains the Rectangle2D
        Parameters:
        r - the Rectangle2D
        Returns:
        true iff the shape contains the Rectangle2D