Rectangle
Overview
Rectangle is a class in Aspose.PSD FOSS for Java.
Stores a set of four integers that represent the location and size of a rectangle.
This class declares 47 methods for Rectangle objects in Java programs.
Available methods include: Rectangle, ceiling, contains, equals, fromLTRB, fromLeftTopRightBottom, fromPoints, getBottom, getHeight, getLeft, getLocation, getRight, and 26 additional methods.
Public members are accessible to any Java application after installing the Aspose.PSD FOSS for Java package.
Properties: EMPTY, bottom, empty, height, left, location, and 6 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
x | int | Read/Write | Gets or sets the x. |
y | int | Read/Write | Gets or sets the y. |
width | int | Read/Write | Gets or sets the width. |
height | int | Read/Write | Gets or sets the height. |
bottom | int | Read/Write | Gets or sets the bottom. |
empty | boolean | Read | Gets the empty. |
left | int | Read/Write | Gets or sets the left. |
location | Point | Read/Write | Gets or sets the location. |
right | int | Read/Write | Gets or sets the right. |
size | Size | Read/Write | Gets or sets the size. |
top | int | Read/Write | Gets or sets the top. |
EMPTY | Rectangle | Read | Represents a Rectangle structure with its properties left uninitialized. |
Methods
| Signature | Description |
|---|---|
Rectangle(location: Point, size: Size) | Initializes a new instance of the Rectangle structure with the specified location and size. |
Rectangle(x: int, y: int, width: int, height: int) | Initializes a new instance of the Rectangle structure with the specified coordinates. |
Rectangle() | Creates a new Rectangle instance. |
getX() → int | Returns the x. |
setX(x: int) | Sets the x value. |
getY() → int | Returns the y. |
setY(y: int) | Sets the y value. |
getWidth() → int | Returns the width. |
setWidth(width: int) | Sets the width value. |
getHeight() → int | Returns the height. |
setHeight(height: int) | Sets the height value. |
getBottom() → int | Returns the bottom. |
setBottom(bottom: int) | Sets the bottom value. |
isEmpty() → boolean | Returns true if empty is set. |
getLeft() → int | Returns the left. |
setLeft(left: int) | Sets the left value. |
getLocation() → Point | Returns the location. |
setLocation(location: Point) | Sets the location value. |
getRight() → int | Returns the right. |
setRight(right: int) | Sets the right value. |
getSize() → Size | Returns the size. |
setSize(size: Size) | Sets the size value. |
getTop() → int | Returns the top. |
setTop(top: int) | Sets the top value. |
ceiling(value: RectangleF) → Rectangle | Converts a RectangleF structure to a Rectangle structure by rounding up the coordinates and size. |
fromLeftTopRightBottom(left: int, top: int, right: int, bottom: int) → Rectangle | Creates a rectangle from edge coordinates. |
fromLTRB(left: int, top: int, right: int, bottom: int) → Rectangle | Creates a rectangle from edge coordinates for internal PSD record parsing. |
fromPoints(point1: Point, point2: Point) → Rectangle | Creates a rectangle that spans the specified points. |
inflate(rectangle: Rectangle, x: int, y: int) → Rectangle | Creates and returns an inflated copy of the specified rectangle. |
intersect(a: Rectangle, b: Rectangle) → Rectangle | Returns a rectangle that represents the intersection of two rectangles. |
round(value: RectangleF) → Rectangle | Converts a RectangleF structure to a Rectangle structure by rounding the coordinates and size. |
truncate(value: RectangleF) → Rectangle | Converts a RectangleF structure to a Rectangle structure by truncating the coordinates and size. |
union(a: Rectangle, b: Rectangle) → Rectangle | Returns a rectangle that contains the union of two rectangles. |
contains(point: Point) → boolean | Determines whether the specified point is contained within this Rectangle. |
contains(rectangle: Rectangle) → boolean | Determines whether the rectangular region represented by the specified rectangle is entirely contained within this Rectangle. |
contains(x: int, y: int) → boolean | Determines whether the specified point is contained within this Rectangle. |
equals(other: Rectangle) → boolean | Determines whether the specified rectangle is equal to this rectangle. |
equals(obj: Object) → boolean | Calls equals(obj) on this Rectangle instance. |
hashCode() → int | Calls hashCode on this Rectangle instance. |
inflate(size: Size) | Inflates this rectangle by the specified size. |
inflate(width: int, height: int) | Inflates this rectangle by the specified horizontal and vertical amounts. |
intersect(rectangle: Rectangle) | Replaces this rectangle with its intersection with the specified rectangle. |
intersectsWith(rectangle: Rectangle) → boolean | Determines whether this rectangle intersects with the specified rectangle. |
normalize() | Normalizes this rectangle so that width and height are non-negative. |
offset(point: Point) | Moves this rectangle by the specified point. |
offset(x: int, y: int) | Moves this rectangle by the specified horizontal and vertical amounts. |
toString() → String | Calls toString on this Rectangle instance. |