| java.lang.Object org.pdfbox.pdmodel.common.PDRectangle
Method Summary | |
public boolean | contains(float x, float y) Method to determine if the x/y point is inside this rectangle.
Parameters: x - The x-coordinate to test. Parameters: y - The y-coordinate to test. | public Dimension | createDimension() A convenience method to create a dimension object for AWT operations. | public 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. | public COSArray | getCOSArray() This will get the underlying array for this rectangle. | public COSBase | getCOSObject() Convert this standard java object to a COS object. | public float | getHeight() This will get the height of this rectangle as calculated by
upperRightY - lowerLeftY. | public float | getLowerLeftX() This will get the lower left x coordinate. | public float | getLowerLeftY() This will get the lower left y coordinate. | public float | getUpperRightX() This will get the upper right x coordinate. | public float | getUpperRightY() This will get the upper right y coordinate. | public float | getWidth() This will get the width of this rectangle as calculated by
upperRightX - lowerLeftX. | public void | move(float horizontalAmount, float verticalAmount) This will move the rectangle the given relative amount. | public void | setLowerLeftX(float value) This will set the lower left x coordinate. | public void | setLowerLeftY(float value) This will set the lower left y coordinate. | public void | setUpperRightX(float value) This will set the upper right x coordinate. | public void | setUpperRightY(float value) This will set the upper right y coordinate. | public String | toString() This will return a string representation of this rectangle. |
PDRectangle | public PDRectangle()(Code) | | Constructor.
Initializes to 0,0,0,0
|
PDRectangle | public PDRectangle(float width, float height)(Code) | | Constructor.
Parameters: width - The width of the rectangle. Parameters: height - The height of the rectangle. |
PDRectangle | public PDRectangle(BoundingBox box)(Code) | | Constructor.
Parameters: box - The non PD bouding box. |
PDRectangle | public PDRectangle(COSArray array)(Code) | | Constructor.
Parameters: array - An array of numbers as specified in the PDF Reference for a rectangle type. |
contains | public boolean contains(float x, float y)(Code) | | Method to determine if the x/y point is inside this rectangle.
Parameters: x - The x-coordinate to test. Parameters: y - The y-coordinate to test. True if the point is inside this rectangle. |
createDimension | public Dimension createDimension()(Code) | | A convenience method to create a dimension object for AWT operations.
A dimension that matches the width and height of this rectangle. |
createRetranslatedRectangle | public PDRectangle createRetranslatedRectangle()(Code) | | 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.
100, 100, 400, 400 (llx, lly, urx, ury )
will be translated to 0,0,300,300
A new rectangle that has been translated back to the origin. |
getCOSArray | public COSArray getCOSArray()(Code) | | This will get the underlying array for this rectangle.
The cos array. |
getCOSObject | public COSBase getCOSObject()(Code) | | Convert this standard java object to a COS object.
The cos object that matches this Java object. |
getHeight | public float getHeight()(Code) | | This will get the height of this rectangle as calculated by
upperRightY - lowerLeftY.
The height of this rectangle. |
getLowerLeftX | public float getLowerLeftX()(Code) | | This will get the lower left x coordinate.
The lower left x. |
getLowerLeftY | public float getLowerLeftY()(Code) | | This will get the lower left y coordinate.
The lower left y. |
getUpperRightX | public float getUpperRightX()(Code) | | This will get the upper right x coordinate.
The upper right x . |
getUpperRightY | public float getUpperRightY()(Code) | | This will get the upper right y coordinate.
The upper right y. |
getWidth | public float getWidth()(Code) | | This will get the width of this rectangle as calculated by
upperRightX - lowerLeftX.
The width of this rectangle. |
move | public void move(float horizontalAmount, float verticalAmount)(Code) | | This will move the rectangle the given relative amount.
Parameters: horizontalAmount - positive values will move rectangle to the right, negative's to the left. Parameters: verticalAmount - positive values will move the rectangle up, negative's down. |
setLowerLeftX | public void setLowerLeftX(float value)(Code) | | This will set the lower left x coordinate.
Parameters: value - The lower left x. |
setLowerLeftY | public void setLowerLeftY(float value)(Code) | | This will set the lower left y coordinate.
Parameters: value - The lower left y. |
setUpperRightX | public void setUpperRightX(float value)(Code) | | This will set the upper right x coordinate.
Parameters: value - The upper right x . |
setUpperRightY | public void setUpperRightY(float value)(Code) | | This will set the upper right y coordinate.
Parameters: value - The upper right y. |
toString | public String toString()(Code) | | This will return a string representation of this rectangle.
This object as a string. |
|
|