Class Rectangle2D

java.lang.Object
org.htmlunit.util.geometry.Rectangle2D
All Implemented Interfaces:
Shape2D

public class Rectangle2D extends Object implements Shape2D
Simple 2D shape rectangle.
  • Field Details

    • left_

      private double left_
    • top_

      private double top_
    • right_

      private double right_
    • bottom_

      private double bottom_
  • Constructor Details

    • 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 Details

    • 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)
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Shape2D
      Returns:
      true if the Shape is empty.
    • toString

      public String toString()
      Overrides:
      toString in class Object