Gnostice PDFOne
Pro. Ed. v1.41


com.gnostice.pdfone
Class PdfRect

java.lang.Object
  extended bycom.gnostice.pdfone.PdfRect
All Implemented Interfaces:
Cloneable

public class PdfRect
extends Object
implements Cloneable

This class represents a rectangle or rectangular area on a page. A PdfRect object is specified by x-y coordinates of its top-left corner, its width, and its height. These specifications of a rectangle are applied in a literal sense. As a result, the actual position and size of a rectangle object on a page is wholly dependent on whatever measurement unit that is currently applicable.

For example, on a page where the measurement unit is inch, the height and width of a rectangle will be applied in inches, literally. On a page with pixel as the measurement unit, the rectangle's position and size will be applied in pixels, literally. As this can cause serious shifts in position, care has to be taken when reusing a rectangle in different places or in different situations.

Some classes may have methods that specify a PdfRect object and a particular measurement unit as arguments. In these cases, the position and size of the rectangle are applied in the specified measurement unit. When no measurement unit is specified or cannot be determined, the height, width, and x-y coordinates of its top-left corner will be applied in points, or or points as in "one inch equals 72 points equals 96 pixels."

Since:
1.0
Version:
1.0

Constructor Summary
PdfRect(double x, double y, double width, double height)
          Constructs a PdfRect object at position (x, y) with specified width and height.
PdfRect(PdfArray array, double pageHeight)
           
PdfRect(Rectangle rect)
          Constructs a PdfRect object with specified Rectangle object.
PdfRect(Rectangle2D rect)
          Constructs a PdfRect object with specified Rectangle2D object.
 
Method Summary
 double bottom()
          Returns distance from top of page to bottom of this rectangle.
 Object clone()
           
 double getX()
          Returns x-coordinate of top-left corner of this rectangle.
 double getY()
          Returns y-coordinate of top-left corner of this rectangle.
 double height()
          Returns height of this rectangle.
 double left()
          Returns distance from left side of page to left side of this rectangle.
 double right()
          Returns distance from left side of page to right side of this rectangle.
 double top()
          Returns distance from top side of page to top side of this rectangle.
 String toString()
           
 double width()
          Returns width of this rectangle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PdfRect

public PdfRect(double x,
               double y,
               double width,
               double height)
Constructs a PdfRect object at position (x, y) with specified width and height.

Parameters:
x - x-coordinate of the top-left corner of the rectangle
y - y-coordinate of the top-left corner of the rectangle
width - width of the rectangle
height - height of the rectangle
Sample Code
See example.

PdfRect

public PdfRect(Rectangle rect)
Constructs a PdfRect object with specified Rectangle object.

Parameters:
rect - a rectangle
Sample Code
See example.

PdfRect

public PdfRect(Rectangle2D rect)
Constructs a PdfRect object with specified Rectangle2D object.

Parameters:
rect - a rectangle
Sample Code
See example.

PdfRect

public PdfRect(PdfArray array,
               double pageHeight)
Method Detail

height

public double height()
Returns height of this rectangle.

Returns:
height of the rectangle
Since:
1.0
Sample Code
See example.

width

public double width()
Returns width of this rectangle.

Returns:
width of the rectangle
Since:
1.0
Sample Code
See example.

getX

public double getX()
Returns x-coordinate of top-left corner of this rectangle.

Returns:
x-coordinate of top-left corner of the rectangle
Since:
1.0
Sample Code
See example.

getY

public double getY()
Returns y-coordinate of top-left corner of this rectangle.

Returns:
y-coordinate of top-left corner of the rectangle
Since:
1.0
Sample Code
See example.

bottom

public double bottom()
Returns distance from top of page to bottom of this rectangle.

Returns:
distance from top of page to bottom of the rectangle
Since:
1.0
Sample Code
See example.

left

public double left()
Returns distance from left side of page to left side of this rectangle.

Returns:
distance from left side of page to left side of the rectangle
Since:
1.0
Sample Code
See example.

right

public double right()
Returns distance from left side of page to right side of this rectangle.

Returns:
distance from left side of page to right side of this rectangle
Since:
1.0
Sample Code
See example.

top

public double top()
Returns distance from top side of page to top side of this rectangle.

Returns:
distance from top side of page to top side of the rectangle
Since:
1.0
Sample Code
See example.

clone

public Object clone()

toString

public String toString()

Gnostice PDFOne
Pro. Ed. v1.41

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2006 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com