net.sf.jtreemap.swing
Class TreeMapNodeBuilder

java.lang.Object
  extended by net.sf.jtreemap.swing.TreeMapNodeBuilder
All Implemented Interfaces:
java.io.Serializable

public class TreeMapNodeBuilder
extends java.lang.Object
implements java.io.Serializable

Tree builder for a JTreeMap.

See Also:
Serialized Form
 

Constructor Summary
TreeMapNodeBuilder()
           
 
Method Summary
 TreeMapNode buildBranch(java.lang.String label, TreeMapNode parent)
          Add a branch to the tree.
 TreeMapNode buildLeaf(java.lang.String label, double weight, Value value, TreeMapNode parent)
          add a leaf to the tree.
 TreeMapNode getRoot()
          get the build tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeMapNodeBuilder

public TreeMapNodeBuilder()
Method Detail

buildBranch

public TreeMapNode buildBranch(java.lang.String label,
                               TreeMapNode parent)
Add a branch to the tree.
If the parent is null, the build node become the root if and only if the tree have no root yet. If the parent is null and if the root is already build, the node will NOT be added to the tree.

Parameters:
label - label of the node
parent - father of the node
Returns:
the created node

buildLeaf

public TreeMapNode buildLeaf(java.lang.String label,
                             double weight,
                             Value value,
                             TreeMapNode parent)
add a leaf to the tree.
If the parent is null, the build node become the root if and only if the tree have no root yet. If the parent is null and if the root is already build, the node will NOT be added to the tree.

Parameters:
label - label of the leaf
weight - weight of the leaf
value - Value of the leaf
parent - father of the leaf
Returns:
the created node

getRoot

public TreeMapNode getRoot()
get the build tree.

Returns:
the root of the tree