Top Description Fields Constructors Methods
org.apache.fontbox.util

public Class BoundingBox

extends Object
Class Inheritance
Imports
java.util.List

This is an implementation of a bounding box. This was originally written for the AMF parser.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private float
private float
private float
private float

Constructor Summary

AccessConstructor and Description
public
BoundingBox()

Default constructor.

public
BoundingBox(float
lower left x value
minX
,
float
lower left y value
minY
,
float
upper right x value
maxX
,
float
upper right y value
maxY
)

Constructor.

public
BoundingBox(List<Number>
list of four numbers
numbers
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true If the point is on the edge or inside the rectangle bounds.
contains
(float
The x coordinate.
x
,
float
The y coordinate.
y
)

Checks if a point is inside this rectangle.

public float

Returns:

The height of this rectangle.
getHeight
()

This will get the height of this rectangle as calculated by upperRightY - lowerLeftY.

public float

Returns:

Value of property lowerLeftX.
getLowerLeftX
()

Getter for property lowerLeftX.

public float

Returns:

Value of property lowerLeftY.
getLowerLeftY
()

Getter for property lowerLeftY.

public float

Returns:

Value of property upperRightX.
getUpperRightX
()

Getter for property upperRightX.

public float

Returns:

Value of property upperRightY.
getUpperRightY
()

Getter for property upperRightY.

public float

Returns:

The width of this rectangle.
getWidth
()

This will get the width of this rectangle as calculated by upperRightX - lowerLeftX.

public void
setLowerLeftX(float
New value of property lowerLeftX.
lowerLeftXValue
)

Setter for property lowerLeftX.

public void
setLowerLeftY(float
New value of property lowerLeftY.
lowerLeftYValue
)

Setter for property lowerLeftY.

public void
setUpperRightX(float
New value of property upperRightX.
upperRightXValue
)

Setter for property upperRightX.

public void
setUpperRightY(float
New value of property upperRightY.
upperRightYValue
)

Setter for property upperRightY.

public String

Returns:

This object as a string.
toString
()

Overrides java.lang.Object.toString.

This will return a string representation of this rectangle.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

lowerLeftXback to summary
private float lowerLeftX
lowerLeftYback to summary
private float lowerLeftY
upperRightXback to summary
private float upperRightX
upperRightYback to summary
private float upperRightY

Constructor Detail

BoundingBoxback to summary
public BoundingBox()

Default constructor.

BoundingBoxback to summary
public BoundingBox(float minX, float minY, float maxX, float maxY)

Constructor.

Parameters
minX:float

lower left x value

minY:float

lower left y value

maxX:float

upper right x value

maxY:float

upper right y value

BoundingBoxback to summary
public BoundingBox(List<Number> numbers)

Constructor.

Parameters
numbers:List<Number>

list of four numbers

Method Detail

containsback to summary
public boolean contains(float x, float y)

Checks if a point is inside this rectangle.

Parameters
x:float

The x coordinate.

y:float

The y coordinate.

Returns:boolean

true If the point is on the edge or inside the rectangle bounds.

getHeightback to summary
public float getHeight()

This will get the height of this rectangle as calculated by upperRightY - lowerLeftY.

Returns:float

The height of this rectangle.

getLowerLeftXback to summary
public float getLowerLeftX()

Getter for property lowerLeftX.

Returns:float

Value of property lowerLeftX.

getLowerLeftYback to summary
public float getLowerLeftY()

Getter for property lowerLeftY.

Returns:float

Value of property lowerLeftY.

getUpperRightXback to summary
public float getUpperRightX()

Getter for property upperRightX.

Returns:float

Value of property upperRightX.

getUpperRightYback to summary
public float getUpperRightY()

Getter for property upperRightY.

Returns:float

Value of property upperRightY.

getWidthback to summary
public float getWidth()

This will get the width of this rectangle as calculated by upperRightX - lowerLeftX.

Returns:float

The width of this rectangle.

setLowerLeftXback to summary
public void setLowerLeftX(float lowerLeftXValue)

Setter for property lowerLeftX.

Parameters
lowerLeftXValue:float

New value of property lowerLeftX.

setLowerLeftYback to summary
public void setLowerLeftY(float lowerLeftYValue)

Setter for property lowerLeftY.

Parameters
lowerLeftYValue:float

New value of property lowerLeftY.

setUpperRightXback to summary
public void setUpperRightX(float upperRightXValue)

Setter for property upperRightX.

Parameters
upperRightXValue:float

New value of property upperRightX.

setUpperRightYback to summary
public void setUpperRightY(float upperRightYValue)

Setter for property upperRightY.

Parameters
upperRightYValue:float

New value of property upperRightY.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

This will return a string representation of this rectangle.

Returns:String

This object as a string.

Annotations
@Override