JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.util.geometry

Class Rectangle2D

  • All Implemented Interfaces:
    Shape2D


    public class Rectangle2D
    extends Object
    implements Shape2D 
    Simple 2D shape rectangle.
    Author:
    Ronald Brill
    • Constructor Detail

      • Rectangle2D

        public Rectangle2D(double x1,
         double y1,
         double x2,
         double y2)
        Ctor.
        Parameters:
        x1 - x value of the first corner
        y1 - y value of the first corner
        x2 - x value of the second corner
        y2 - y value of the second corner
    • Method Detail

      • getLeft

        public double getLeft()
        Returns:
        the x coord of the leftmost corner.
      • getBottom

        public double getBottom()
        Returns:
        the y coord of the bottom line.
      • contains

        public boolean contains(double x,
         double y)
        Specified by:
        contains in interface Shape2D
        Parameters:
        x - point x value
        y - point y value
        Returns:
        true if the specified point is inside; false otherwise.
      • extend

        public void extend(double x,
         double y)
        Makes sure the provided point is part of the extended Rectangle2D by moving the right or left border to include y and moving the top or bottom border to include y.
        Parameters:
        x - the x position to include
        y - the y position to include
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Shape2D
        Returns:
        true if the Shape is empty.
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /