TreeNode -
Adapted from https://code.google.com/p/treelayout/ to be available to GWT clients
public class TreeLayout<TreeNode> extends Object
getNodeBounds().
| Constructor and Description |
|---|
TreeLayout(TreeForTreeLayout<TreeNode> tree,
NodeExtentProvider<TreeNode> nodeExtentProvider,
Configuration<TreeNode> configuration) |
TreeLayout(TreeForTreeLayout<TreeNode> tree,
NodeExtentProvider<TreeNode> nodeExtentProvider,
Configuration<TreeNode> configuration,
boolean useIdentity)
Creates a TreeLayout for a given tree.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkTree()
Check if the tree is a "valid" tree.
|
Rectangle2D |
getBounds()
Returns the bounds of the tree layout.
|
Configuration<TreeNode> |
getConfiguration()
Returns the Configuration used by this
TreeLayout. |
int |
getLevelCount()
Returns the number of levels of the tree.
|
Map<TreeNode,Rectangle2D> |
getNodeBounds()
Returns the layout of the tree nodes by mapping each node of the tree to
its bounds (position and size).
|
NodeExtentProvider<TreeNode> |
getNodeExtentProvider()
Returns the
NodeExtentProvider used by this TreeLayout. |
double |
getSizeOfLevel(int level)
Returns the size of a level.
|
TreeForTreeLayout<TreeNode> |
getTree()
Returns the Tree the layout is created for.
|
public TreeLayout(TreeForTreeLayout<TreeNode> tree, NodeExtentProvider<TreeNode> nodeExtentProvider, Configuration<TreeNode> configuration, boolean useIdentity)
NodeExtentProvider and the
Configuration must be given.useIdentity - [default: false] when true, identity ("==") is used instead of
equality ("equals(...)") when checking nodes. Within a tree
each node must only be once (using this check).public TreeLayout(TreeForTreeLayout<TreeNode> tree, NodeExtentProvider<TreeNode> nodeExtentProvider, Configuration<TreeNode> configuration)
public TreeForTreeLayout<TreeNode> getTree()
public NodeExtentProvider<TreeNode> getNodeExtentProvider()
NodeExtentProvider used by this TreeLayout.public Configuration<TreeNode> getConfiguration()
TreeLayout.public Rectangle2D getBounds()
public int getLevelCount()
public double getSizeOfLevel(int level)
level - public Map<TreeNode,Rectangle2D> getNodeBounds()
public void checkTree()
Copyright © 2012–2016 JBoss by Red Hat. All rights reserved.