|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.visualize.data.layout.GraphLayoutPart | +--gumbo.visualize.data.layout.GraphLayoutNode
A layout part that occupies space, connects to other nodes via none or more GraphLayoutLink, and is explicitely positioned by a GraphLayoutEngine. In layout space a graphic node's shape is a box of size getSize() centered about its position at getPosition(). Note that duplicate links between nodes are ignored.
Nested Class Summary | |
static class |
GraphLayoutNode.BoundComparator
A comparator for ordering nodes (GraphLayoutNode) by min or max extent along a given dimension. |
static class |
GraphLayoutNode.IndexCenterComparator
A comparator for ordering nodes (GraphLayoutNode) by index barycenter (see getIndexCenter()). |
static class |
GraphLayoutNode.PositionComparator
A comparator for ordering nodes (GraphLayoutNode) by position along a given dimension. |
static class |
GraphLayoutNode.PriorityComparator
A comparator for ordering nodes (GraphLayoutNode) by before and/or after rank priority (see getBeforePriority(), getAfterPriority()). |
Constructor Summary | |
GraphLayoutNode()
|
Method Summary | |
static void |
addLink(GraphLayoutNode tail,
GraphLayoutNode head)
Adds a link from a tail node to a head node. |
static java.util.Set |
backwardNodes(java.util.Collection nodes,
boolean withSources,
java.util.Set retVal)
Gets the set of nodes connected by links "to" a group of nodes. |
static void |
centerNodes(int dim,
double center,
java.util.Collection nodes)
Centers a group of nodes in layout space along a given dimension about a center point. |
static void |
compactNodes(int dim,
java.util.Set nodes)
Compacts a group of nodes in layout space along a given position dimension by removing extra space between planes bounding the nodes and perpendicular to the dimension axis so there are no gaps. |
static java.util.Set |
connectedNodes(java.util.Collection nodes,
boolean withSources,
boolean withSinks,
java.util.Set retVal)
Gets the set of nodes connected by links "to" or "from" a group of nodes. |
static void |
expandBalancedNodes(int dim,
java.util.Collection nodes)
Deprecated. No longer used. |
static void |
expandNodes(int dim,
boolean noCompress,
java.util.Collection nodes)
Expands a group of nodes in layout space along a given position dimension by adding extra space between planes bounding the nodes and perpendicular to the dimension axis so there are no overlaps. |
static java.util.Set |
forwardNodes(java.util.Collection nodes,
boolean withSinks,
java.util.Set retVal)
Gets the set of nodes connected by links "from" a group of nodes. |
java.util.Set |
getAfterNodes()
Gets an immutable view of the after rank nodes for this node, as set by setAfterNodes(). |
double |
getAfterPriority()
Gets the position priority of this node, as set by setAfterPriority(). |
java.util.Set |
getBackwardNodes()
Gets a reference to the immutable set of nodes on links to this node. |
java.util.Set |
getBeforeNodes()
Gets an immutable view of the before rank nodes for this node, as set by setBeforeNodes(). |
double |
getBeforePriority()
Gets the position priority of this node, as set by setBeforePriority(). |
java.util.Set |
getConnectedNodes()
Gets a reference to the immutable set of nodes on links to and from this node. |
java.util.Set |
getForwardNodes()
Gets a reference to the immutable set of nodes on links from this node. |
double |
getIndexCenter()
Gets the index barycenter of this node, as set by setIndexCenter(). |
AxisBound3 |
getLayoutBound(AxisBound3 retVal)
Returns the smallest bounds containing this part, in layout space. |
Point3 |
getPosition(Point3 retVal)
Gets the layout postion of this node, which is at its center. |
Size3 |
getSize(Size3 retVal)
Gets the layout size of this node, including any inter-node gap, as set by setSize(). |
static void |
gridAlignNodes(int dim,
double origin,
java.util.Collection nodes)
Adjusts the positions of a group of nodes along a given dimension aligning them in a grid. |
static java.util.List |
indexCenterList(java.util.Collection nodes,
java.util.List retVal)
Returns a list with the nodes in a node group ordered according to their index barycenters (see GraphLayoutNode.IndexCenterComparator). |
static double[] |
indexCenters(java.util.Collection nodes)
Returns an array with the index barycenters of a group of nodes. |
boolean |
intersectLayout(LayoutPart part)
Returns true if the target part intersects this part in layout space. |
boolean |
isSingular()
Convenience method. |
boolean |
isSink()
Convenience method. |
boolean |
isSource()
Convenience method. |
static void |
offsetNodes(Tuple3 offset,
java.util.Collection nodes)
Adds a position offset in layout space to a group of nodes. |
static java.util.Set |
otherNodes(java.util.Collection nodes,
java.util.Set retVal)
Gets the set of other (non source, non sink, non singular) nodes in a group of nodes. |
double |
positionCenter(int dim,
boolean withBefore,
boolean withAfter)
Returns the position barycenter of this node along a given dimension as computed from the specified friend nodes. |
static double[] |
positionCenters(int dim,
boolean withBefore,
boolean withAfter,
java.util.Collection nodes)
Returns an array with the position barycenters of a group of nodes. |
static java.util.List |
priorityList(java.util.Collection nodes,
boolean sortAll,
boolean useBefore,
java.util.List retVal)
Returns a list with the nodes in a node group ordered according to their before and/or after priorities (see GraphLayoutNode.PriorityComparator). |
static void |
removeLink(GraphLayoutNode tail,
GraphLayoutNode head)
Removes a link from a tail node to a head node. |
static void |
scaleNodes(Point3 point,
Vector3 scale,
java.util.Collection nodes)
Scales the position of a group of nodes about a reference point, in layout space. |
void |
setAfterNodes(java.util.Set nodes)
Sets the nodes connected to this node that are in the rank immediately after (rankI+1) that of this node. |
void |
setAfterPriority(double priority)
Sets the position priority of this node based on its relative number of after node links. |
void |
setBeforeNodes(java.util.Set nodes)
Sets the nodes connected to this node that are in the rank immediately before (rankI-1) that of this node. |
void |
setBeforePriority(double priority)
Sets the position priority of this node based on its relative number of before node links. |
void |
setIndexCenter(double center)
Sets the index barycenter of this node, which is based on the barycenter on this node's before or after node indices. |
void |
setPosition(Point3 pos)
Sets the layout position of this node, which is at its center. |
void |
setSize(Size3 size)
Sets the layout size of this node, including any inter-node gap. |
static java.util.Set |
singularNodes(java.util.Collection nodes,
java.util.Set retVal)
Gets the set of singular nodes in a group of nodes. |
static java.util.Set |
sinkNodes(java.util.Collection nodes,
java.util.Set retVal)
Gets the set of sink nodes in a group of nodes. |
static java.util.Set |
sourceNodes(java.util.Collection nodes,
java.util.Set retVal)
Gets the set of source nodes in a group of nodes. |
java.lang.String |
toString()
|
static SetList |
traceNodes(java.util.Collection seeds,
boolean traceForward,
boolean traceBackward,
boolean traceSources,
boolean traceSinks,
boolean keepSeeds,
java.util.Set prunes)
Traces nodes from the seed nodes and returns all the nodes that are found by simply adding the individual seed traces (see traceConnected()), in seed order, to the output trace. |
static SetList |
traceNodes(GraphLayoutNode seed,
boolean traceForward,
boolean traceBackward,
boolean traceSources,
boolean traceSinks,
boolean keepSeed,
java.util.Set prunes)
Traces nodes from the seed node and returns the nodes found. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GraphLayoutNode()
Method Detail |
public java.util.Set getBackwardNodes()
public java.util.Set getForwardNodes()
public java.util.Set getConnectedNodes()
public void setBeforeNodes(java.util.Set nodes)
nodes
- Before rank nodes (GraphLayoutNode), by value. Never null.public java.util.Set getBeforeNodes()
public void setAfterNodes(java.util.Set nodes)
nodes
- After rank nodes (GraphLayoutNode), by value. Never null.public java.util.Set getAfterNodes()
public boolean isSource()
public boolean isSink()
public boolean isSingular()
public void setSize(Size3 size)
size
- Node size. Never null. Defaults to (1,1,1).public Size3 getSize(Size3 retVal)
retVal
- Return value object. Never null.
public void setPosition(Point3 pos)
pos
- Value of the position. Never null. Defaults to the
origin (0, 0, 0).public Point3 getPosition(Point3 retVal)
retVal
- Return value object. Never null.
public void setIndexCenter(double center)
center
- The new index barycenter.public double getIndexCenter()
public void setBeforePriority(double priority)
priority
- The new position priority. Zero is lowest,
increasing towards positive infinity.public double getBeforePriority()
public void setAfterPriority(double priority)
priority
- The new position priority. Zero is lowest,
increasing towards positive infinity.public double getAfterPriority()
public double positionCenter(int dim, boolean withBefore, boolean withAfter)
dim
- The position dimension (0:2).withBefore
- If true, includes before node position.withAfter
- If true, includes after node position.
public static double[] positionCenters(int dim, boolean withBefore, boolean withAfter, java.util.Collection nodes)
dim
- The position dimension (0:2).withBefore
- If true, includes before node position.withAfter
- If true, includes after node position.nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.
public boolean intersectLayout(LayoutPart part)
LayoutPart
part
- The target part. Never null.
public AxisBound3 getLayoutBound(AxisBound3 retVal)
LayoutPart
retVal
- Return value object. Never null.
public java.lang.String toString()
toString
in class java.lang.Object
public static void addLink(GraphLayoutNode tail, GraphLayoutNode head)
tail
- Tail node. Never null.head
- Head node. Never null.public static void removeLink(GraphLayoutNode tail, GraphLayoutNode head)
tail
- Tail node. Never null.head
- Head node. Never null.public static java.util.Set sourceNodes(java.util.Collection nodes, java.util.Set retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.retVal
- Return value object. Filtered nodes (GraphLayoutNode).
Never null.
public static java.util.Set sinkNodes(java.util.Collection nodes, java.util.Set retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.retVal
- Return value object. Filtered nodes (GraphLayoutNode).
Never null.
public static java.util.Set singularNodes(java.util.Collection nodes, java.util.Set retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.retVal
- Return value object. Filtered nodes (GraphLayoutNode).
Never null.
public static java.util.Set otherNodes(java.util.Collection nodes, java.util.Set retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.retVal
- Return value object. Filtered nodes (GraphLayoutNode).
Never null.
public static java.util.Set forwardNodes(java.util.Collection nodes, boolean withSinks, java.util.Set retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.withSinks
- If true, sink nodes are included in the result.retVal
- Return value object. Filtered nodes (GraphLayoutNode).
Never null.
public static java.util.Set backwardNodes(java.util.Collection nodes, boolean withSources, java.util.Set retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.retVal
- Return value object. Filtered nodes (GraphLayoutNode).
Never null.
public static java.util.Set connectedNodes(java.util.Collection nodes, boolean withSources, boolean withSinks, java.util.Set retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.retVal
- Return value object. Filtered nodes (GraphLayoutNode).
Never null.
public static double[] indexCenters(java.util.Collection nodes)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.
public static java.util.List indexCenterList(java.util.Collection nodes, java.util.List retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.retVal
- Return value object. Ordered list (GraphLayoutNode).
Never null.
public static java.util.List priorityList(java.util.Collection nodes, boolean sortAll, boolean useBefore, java.util.List retVal)
nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.sortAll
- If true, all nodes are sorted, with equal nodes
being sorted by hash code; otherwise, duplicates are left out.useBefore
- If true, uses before priorities; otherwise, uses
after priorities.retVal
- Return value object. Ordered list (GraphLayoutNode).
Never null.
public static SetList traceNodes(GraphLayoutNode seed, boolean traceForward, boolean traceBackward, boolean traceSources, boolean traceSinks, boolean keepSeed, java.util.Set prunes)
seed
- The trace seed node. The seed node may be excluded from
the result, but it will never be excluded from the trace. Never null.traceForward
- If true, forward links are traced.traceBackward
- If true, backward links are traced.traceSources
- If false, sources are not traced but are included in
the result. Use prunes to exclude sources from the trace and result.traceSinks
- If false, sinks are not traced but are included in
the result. Use prunes to exclude sinks from the trace and result.keepSeed
- If true, the seed will be in the trace. If false,
the seed will be pruned from the trace if it is in prunes.prunes
- Nodes (GraphLayoutNode) that will be excluded from the
trace and result, except for the seed, which will be traced even if pruned
(at the end). If null, all traced nodes will be included in the result.
public static SetList traceNodes(java.util.Collection seeds, boolean traceForward, boolean traceBackward, boolean traceSources, boolean traceSinks, boolean keepSeeds, java.util.Set prunes)
seeds
- The trace seed nodes (GraphLayoutNode). The seed nodes
may be excluded from the result, but they will never be excluded
from the trace. Never null.traceForward
- If true, forward links are traced.traceBackward
- If true, backward links are traced.traceSources
- If false, sources are not traced but are included in
the result. Use prunes the exclude sources from the trace and result.traceSinks
- If false, sinks are not traced but are included in
the result. Use prunes the exclude sinks from the trace and result.keepSeeds
- If true, the seeds will be in the trace. If false,
a seed will be pruned from the trace if it is in prunes.prunes
- Nodes (GraphLayoutNode) that will be excluded from the
trace and result, except for the seed, which will be traced even if pruned
(at the end). If null, all traced nodes will be included in the result.
public static void expandNodes(int dim, boolean noCompress, java.util.Collection nodes)
dim
- Dimension to be compacted (0:2).noCompress
- If true, extra space between nodes is maintained.
If false, extra space is absorbed in the expansion.nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.public static void compactNodes(int dim, java.util.Set nodes)
dim
- Dimension to be compacted (0:2).nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.public static void gridAlignNodes(int dim, double origin, java.util.Collection nodes)
dim
- Dimension to be grid-aligned (0:2).origin
- The grid origin, which is the position of the
minimum extent of the origin grid cell. used only for grid
alignment, not large-scale offset.nodes
- The group of nodes (GraphLayoutNode). Never null.public static void expandBalancedNodes(int dim, java.util.Collection nodes)
dim
- Node position dimension affected (0:2).nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.public static void centerNodes(int dim, double center, java.util.Collection nodes)
dim
- Dimension to be centered (0:2).center
- Center point. Never null.nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.public static void offsetNodes(Tuple3 offset, java.util.Collection nodes)
offset
- Offset value. Never null.nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.public static void scaleNodes(Point3 point, Vector3 scale, java.util.Collection nodes)
point
- Reference point. Never null.scale
- Scale factor. Positive for magnification, negative
for minification. Never null.nodes
- AbstractGroup of nodes (GraphLayoutNode). Never null.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |