public class PDRectangle extends Object implements COSObjectable
Constructor and Description |
---|
PDRectangle()
Constructor.
|
PDRectangle(org.apache.fontbox.util.BoundingBox box)
Constructor.
|
PDRectangle(COSArray array)
Constructor.
|
PDRectangle(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.
|
Dimension |
createDimension()
A convenience method to create a dimension object for AWT operations.
|
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 |
move(float horizontalAmount,
float verticalAmount)
This will move the rectangle the given relative amount.
|
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.
|
String |
toString()
This will return a string representation of this rectangle.
|
public PDRectangle()
public PDRectangle(float width, float height)
width
- 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 Dimension createDimension()
public void move(float horizontalAmount, float verticalAmount)
horizontalAmount
- positive values will move rectangle to the right, negative's to the left.verticalAmount
- positive values will move the rectangle up, negative's down.public COSBase getCOSObject()
getCOSObject
in interface COSObjectable
Copyright © 2002-2015 The Apache Software Foundation. All Rights Reserved.