org.fontbox.util
Class BoundingBox
java.lang.Objectorg.fontbox.util.BoundingBox
public class BoundingBox
extends java.lang.Object
This is an implementation of a bounding box. This was originally written for the
AMF parser.
- Ben Litchfield (ben@benlitchfield.com)
boolean | contains(Point point)- Checks if a point is inside this rectangle.
|
boolean | contains(float x, float y)- Checks if a point is inside this rectangle.
|
float | getHeight()- This will get the height of this rectangle as calculated by
upperRightY - lowerLeftY.
|
float | getLowerLeftX()- Getter for property lowerLeftX.
|
float | getLowerLeftY()- Getter for property lowerLeftY.
|
float | getUpperRightX()- Getter for property upperRightX.
|
float | getUpperRightY()- Getter for property upperRightY.
|
float | getWidth()- This will get the width of this rectangle as calculated by
upperRightX - lowerLeftX.
|
void | setLowerLeftX(float lowerLeftXValue)- Setter for property lowerLeftX.
|
void | setLowerLeftY(float lowerLeftYValue)- Setter for property lowerLeftY.
|
void | setUpperRightX(float upperRightXValue)- Setter for property upperRightX.
|
void | setUpperRightY(float upperRightYValue)- Setter for property upperRightY.
|
String | toString()- This will return a string representation of this rectangle.
|
contains
public boolean contains(Point point)
Checks if a point is inside this rectangle.
point - The point to check
- true If the point is on the edge or inside the rectangle bounds.
contains
public boolean contains(float x,
float y) Checks if a point is inside this rectangle.
x - The x coordinate.y - The y coordinate.
- true If the point is on the edge or inside the rectangle bounds.
getHeight
public float getHeight()
This will get the height of this rectangle as calculated by
upperRightY - lowerLeftY.
- The height of this rectangle.
getLowerLeftX
public float getLowerLeftX()
Getter for property lowerLeftX.
- Value of property lowerLeftX.
getLowerLeftY
public float getLowerLeftY()
Getter for property lowerLeftY.
- Value of property lowerLeftY.
getUpperRightX
public float getUpperRightX()
Getter for property upperRightX.
- Value of property upperRightX.
getUpperRightY
public float getUpperRightY()
Getter for property upperRightY.
- Value of property upperRightY.
getWidth
public float getWidth()
This will get the width of this rectangle as calculated by
upperRightX - lowerLeftX.
- The width of this rectangle.
setLowerLeftX
public void setLowerLeftX(float lowerLeftXValue)
Setter for property lowerLeftX.
lowerLeftXValue - New value of property lowerLeftX.
setLowerLeftY
public void setLowerLeftY(float lowerLeftYValue)
Setter for property lowerLeftY.
lowerLeftYValue - New value of property lowerLeftY.
setUpperRightX
public void setUpperRightX(float upperRightXValue)
Setter for property upperRightX.
upperRightXValue - New value of property upperRightX.
setUpperRightY
public void setUpperRightY(float upperRightYValue)
Setter for property upperRightY.
upperRightYValue - New value of property upperRightY.
toString
public String toString()
This will return a string representation of this rectangle.