com.jgraph.layout.tree
public class JGraphTreeLayout extends JGraphAbstractTreeLayout
TreeNode
structure with appropriate interfaces to the
actual graph model. The layout can be configured by orientation, the
alignment of the nodes per level, the minimum distance between
Nested Class Summary | |
---|---|
protected class | JGraphTreeLayout.PolyLine
ADT of a straight part of a polyline |
protected class | JGraphTreeLayout.StandardTreeNode
An ADT representing a node in a tree structure. |
Field Summary | |
---|---|
protected int | alignment
alignment indicates what part of the vertices will be lined up on each
row (level) of the tree. |
protected boolean | combineLevelNodes
Whether or not to bring all nodes on the same level to the same height in
the tree |
Method Summary | |
---|---|
protected int | distance(JGraphTreeLayout.PolyLine right, JGraphTreeLayout.PolyLine left) |
int | getAlignment() |
protected JGraphTreeLayout.StandardTreeNode | getLeftMostX(JGraphTreeLayout.StandardTreeNode node)
Obtains the left most point on the sub-tree under the specified tree node
|
protected JGraphTreeLayout.StandardTreeNode | getRightMostX(JGraphTreeLayout.StandardTreeNode node)
Obtains the right most point on the sub-tree under the specified tree
node
|
protected JGraphTreeLayout.StandardTreeNode | getTreeNode(Object cell)
Obtains the tree node corresponding to the specified cell
|
boolean | isCombineLevelNodes() |
protected void | join(JGraphTreeLayout.StandardTreeNode node)
Joins nodes underneath the specified tree node
|
protected void | layout(JGraphTreeLayout.StandardTreeNode node)
Top-level method that performs actual layout of tree for a specific node.
|
protected void | merge(JGraphTreeLayout.PolyLine main, JGraphTreeLayout.PolyLine left, double distance)
Merges two parts of a polyline together
|
void | run(JGraphFacade graph)
The API method used to exercise the layout upon the facade description
and produce a separate description of the vertex position and edge
routing changes made. |
void | setAlignment(int alignment)
SwingConstants.TOP SwingConstants.CENTER SwingConstants.BOTTOM are valid
inputs to this method
|
void | setCombineLevelNodes(boolean combineLevelNodes) |
protected void | setLevelHeights(JGraphTreeLayout.StandardTreeNode root)
Sets the heights of the level under the specified node
|
protected void | setPosition(List roots)
Sets the position of the tree nodes specified
|
protected void | spaceMultipleTrees(JGraphTreeLayout.StandardTreeNode root)
Ensures that the specified root is spaced far enough from previous trees
so not to overlap any cells.
|
String | toString()
Returns Tree , the name of this algorithm. |
Parameters: right first part of polyline left second part of polyline
Returns: the distance between the two polylines
Returns: Returns the alignment.
Parameters: node the start of the sub-tree to be analysed
Returns: the left-most tree node in the sub-tree
Parameters: node the start of the sub-tree to be analysed
Returns: the right-most tree node in the sub-tree
Parameters: cell the cell whose tree node is to be found
Returns: the matching tree node, if any
Returns: Returns the combineLevelNodes.
Parameters: node the node under which the tree is to be formed
Parameters: node the tree node to be laid out
Parameters: main the main part of the polyline left the polyline to be added distance
Parameters: graph the facade describing the graph and its configuration
Parameters: alignment
Parameters: combineLevelNodes The combineLevelNodes to set.
Parameters: root the node under which level heights will be set
Parameters: roots the tree node whose position is to be set
Parameters: root the root of the tree to be spaced correctly
Tree
, the name of this algorithm.