Package com.teamdev.jxbrowser.ui
Interface Rect
public interface Rect
A rectangle described by the location and dimensions.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Pointcenter()Returns the center point of the rectangle in the global coordinate system.static Rectempty()Returns an emptyRectwith empty origin and size.default intheight()Returns the rectangle vertical dimension.static Rectof(int width, int height) Returns theRectinstance for the givenwidthandheightvalues.static Rectof(int x, int y, int width, int height) Returns theRectinstance for the givenx,y,width, andheightvalues.static RectReturns theRectinstance for the givenoriginandsizevalues.static RectReturns theRectinstance for the empty origin and the givensizevalue.default Pointorigin()Returns the upper-left corner of the rectangle.default Sizesize()Returns the rectangle dimensions.default intwidth()Returns the rectangle horizontal dimension.default intx()Returns the horizontal coordinate of the upper-left corner of the rectangle.default inty()Returns the vertical coordinate of the upper-left corner of the rectangle.
-
Method Details
-
empty
Returns an emptyRectwith empty origin and size. -
of
Returns theRectinstance for the givenwidthandheightvalues.- Throws:
IllegalArgumentException- whenwidthorheightis negative
-
of
Returns theRectinstance for the givenx,y,width, andheightvalues.- Throws:
IllegalArgumentException- whenwidthorheightis negative
-
of
Returns theRectinstance for the empty origin and the givensizevalue. -
of
Returns theRectinstance for the givenoriginandsizevalues. -
origin
Returns the upper-left corner of the rectangle. -
x
default int x()Returns the horizontal coordinate of the upper-left corner of the rectangle. -
y
default int y()Returns the vertical coordinate of the upper-left corner of the rectangle. -
width
default int width()Returns the rectangle horizontal dimension. -
height
default int height()Returns the rectangle vertical dimension. -
center
Returns the center point of the rectangle in the global coordinate system.Since the coordinates are integers, the standard rules of Java integer division rounding apply.
-
size
Returns the rectangle dimensions.
-