Package com.github.ngoanh2n
Class Rectangle
java.lang.Object
com.github.ngoanh2n.Rectangle
A copy of java.awt.Rectangle.
Repository:
Repository:
- GitHub: ngoanh2n/commons
- Maven: com.github.ngoanh2n:commons
- Since:
- 2021
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get height of thisRectangle
.Get location of thisRectangle
.getSize()
Get size of thisRectangle
.int
getWidth()
Get width of thisRectangle
.int
getX()
Get the X coordinate of thisRectangle
.int
getY()
Get the Y coordinate of thisRectangle
.setLocation
(Point value) Set value for thisRectangle
.Set size for thisRectangle
.toString()
Returns a string representation of thisRectangle
.
-
Constructor Details
-
Rectangle
- Parameters:
dimension
- The size of the newly constructedRectangle
.
-
Rectangle
- Parameters:
point
- The position of the newly constructedRectangle
.dimension
- The size of the newly constructedRectangle
.
-
Rectangle
public Rectangle(int x, int y, int w, int h) - Parameters:
x
- The X coordinate of the newly constructedPoint
.y
- The Y coordinate of the newly constructedPoint
.w
- The width of the newly constructedDimension
.h
- The height of the newly constructedDimension
.
-
-
Method Details
-
getX
public int getX()Get the X coordinate of thisRectangle
.- Returns:
- The X coordinate of this
Rectangle
.
-
getY
public int getY()Get the Y coordinate of thisRectangle
.- Returns:
- The Y coordinate of this
Rectangle
.
-
getWidth
public int getWidth()Get width of thisRectangle
.- Returns:
- The width of this
Rectangle
.
-
getHeight
public int getHeight()Get height of thisRectangle
.- Returns:
- The height of this
Rectangle
.
-
getLocation
Get location of thisRectangle
.- Returns:
- The location of this
Rectangle
.
-
setLocation
Set value for thisRectangle
.- Parameters:
value
- The new value for thisRectangle
.- Returns:
- This
Rectangle
.
-
getSize
Get size of thisRectangle
.- Returns:
- The size of this
Rectangle
.
-
setSize
Set size for thisRectangle
.- Parameters:
value
- The new size for thisRectangle
.- Returns:
- This
Rectangle
.
-
toString
Returns a string representation of thisRectangle
.
-