Package pdf
Class BoundingBox
- java.lang.Object
-
- java.awt.geom.RectangularShape
-
- java.awt.geom.Rectangle2D
-
- java.awt.Rectangle
-
- pdf.BoundingBox
-
- All Implemented Interfaces:
java.awt.Shape,java.io.Serializable,java.lang.Cloneable
public class BoundingBox extends java.awt.RectangleThis class represents a bounding box. It holds coordinate information and properties used for graphical operations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intHORIZ_ALIGN_CENTERUsed to align a String horizontally in the center of the boxstatic intHORIZ_ALIGN_LEFTUsed to align a String to the left in the boxstatic intHORIZ_ALIGN_RIGHTUsed to aling a String to the right in a boxstatic intLINE_SPACING_PERCENTAGEPercent f line height to space linesstatic intSUBTRACT_FROM_BOTTOMUsed to subtract a child from a box, *leaving* the bottom portionstatic intSUBTRACT_FROM_LEFTUsed to subtract a child from a box, *leaving* the left portionstatic intSUBTRACT_FROM_RIGHTUsed to subtract a child from a box, *leaving" the right portionstatic intSUBTRACT_FROM_TOPUsed to subtract a child from a box, *leaving* the top portionstatic intVERT_ALIGN_BOTTOMUsed to align a String at the bottom of the boxstatic intVERT_ALIGN_CENTERUsed to a align a String centered verticallystatic intVERT_ALIGN_TOPUsed to align a String at the top of the box
-
Constructor Summary
Constructors Constructor Description BoundingBox()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(BoundingBox child)Make the specified box this box's child.java.awt.PointgetAbsoluteLocation()Get the absolute upper left location point for this boxBoundingBoxgetParent()Get this box's parent boxbooleanhasParent()Returns true if this box has a parent.voidsetParent(BoundingBox parent)Make the specified box this box's parent-
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union
-
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
-
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
-
-
-
-
Field Detail
-
LINE_SPACING_PERCENTAGE
public static final int LINE_SPACING_PERCENTAGE
Percent f line height to space lines- See Also:
- Constant Field Values
-
VERT_ALIGN_CENTER
public static final int VERT_ALIGN_CENTER
Used to a align a String centered vertically- See Also:
- Constant Field Values
-
VERT_ALIGN_TOP
public static final int VERT_ALIGN_TOP
Used to align a String at the top of the box- See Also:
- Constant Field Values
-
VERT_ALIGN_BOTTOM
public static final int VERT_ALIGN_BOTTOM
Used to align a String at the bottom of the box- See Also:
- Constant Field Values
-
HORIZ_ALIGN_CENTER
public static final int HORIZ_ALIGN_CENTER
Used to align a String horizontally in the center of the box- See Also:
- Constant Field Values
-
HORIZ_ALIGN_LEFT
public static final int HORIZ_ALIGN_LEFT
Used to align a String to the left in the box- See Also:
- Constant Field Values
-
HORIZ_ALIGN_RIGHT
public static final int HORIZ_ALIGN_RIGHT
Used to aling a String to the right in a box- See Also:
- Constant Field Values
-
SUBTRACT_FROM_TOP
public static final int SUBTRACT_FROM_TOP
Used to subtract a child from a box, *leaving* the top portion- See Also:
- Constant Field Values
-
SUBTRACT_FROM_BOTTOM
public static final int SUBTRACT_FROM_BOTTOM
Used to subtract a child from a box, *leaving* the bottom portion- See Also:
- Constant Field Values
-
SUBTRACT_FROM_LEFT
public static final int SUBTRACT_FROM_LEFT
Used to subtract a child from a box, *leaving* the left portion- See Also:
- Constant Field Values
-
SUBTRACT_FROM_RIGHT
public static final int SUBTRACT_FROM_RIGHT
Used to subtract a child from a box, *leaving" the right portion- See Also:
- Constant Field Values
-
-
Method Detail
-
hasParent
public boolean hasParent()
Returns true if this box has a parent. The 'world', or enclosing canvas is not considered a parent
- Returns:
- a
booleanvalue
-
getParent
public BoundingBox getParent()
Get this box's parent box
- Returns:
- a
BoundingBoxvalue
-
add
public void add(BoundingBox child)
Make the specified box this box's child. Equivalent to
child.setParent(parent)where the specified 'parent' is this instance- Parameters:
child- aBoundingBox, any box that can fit inside this one. The results of callinggetAbsoluteLocation()on the child will be altered after this to take into account the child's new location in the 'world'
-
setParent
public void setParent(BoundingBox parent)
Make the specified box this box's parent
- Parameters:
parent- aBoundingBoxvalue
-
getAbsoluteLocation
public java.awt.Point getAbsoluteLocation()
Get the absolute upper left location point for this box
- Returns:
- a
Pointvalue
-
-