public class PDRectangle extends Object implements COSObjectable
Modifier and Type | Field and Description |
---|---|
static PDRectangle |
A0
A rectangle the size of A0 Paper.
|
static PDRectangle |
A1
A rectangle the size of A1 Paper.
|
static PDRectangle |
A2
A rectangle the size of A2 Paper.
|
static PDRectangle |
A3
A rectangle the size of A3 Paper.
|
static PDRectangle |
A4
A rectangle the size of A4 Paper.
|
static PDRectangle |
A5
A rectangle the size of A5 Paper.
|
static PDRectangle |
A6
A rectangle the size of A6 Paper.
|
static PDRectangle |
LEGAL
A rectangle the size of U.S.
|
static PDRectangle |
LETTER
A rectangle the size of U.S.
|
Constructor and Description |
---|
PDRectangle()
Constructor.
|
PDRectangle(org.apache.fontbox.util.BoundingBox box)
Constructor.
|
PDRectangle(COSArray array)
Constructor.
|
PDRectangle(float width,
float height)
Constructor.
|
PDRectangle(float x,
float y,
float width,
float height)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(float x,
float y)
Method to determine if the x/y point is inside this rectangle.
|
PDRectangle |
createRetranslatedRectangle()
This will create a translated rectangle based off of this rectangle, such
that the new rectangle retains the same dimensions(height/width), but the
lower left x,y values are zero.
|
COSArray |
getCOSArray()
This will get the underlying array for this rectangle.
|
COSBase |
getCOSObject()
Convert this standard java object to a COS object.
|
float |
getHeight()
This will get the height of this rectangle as calculated by
upperRightY - lowerLeftY.
|
float |
getLowerLeftX()
This will get the lower left x coordinate.
|
float |
getLowerLeftY()
This will get the lower left y coordinate.
|
float |
getUpperRightX()
This will get the upper right x coordinate.
|
float |
getUpperRightY()
This will get the upper right y coordinate.
|
float |
getWidth()
This will get the width of this rectangle as calculated by
upperRightX - lowerLeftX.
|
void |
setLowerLeftX(float value)
This will set the lower left x coordinate.
|
void |
setLowerLeftY(float value)
This will set the lower left y coordinate.
|
void |
setUpperRightX(float value)
This will set the upper right x coordinate.
|
void |
setUpperRightY(float value)
This will set the upper right y coordinate.
|
GeneralPath |
toGeneralPath()
Returns a general path equivalent to this rectangle.
|
String |
toString()
This will return a string representation of this rectangle.
|
GeneralPath |
transform(Matrix matrix)
Returns a path which represents this rectangle having been transformed by the given matrix.
|
public static final PDRectangle LETTER
public static final PDRectangle LEGAL
public static final PDRectangle A0
public static final PDRectangle A1
public static final PDRectangle A2
public static final PDRectangle A3
public static final PDRectangle A4
public static final PDRectangle A5
public static final PDRectangle A6
public PDRectangle()
public PDRectangle(float width, float height)
width
- The width of the rectangle.height
- The height of the rectangle.public PDRectangle(float x, float y, float width, float height)
x
- the x coordinate of the rectangley
- the y coordinate of the rectanglewidth
- The width of the rectangle.height
- The height of the rectangle.public PDRectangle(org.apache.fontbox.util.BoundingBox box)
box
- the bounding box to be used for the rectanglepublic PDRectangle(COSArray array)
array
- An array of numbers as specified in the PDF Reference for a rectangle type.public boolean contains(float x, float y)
x
- The x-coordinate to test.y
- The y-coordinate to test.public PDRectangle createRetranslatedRectangle()
public COSArray getCOSArray()
public float getLowerLeftX()
public void setLowerLeftX(float value)
value
- The lower left x.public float getLowerLeftY()
public void setLowerLeftY(float value)
value
- The lower left y.public float getUpperRightX()
public void setUpperRightX(float value)
value
- The upper right x .public float getUpperRightY()
public void setUpperRightY(float value)
value
- The upper right y.public float getWidth()
public float getHeight()
public GeneralPath transform(Matrix matrix)
public COSBase getCOSObject()
getCOSObject
in interface COSObjectable
public GeneralPath toGeneralPath()
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.