public final class BoundsTree
extends java.lang.Object
implements java.lang.Iterable<java.awt.geom.Rectangle2D>
Constructor and Description |
---|
BoundsTree(java.lang.String rootLabel)
Make an empty instance, with the specified label.
|
BoundsTree(java.lang.String rootLabel,
BoundsTree... boundsTrees) |
BoundsTree(java.lang.String rootLabel,
java.lang.String firstLabel,
java.awt.geom.Rectangle2D firstBox)
Make an instance that contains a single bounds.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String prefix,
BoundsTree tree)
Add all the members of another tree, prefixing their labels with the
supplied label, separated by an underscore.
|
void |
add(java.lang.String label,
java.awt.geom.Point2D point) |
void |
add(java.lang.String label,
java.awt.geom.Rectangle2D bounds)
Adds a rectangular bounds to the tree and updates the root bounds.
|
java.awt.geom.Rectangle2D |
get(java.lang.String label)
Get the bonding box of the element with this label.
|
java.util.List<java.lang.String> |
getBoundLabels() |
java.awt.geom.Rectangle2D |
getBounds(java.util.List<java.lang.String> labels) |
double |
getHeight() |
java.awt.geom.Rectangle2D |
getRoot() |
BoundsTree |
getSubtree(java.lang.String prefix) |
double |
getWidth() |
java.util.Iterator<java.awt.geom.Rectangle2D> |
iterator() |
void |
setRoot(java.awt.geom.Rectangle2D root) |
void |
shift(double dx,
double dy) |
java.lang.String |
toString() |
BoundsTree |
transform(java.awt.geom.AffineTransform transform) |
public BoundsTree(java.lang.String rootLabel)
rootLabel
- public BoundsTree(java.lang.String rootLabel, java.lang.String firstLabel, java.awt.geom.Rectangle2D firstBox)
rootLabel
- firstLabel
- firstBox
- public BoundsTree(java.lang.String rootLabel, BoundsTree... boundsTrees)
rootLabel
- boundsTrees
- public BoundsTree getSubtree(java.lang.String prefix)
prefix
- public java.awt.geom.Rectangle2D getRoot()
public void add(java.lang.String label, java.awt.geom.Rectangle2D bounds)
label
- bounds
- the bounding box of thepublic void add(java.lang.String label, java.awt.geom.Point2D point)
label
- point
- public java.awt.geom.Rectangle2D getBounds(java.util.List<java.lang.String> labels)
labels
- public void setRoot(java.awt.geom.Rectangle2D root)
root
- public void add(java.lang.String prefix, BoundsTree tree)
prefix
- label
- tree
- public java.util.List<java.lang.String> getBoundLabels()
public void shift(double dx, double dy)
dx
- dy
- public java.awt.geom.Rectangle2D get(java.lang.String label)
label
- public double getWidth()
public double getHeight()
public java.util.Iterator<java.awt.geom.Rectangle2D> iterator()
iterator
in interface java.lang.Iterable<java.awt.geom.Rectangle2D>
public BoundsTree transform(java.awt.geom.AffineTransform transform)
transform
- public java.lang.String toString()
toString
in class java.lang.Object