JPlanner Programmer's Guide
Rectangle Members
Constructors Fields Methods
 


Stores a set of four integers that represent the location and size of a rectangle. Instances of this class are immutable.

The following tables list the members exposed by the Rectangle type.

 Public Constructors

  Name Description

Rectangle

Overloaded. Initializes a new instance of the Rectangle class.

 Public Fields

  Name Description

Empty

Represents a rectangle with all properties set to zero.

 Public Methods

  Name Description

clone

Cloneable.clone implementation.

contains

Overloaded. Checks a point or a rectangle is contained within this rectangle.

equals

Checks whether this rectangle has the same values as the specified object.

fromLTRB

Creates a new Rectangle with the specified edge locations.

getBottom

Gets the y-coordinate of the bottom side of this rectangle.

getHeight

Gets the height of the upper-left corner of this rectangle.

getLeft

Gets the x-coordinate of the left side of this rectangle.

getLocation

Gets the coordinates of the upper-left corner of this rectangle.

getRight

Gets the x-coordinate of the right side of this rectangle.

getSize

Gets the size of this rectangle.

getTop

Gets the y-coordinate of the top side of this rectangle.

getWidth

Gets the width of the upper-left corner of this rectangle.

getX

Gets the x-coordinate of the upper-left corner of this rectangle.

getY

Gets the y-coordinate of the upper-left corner of this rectangle.

hashCode

Returns a hash code for the rectangle.

inflate

Overloaded. Inflates the current rectangle with a specified amount.

inflateBottom

Inflates the bottom side of the current rectangle with the specified amount and returns a new Rectangle object representing the result.

inflateLeft

Inflates the left side of the current rectangle with the specified amount and returns a new Rectangle object representing the result.

inflateRight

Inflates the right side of the current rectangle with the specified amount and returns a new Rectangle object representing the result.

inflateTop

Inflates the top side of the current rectangle with the specified amount and returns a new Rectangle object representing the result.

intersect

Overloaded. Intersects two rectangles.

intersectsWith

Determines if this rectangle intersects with the specified rectangle.

isEmpty

Gets a value indicating whether all properties of this rectangles have values of zero.

normalize

Returns a normalized representation of the current rectangle, that is, a rectangle with non-negative dimensions.

offset

Overloaded. Translates this rectangle by a specified amount.

readExternal

Externalizable.readExternal implementation.

toString

Converts this rectangle to a human-readable string.

union

Overloaded. Unions two rectangles.

withHeight

Creates a new rectangle with height set to the specified value and all other values equal to that of the current rectangle.

withWidth

Creates a new rectangle with width set to the specified value and all other values equal to that of the current rectangle.

withX

Creates a new rectangle with x-coordinate set to the specified value and all other values equal to that of the current rectangle.

withY

Creates a new rectangle with y-coordinate set to the specified value and all other values equal to that of the current rectangle.

writeExternal

Externalizable.writeExternal implementation.

 See Also

Rectangle Class
com.mindfusion.common Namespace