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()
Initializes to 0,0,0,0
|
PDRectangle(org.apache.fontbox.util.BoundingBox box) |
PDRectangle(COSArray array) |
PDRectangle(float width,
float height) |
PDRectangle(float x,
float y,
float width,
float height) |
PDRectangle(Rectangle2D rectange) |
| 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.
|
boolean |
equals(Object o) |
COSArray |
getCOSObject() |
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.
|
int |
hashCode() |
static PDRectangle |
rectangleFrom(COSArray array) |
PDRectangle |
rotate() |
PDRectangle |
rotate(int degrees) |
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(Rectangle2D rectange)
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 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 COSArray getCOSObject()
getCOSObject in interface COSObjectableCOSBase that matches this Java object.public GeneralPath toGeneralPath()
public PDRectangle rotate()
public PDRectangle rotate(int degrees)
public String toString()
public static PDRectangle rectangleFrom(COSArray array)
array - PDRectangle if the the array is not null and has enough elements, null otherwiseCopyright © 2020 sejda. All rights reserved.