public class DisplayLib
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
fitViewToBounds(Display display,
java.awt.geom.Rectangle2D bounds,
long duration)
Set the display view such that the given bounds are within view.
|
static void |
fitViewToBounds(Display display,
java.awt.geom.Rectangle2D bounds,
java.awt.geom.Point2D center,
long duration)
Set the display view such that the given bounds are within view, subject
to a given center point being maintained.
|
static java.awt.geom.Rectangle2D |
getBounds(java.util.Iterator iter,
double margin)
Get a bounding rectangle of the VisualItems in the input iterator.
|
static java.awt.geom.Rectangle2D |
getBounds(java.util.Iterator iter,
double margin,
java.awt.geom.Rectangle2D b)
Get a bounding rectangle of the VisualItems in the input iterator.
|
static java.awt.geom.Point2D |
getCentroid(java.util.Iterator iter)
Return the centroid (averaged location) of a group of items.
|
static java.awt.geom.Point2D |
getCentroid(java.util.Iterator iter,
java.awt.geom.Point2D p)
Return the centroid (averaged location) of a group of items.
|
public static java.awt.geom.Rectangle2D getBounds(java.util.Iterator iter, double margin, java.awt.geom.Rectangle2D b)
iter
- an iterator of VisualItemsmargin
- a margin to add on to the bounding rectangleb
- the Rectangle instance in which to store the resultb
.public static java.awt.geom.Rectangle2D getBounds(java.util.Iterator iter, double margin)
iter
- an iterator of VisualItemsmargin
- a margin to add on to the bounding rectanglepublic static java.awt.geom.Point2D getCentroid(java.util.Iterator iter, java.awt.geom.Point2D p)
iter
- an iterator of VisualItemsp
- a Point2D instance in which to store the resultp
.public static java.awt.geom.Point2D getCentroid(java.util.Iterator iter)
iter
- an iterator of VisualItemspublic static void fitViewToBounds(Display display, java.awt.geom.Rectangle2D bounds, long duration)
display
- the Display instancebounds
- the bounds that should be visible in the Display viewduration
- the duration of an animated transition. A value of
zero will result in an instantaneous change.public static void fitViewToBounds(Display display, java.awt.geom.Rectangle2D bounds, java.awt.geom.Point2D center, long duration)
display
- the Display instancebounds
- the bounds that should be visible in the Display viewcenter
- the point that should be the center of the Displayduration
- the duration of an animated transition. A value of
zero will result in an instantaneous change.Copyright ? 2013 Regents of the University of California