public interface Rect
| Modifier and Type | Method and Description |
|---|---|
static Rect |
empty()
Returns an empty
Rect with empty origin and size. |
default int |
height()
Returns the rectangle vertical dimension.
|
static Rect |
of(int width,
int height)
Returns the
Rect instance for the given width and height values. |
static Rect |
of(int x,
int y,
int width,
int height)
Returns the
Rect instance for the given x, y, width, and
height values. |
static Rect |
of(Point origin,
Size size)
Returns the
Rect instance for the given origin and size values. |
static Rect |
of(Size size)
Returns the
Rect instance for the empty origin and the given size value. |
default Point |
origin()
Returns the upper-left corner of the rectangle.
|
default Size |
size()
Returns the rectangle dimensions.
|
default int |
width()
Returns the rectangle horizontal dimension.
|
default int |
x()
Returns the horizontal coordinate of the upper-left corner of the rectangle.
|
default int |
y()
Returns the vertical coordinate of the upper-left corner of the rectangle.
|
static Rect empty()
Rect with empty origin and size.static Rect of(int width, int height)
Rect instance for the given width and height values.java.lang.IllegalArgumentException - when width or height is negativestatic Rect of(int x, int y, int width, int height)
Rect instance for the given x, y, width, and
height values.java.lang.IllegalArgumentException - when width or height is negativestatic Rect of(Size size)
Rect instance for the empty origin and the given size value.static Rect of(Point origin, Size size)
Rect instance for the given origin and size values.default Point origin()
default int x()
default int y()
default int width()
default int height()
default Size size()