| de.intarsys.pdf.cds.CDSBase de.intarsys.pdf.cds.CDSRectangle
CDSRectangle | public class CDSRectangle extends CDSBase (Code) | | The implementation of the pdf rectangle data type.
The specification of the data type is found in [PDF} chapter 3.8.3.
A rectangle is defined by
[llx, lly, urx, ury ]
where
llx = lower left x coordinate
lly = lower left y coordinate
urx = upper right x coordinate
ury = upper right y coordinate
urx
|
v
+-----+ <-ury
| |
lly -> +-----+
ˆ
|
llx
An application should be prepared to get any two diagonally opposite corners
in the rectangle specification. Use "normalize()" to ensure a rectangle that
conforms to the above picture.
|
Field Summary | |
final public static float[] | SIZE_A4 |
Method Summary | |
public boolean | contains(double x, double y) true if x/y lies within this.
Parameters: x - x coordinate to be checked. Parameters: y - y coordinate to be checked. | public boolean | contains(double x, double y, double epsilon) true if x/y lies within this, with a "uncertainty" of
epsilon. | public CDSRectangle | copy() | public static CDSRectangle | createFromCOS(COSArray array) Create a
CDSRectangle from an array holding the
rectangle coordinates. | public float | getHeight() Return the height (an absolute value) of the rectangle. | public float | getLowerLeftX() The lower left x coordinate. | public float | getLowerLeftY() The lower left y coordinate. | public float | getUpperRightX() The upper right x coordinate. | public float | getUpperRightY() The upper rigth y coordinate. | public float | getWidth() Get the width (an absolute value) of the rectangle. | public void | invalidateCaches() | public void | move(float dx, float dy) Move the rectangle by a relative offset. | public CDSRectangle | moveTo(float x, float y) Move the rectangle to a new absolute position. | public CDSRectangle | normalize() Adjust the corner coordinates so that lower left is really in the lower
left (this means returns the smallest coordinate values). | public void | resize(float dx, float dy) Resize the rectangle by moving the upper right corner. | public void | resizeTo(float width, float height) Resize the rectangle to a new width and heigth. | public void | setCorners(float llx, float lly, float urx, float ury) Set the corners of this. | public void | setHeight(float height) Set the height of this. | public void | setLowerLeftX(float num) Set the lower left x coordinate. | public void | setLowerLeftY(float num) Set the lower left y coordinate. | public void | setUpperRightX(float num) Set the upper right x coordinate. | public void | setUpperRightY(float num) Set the upper right y coordinate. | public void | setWidth(float width) Set the width of this. | public Rectangle2D | toNormalizedRectangle() Construct a
Rectangle2D object from the receiver. | public Rectangle2D | toRectangle() Construct a
Rectangle2D object from the receiver. |
SIZE_A4 | final public static float[] SIZE_A4(Code) | | |
CDSRectangle | public CDSRectangle()(Code) | | CDTRectangle constructor comment.
|
CDSRectangle | protected CDSRectangle(COSArray newR)(Code) | | CDTRectangle constructor. Create a new rectangle with given array.
Parameters: newR - A four dimensional COSArray defining llx,lly, urx, ury. |
CDSRectangle | public CDSRectangle(float llx, float lly, float urx, float ury)(Code) | | CDTRectangle constructor. Create a new rectangle with given size.
Parameters: llx - the lower left x Parameters: lly - the lower left y Parameters: urx - the upper right x Parameters: ury - the upper right y |
contains | public boolean contains(double x, double y)(Code) | | true if x/y lies within this.
Parameters: x - x coordinate to be checked. Parameters: y - y coordinate to be checked. true if x/y lies within this. |
contains | public boolean contains(double x, double y, double epsilon)(Code) | | true if x/y lies within this, with a "uncertainty" of
epsilon.
Parameters: x - x coordinate to be checked. Parameters: y - y coordinate to be checked. Parameters: epsilon - The allowed range of uncertainty true if x/y lies within this. |
copy | public CDSRectangle copy()(Code) | | Create a copy of the receiver
a new copy of the receiver |
getHeight | public float getHeight()(Code) | | Return the height (an absolute value) of the rectangle.
Return the height (an absolute value) of the rectangle. |
getLowerLeftX | public float getLowerLeftX()(Code) | | The lower left x coordinate.
The lower left x coordinate. |
getLowerLeftY | public float getLowerLeftY()(Code) | | The lower left y coordinate.
The lower left y coordinate. |
getUpperRightX | public float getUpperRightX()(Code) | | The upper right x coordinate.
The upper right x coordinate. |
getUpperRightY | public float getUpperRightY()(Code) | | The upper rigth y coordinate.
The upper right y coordinate. |
getWidth | public float getWidth()(Code) | | Get the width (an absolute value) of the rectangle.
Get the width (an absolute value) of the rectangle. |
invalidateCaches | public void invalidateCaches()(Code) | | |
move | public void move(float dx, float dy)(Code) | | Move the rectangle by a relative offset. The relationship of the opposite
corners is preserved by this method.
Parameters: dx - The offset by wich we move in x direction. Parameters: dy - The offset by wich we move in y direction. |
moveTo | public CDSRectangle moveTo(float x, float y)(Code) | | Move the rectangle to a new absolute position. The relationship of the
opposite corners is preserved by this method. The receiver is modified.
Parameters: x - The new x position of the lower left corner. Parameters: y - The new y position of the lower left corner. this |
normalize | public CDSRectangle normalize()(Code) | | Adjust the corner coordinates so that lower left is really in the lower
left (this means returns the smallest coordinate values).
This method changes this in place!
this |
resize | public void resize(float dx, float dy)(Code) | | Resize the rectangle by moving the upper right corner.
Parameters: dx - The distance we move the upper right x coordinate. Parameters: dy - The distance we move the upper right y coordinate. |
resizeTo | public void resizeTo(float width, float height)(Code) | | Resize the rectangle to a new width and heigth. The new width and heigth
are defined relative to the lower left corner as signed values.
Parameters: width - The new width of the rectangle. Parameters: height - The new height of the rectangle. |
setCorners | public void setCorners(float llx, float lly, float urx, float ury)(Code) | | Set the corners of this.
Parameters: llx - The lower left x coordinate Parameters: lly - The lower left y coordinate Parameters: urx - The upper right x coordinate Parameters: ury - The upper right y coordinate |
setHeight | public void setHeight(float height)(Code) | | Set the height of this.
Parameters: height - THe new height |
setLowerLeftX | public void setLowerLeftX(float num)(Code) | | Set the lower left x coordinate.
Parameters: num - The lower left x coordinate. |
setLowerLeftY | public void setLowerLeftY(float num)(Code) | | Set the lower left y coordinate.
Parameters: num - The lower left y coordinate. |
setUpperRightX | public void setUpperRightX(float num)(Code) | | Set the upper right x coordinate.
Parameters: num - The upper right x coordinate. |
setUpperRightY | public void setUpperRightY(float num)(Code) | | Set the upper right y coordinate.
Parameters: num - The upper right y coordinate. |
setWidth | public void setWidth(float width)(Code) | | Set the width of this.
Parameters: width - The new width. |
toNormalizedRectangle | public Rectangle2D toNormalizedRectangle()(Code) | | Construct a
Rectangle2D object from the receiver. The rectangle
will be normalized before construction.
The Rectangle2D created from the receiver. |
toRectangle | public Rectangle2D toRectangle()(Code) | | Construct a
Rectangle2D object from the receiver. The resulting
rectangle is not normalized, that means it may return a negative width or
height.
The Rectangle2D created from the receiver. |
|
|