|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.util.ZLayout
ZLayout is a utility class that provides general-purpose layout mechanisms to position nodes.
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
Constructor Summary | |
ZLayout()
|
Method Summary | |
protected static double |
computeDimensionTranslation(java.awt.geom.Point2D dim,
java.awt.geom.Point2D currentP,
java.awt.geom.Point2D remainderP,
java.awt.geom.Point2D finishedP,
java.awt.geom.Point2D dir,
java.util.ArrayList coordinates,
boolean ascending)
A helper function that computes the length of path in the given dimension. |
static void |
distribute(ZNode[] nodes,
java.util.ArrayList coordinates)
Distributes a set of nodes (those being ZNodes)
along the path specified by |
static void |
distribute(ZNode[] nodes,
java.util.ArrayList coordinates,
boolean exact,
boolean closedPath)
Distributes a set of nodes (those being ZNodes) along
the (optionally closed) path specified by coordinates . |
static void |
distribute(ZNode[] nodes,
java.util.ArrayList coordinates,
double tolerance,
boolean closedPath)
Distributes a set of nodes (those being ZNodes) along
the (optionally closed) path specified by coordinates . |
static void |
distribute(ZNode[] nodes,
java.util.ArrayList coordinates,
double space,
double tolerance,
boolean exact,
boolean closedPath)
Distributes the given nodes (those being ZNodes)
along the (optionally closed) path specified by
coordinates . |
protected static void |
normalizeList(java.awt.geom.Point2D p)
Normalizes the given ArrayList ie. |
protected static double |
pathLength(java.util.ArrayList coords)
Computes the length of the path for a given ArrayList of coordinates |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZLayout()
Method Detail |
public static void distribute(ZNode[] nodes, java.util.ArrayList coordinates)
nodes (those being ZNodes)
along the path specified by coordinates
. Assumes
exact spacing on a non-closed path with default tolerance.
- Parameters:
nodes
- The nodes to be distributed.coordinates
- The coordinates of the path.- See Also:
distribute(ZNode[], ArrayList, double, boolean)
public static void distribute(ZNode[] nodes, java.util.ArrayList coordinates, boolean exact, boolean closedPath)
nodes
(those being ZNodes) along
the (optionally closed) path specified by coordinates
.
exact
specifies, if false, that the algorithm should
run once using a first guess at spacing or, if true, that the
algorithm should attempt to evenly space the nodes using the entire
path.nodes
- The nodes to be distributed.coordinates
- The coordinates of the path.exact
- Should the algorithm run once and stop or iterate to
get exact spacing.closedPath
- Does the path represent a closed path?distribute(ZNode[], ArrayList, double, double, boolean, boolean)
public static void distribute(ZNode[] nodes, java.util.ArrayList coordinates, double tolerance, boolean closedPath)
nodes
(those being ZNodes) along
the (optionally closed) path specified by coordinates
.
The algorithm will iterate until the nodes are placed along the
path within tolerance
of the given path.nodes
- The nodes to be distributed.coordinates
- The coordinates of the path.tolerance
- The error allowed in placing the nodesclosedPath
- Does the path represent a closed path?distribute(ZNode[], ArrayList, double, double, boolean, boolean)
public static void distribute(ZNode[] nodes, java.util.ArrayList coordinates, double space, double tolerance, boolean exact, boolean closedPath)
nodes
(those being ZNodes)
along the (optionally closed) path specified by
coordinates
. The algorithm initially distributes
the nodes with the specified space
along the path.
If exact
spacing is not requested, the algorithm
does not iterate. Hence, the nodes will be spaced with the
intial value of space
regardless of the nodes' positions.
If exact
spacing is requested, the algorithm
iterates until the nodes and spacing are within
tolerance
of the given path, where tolerance
is specified as a percentage of the total path length. The algorithm
will terminate with suboptimal results if the path is too short for
the nodes or if an optimal result cannot be computed.nodes
- The nodes to be distributed.coordinates
- The coordinates of the path.space
- The initial amount of spacing to leave between nodes.tolerance
- The percent of the total path length to which
the algorithm should compute, a value from 0.0-100.0.exact
- Should the algorithm iterate or make a single pass?closedPath
- Does the path represent a closed path?protected static double computeDimensionTranslation(java.awt.geom.Point2D dim, java.awt.geom.Point2D currentP, java.awt.geom.Point2D remainderP, java.awt.geom.Point2D finishedP, java.awt.geom.Point2D dir, java.util.ArrayList coordinates, boolean ascending)
dim
- The dimension of the bounds in which to perfrom the computationscurrentP
- The current point on the pathremainderP
- The remainder of path from previous pointfinishedP
- The storage location for the resultant destination pointdir
- The current direction of the pathcoordinates
- The coordinates of the pathascending
- Look at the points of the path in ascending or descending order?protected static double pathLength(java.util.ArrayList coords)
coords
- The path for which to compute the lengthprotected static void normalizeList(java.awt.geom.Point2D p)
p
- ArrayList (ArrayList in the physics sense, actually a point) to be normalized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |