Rect Class Documentation

class Rect

Namespace:com::datalogics::PDFL

Detailed Description

A rect holds four coordinates for a rectangle. The coordinates for a rectangle include left, top, right, bottom. Width () and height () defines the rectangle's width and height. LLx and LLy defines lower left corner, and URx and URy defines the upper right corner.

Uses types

Constructor & Destructor Documentation

Rect

Rect()

Create a rectangle with all values zero.

Rect

Rect(double nLLx, double nLLy, double nURx, double nURy)

Parameters

nLLx: double

the X coordinate of the lower left corner of the rectangle

nLLy: double

the Y coordinate of the lower left corner of the rectangle

nURx: double

the X coordinate of the upper right corner of the rectangle

nURy: double

the Y coordinate of the upper right corner of the rectangle

Create a Rect.

Rect

Rect(java.awt.geom.Rectangle2D r)

Parameters

r: java.awt.geom.Rectangle2D

a rectangle

Create a Rect from a java.awt rectangle type

Note that the coordinate systems are inverted for PDFL. Smaller X/Y values are assigned to the lower left coordinate.

Member Function Documentation

delete

synchronized void delete(Boolean disposing)

Parameters

disposing: Boolean

Returns:

synchronized void

delete

synchronized void delete()

Returns:

synchronized void

equals

boolean equals(Object rhs)

Parameters

rhs: Object

Returns:

boolean

finalize

void finalize()

Returns:

void

getBottom

double getBottom()

Returns:

double

the Y coordinate of the lower left corner of the rectangle.

getHeight

double getHeight()

Returns:

double

The height of the rectangle (URy - LLy).

The height of the Rect.

getLLx

double getLLx()

Returns:

double

the X coordinate of the lower left corner of the rectangle.

getLLy

double getLLy()

Returns:

double

the Y coordinate of the lower left corner of the rectangle.

getLeft

double getLeft()

Returns:

double

the X coordinate of the lower left corner of the rectangle.

getRight

double getRight()

Returns:

double

the X coordinate of the upper right corner of the rectangle.

getTop

double getTop()

Returns:

double

the Y coordinate of the upper right corner of the rectangle.

getURx

double getURx()

Returns:

double

the X coordinate of the upper right corner of the rectangle.

getURy

double getURy()

Returns:

double

the Y coordinate of the upper right corner of the rectangle.

getWidth

double getWidth()

Returns:

double

The width of the rectangle (URx - LLx).

The width of the Rect.

inRect

boolean inRect(Rect r2)

Parameters

r2: Rect

The rectangle to test containment against.

Returns:

boolean

true if this rectangle is entirely inside r2, false otherwise.

Check if this rectangle is inside the parameter rectangle.

intersect

Rect intersect(Rect r2)

Parameters

r2: Rect

The other rectangle to intersect with.

Returns:

Rect

A new Rect representing the intersection of the two rectangles.

Obtain the intersection of this rectangle and another rectangle.

isEmpty

boolean isEmpty()

Returns:

boolean

true if the rectangle is empty, false otherwise.

Check if this rectangle is empty. A rectangle is considered empty if its width or height is zero.

overlaps

boolean overlaps(Rect r2)

Parameters

r2: Rect

The other rectangle to test for overlap.

Returns:

boolean

true if the two rectangles overlap, false otherwise.

Check if two rectangles overlap.

setBottom

void setBottom(double bottom)

Parameters

bottom: double

Returns:

void

the Y coordinate of the lower left corner of the rectangle.

setLLx

void setLLx(double value)

Parameters

value: double

Returns:

void

the X coordinate of the lower left corner of the rectangle.

setLLy

void setLLy(double value)

Parameters

value: double

Returns:

void

the Y coordinate of the lower left corner of the rectangle.

setLeft

void setLeft(double left)

Parameters

left: double

Returns:

void

the X coordinate of the lower left corner of the rectangle.

setRight

void setRight(double right)

Parameters

right: double

Returns:

void

the X coordinate of the upper right corner of the rectangle.

setTop

void setTop(double top)

Parameters

top: double

Returns:

void

the Y coordinate of the upper right corner of the rectangle.

setURx

void setURx(double value)

Parameters

value: double

Returns:

void

the X coordinate of the upper right corner of the rectangle.

setURy

void setURy(double value)

Parameters

value: double

Returns:

void

the Y coordinate of the upper right corner of the rectangle.

toString

String toString()

Returns:

String

A string describing the rectangle coordinates in the form "[ LLx=..., LLy=..., URx=..., URy=... ]".

Convert the Rect to a human-readable string representation.

transform

Rect transform(Matrix arg0)

Parameters

arg0: Matrix

Returns:

Rect

A new Rect with the transformed coordinates.

Transform the coordinates of the rectangle by the given Matrix Object.