Class Bounds
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.types.Bounds
- All Implemented Interfaces:
Serializable,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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidextend(double x, double y) Extends the bounds to contain the point with the given coordinates, updating the minimum and maximum corners as needed.voidExtends the bounds to contain the given points.Returns the bottom-left point of the bounds.Returns the bottom-right point of the boundsReturns the center point of the bounds.getMax()The bottom right corner of the rectangle.getMin()The top left corner of the rectangle.Returns the top-left point of the boundsReturns the bottom-left point of the bounds.voidSets the bottom right corner of the rectangle.voidSets the top left corner of the rectangle.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.types.BasicType
getLeafletType
-
Constructor Details
-
Bounds
public Bounds()Creates an empty bounds. The minimum corner is initialized to negative infinity and the maximum corner toDouble.MAX_VALUE, so that the first point added viaextend(Point...)defines the actual area. -
Bounds
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
The top left corner of the rectangle.- Returns:
- the top left corner of the rectangle.
-
setMin
Sets the top left corner of the rectangle.- Parameters:
min- the top left corner of the rectangle
-
getMax
The bottom right corner of the rectangle.- Returns:
- return the bottom right corner of the rectangle.
-
setMax
Sets the bottom right corner of the rectangle.- Parameters:
max- the bottom right corner of the rectangle
-
getBottomLeft
Returns the bottom-left point of the bounds.- Returns:
- the bottom-left point of the bounds.
-
getTopRight
Returns the bottom-left point of the bounds.- Returns:
- the bottom-left point of the bounds.
-
getTopLeft
Returns the top-left point of the bounds- Returns:
- the top-left point of the bounds
-
getBottomRight
Returns the bottom-right point of the bounds- Returns:
- the bottom-right point of the bounds
-
extend
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 includey- the y coordinate to include
-
getCenter
Returns the center point of the bounds.- Returns:
- the center point of the bounds
-
toString
-