Class Rectangle
java.lang.Object
com.vaadin.featurepack.desktop.geometry.Rectangle
- All Implemented Interfaces:
Serializable
A class that represents a rectangle in 2D space.
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new rectangle with coordinates (0, 0) and size 0x0.Rectangle(int x, int y, int width, int height) Creates a new rectangle with the given coordinates and size.Creates a new rectangle from aPointandDimensionobjects.Creates a new rectangle clone of another Rectangle -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the height of the rectangle.Returns the location of this rectangle.getSize()Returns the size of this rectangle.intgetWidth()Returns the width of the rectangle.intgetX()Returns the x coordinate of the left side of the rectangle.intgetY()Returns the y coordinate of the top side of the rectangle.inthashCode()
-
Constructor Details
-
Rectangle
public Rectangle()Creates a new rectangle with coordinates (0, 0) and size 0x0. -
Rectangle
public Rectangle(int x, int y, int width, int height) Creates a new rectangle with the given coordinates and size.- Parameters:
x- the x coordinatey- the y coordinatewidth- the widthheight- the height
-
Rectangle
Creates a new rectangle from aPointandDimensionobjects.- Parameters:
p- the Point object representing the locationd- the Dimension object representing the size
-
Rectangle
Creates a new rectangle clone of another Rectangle- Parameters:
Rectangle- the Rectangle to clone
-
-
Method Details
-
getLocation
Returns the location of this rectangle.- Returns:
- the location
-
getSize
Returns the size of this rectangle.- Returns:
- the size
-
getX
public int getX()Returns the x coordinate of the left side of the rectangle.- Returns:
- the x coordinate
-
getY
public int getY()Returns the y coordinate of the top side of the rectangle.- Returns:
- the y coordinate
-
getWidth
public int getWidth()Returns the width of the rectangle.- Returns:
- the width
-
getHeight
public int getHeight()Returns the height of the rectangle.- Returns:
- the height
-
equals
-
hashCode
public int hashCode()
-