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

NameTypeAccessDescription
xintRead/WriteGets or sets the x.
yintRead/WriteGets or sets the y.
widthintRead/WriteGets or sets the width.
heightintRead/WriteGets or sets the height.
bottomintRead/WriteGets or sets the bottom.
emptybooleanReadGets the empty.
leftintRead/WriteGets or sets the left.
locationPointRead/WriteGets or sets the location.
rightintRead/WriteGets or sets the right.
sizeSizeRead/WriteGets or sets the size.
topintRead/WriteGets or sets the top.
EMPTYRectangleReadRepresents a Rectangle structure with its properties left uninitialized.

Methods

SignatureDescription
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() → intReturns the x.
setX(x: int)Sets the x value.
getY() → intReturns the y.
setY(y: int)Sets the y value.
getWidth() → intReturns the width.
setWidth(width: int)Sets the width value.
getHeight() → intReturns the height.
setHeight(height: int)Sets the height value.
getBottom() → intReturns the bottom.
setBottom(bottom: int)Sets the bottom value.
isEmpty() → booleanReturns true if empty is set.
getLeft() → intReturns the left.
setLeft(left: int)Sets the left value.
getLocation() → PointReturns the location.
setLocation(location: Point)Sets the location value.
getRight() → intReturns the right.
setRight(right: int)Sets the right value.
getSize() → SizeReturns the size.
setSize(size: Size)Sets the size value.
getTop() → intReturns the top.
setTop(top: int)Sets the top value.
ceiling(value: RectangleF) → RectangleConverts a RectangleF structure to a Rectangle structure by rounding up the coordinates and size.
fromLeftTopRightBottom(left: int, top: int, right: int, bottom: int) → RectangleCreates a rectangle from edge coordinates.
fromLTRB(left: int, top: int, right: int, bottom: int) → RectangleCreates a rectangle from edge coordinates for internal PSD record parsing.
fromPoints(point1: Point, point2: Point) → RectangleCreates a rectangle that spans the specified points.
inflate(rectangle: Rectangle, x: int, y: int) → RectangleCreates and returns an inflated copy of the specified rectangle.
intersect(a: Rectangle, b: Rectangle) → RectangleReturns a rectangle that represents the intersection of two rectangles.
round(value: RectangleF) → RectangleConverts a RectangleF structure to a Rectangle structure by rounding the coordinates and size.
truncate(value: RectangleF) → RectangleConverts a RectangleF structure to a Rectangle structure by truncating the coordinates and size.
union(a: Rectangle, b: Rectangle) → RectangleReturns a rectangle that contains the union of two rectangles.
contains(point: Point) → booleanDetermines whether the specified point is contained within this Rectangle.
contains(rectangle: Rectangle) → booleanDetermines whether the rectangular region represented by the specified rectangle is entirely contained within this Rectangle.
contains(x: int, y: int) → booleanDetermines whether the specified point is contained within this Rectangle.
equals(other: Rectangle) → booleanDetermines whether the specified rectangle is equal to this rectangle.
equals(obj: Object) → booleanCalls equals(obj) on this Rectangle instance.
hashCode() → intCalls 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) → booleanDetermines 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() → StringCalls toString on this Rectangle instance.

See Also