java.lang.Object
org.vaadin.addons.componentfactory.leaflet.types.Bounds
All Implemented Interfaces:
Serializable, BasicType

public class Bounds extends Object implements BasicType
Represents a rectangular area in pixel coordinates.
Since:
2020-03-21
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
See Also:
  • Constructor Details

    • Bounds

      public Bounds()
      Creates an empty bounds. The minimum corner is initialized to negative infinity and the maximum corner to Double.MAX_VALUE, so that the first point added via extend(Point...) defines the actual area.
    • Bounds

      public Bounds(Point... point)
      Creates bounds that contain the given points. Starts from empty bounds and extends them to include each supplied point.
      Parameters:
      point - the points the bounds should contain
  • Method Details

    • getMin

      public Point getMin()
      The top left corner of the rectangle.
      Returns:
      the top left corner of the rectangle.
    • setMin

      public void setMin(Point min)
      Sets the top left corner of the rectangle.
      Parameters:
      min - the top left corner of the rectangle
    • getMax

      public Point getMax()
      The bottom right corner of the rectangle.
      Returns:
      return the bottom right corner of the rectangle.
    • setMax

      public void setMax(Point max)
      Sets the bottom right corner of the rectangle.
      Parameters:
      max - the bottom right corner of the rectangle
    • getBottomLeft

      public Point getBottomLeft()
      Returns the bottom-left point of the bounds.
      Returns:
      the bottom-left point of the bounds.
    • getTopRight

      public Point getTopRight()
      Returns the bottom-left point of the bounds.
      Returns:
      the bottom-left point of the bounds.
    • getTopLeft

      public Point getTopLeft()
      Returns the top-left point of the bounds
      Returns:
      the top-left point of the bounds
    • getBottomRight

      public Point getBottomRight()
      Returns the bottom-right point of the bounds
      Returns:
      the bottom-right point of the bounds
    • extend

      public void extend(Point... points)
      Extends the bounds to contain the given points.
      Parameters:
      points - the points the bounds should be extended to include
    • extend

      public void extend(double x, double y)
      Extends the bounds to contain the point with the given coordinates, updating the minimum and maximum corners as needed.
      Parameters:
      x - the x coordinate to include
      y - the y coordinate to include
    • getCenter

      public Point getCenter()
      Returns the center point of the bounds.
      Returns:
      the center point of the bounds
    • toString

      public String toString()
      Overrides:
      toString in class Object