Treeviz 0.37 2010-10-17

ch.randelshofer.tree
Class DefaultNodeInfo

java.lang.Object
  extended by ch.randelshofer.tree.DefaultNodeInfo
All Implemented Interfaces:
NodeInfo
Direct Known Subclasses:
FileNodeInfo

public class DefaultNodeInfo
extends java.lang.Object
implements NodeInfo

DefaultNodeInfo.

Author:
Werner Randelshofer  @version 1.0 Jan 26, 2008 Created.

Constructor Summary
DefaultNodeInfo()
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
           
protected  void fireStateChanged()
           
 java.awt.Color getColor(TreePath2<TreeNode> path)
          Returns the color of the node.
 Colorizer getColorizer()
           
 long getCumulatedWeight(TreePath2<TreeNode> path)
          Returns the cumulated weight of a node (the sum of the weights of this node and of all its children).
 java.awt.Image getImage(TreePath2<TreeNode> path)
          Returns the image of the node.
 java.lang.String getName(TreePath2<TreeNode> path)
          Returns the name of the node.
 java.lang.String getTooltip(TreePath2<TreeNode> path)
          Returns the tooltip of the node.
 long getWeight(TreePath2<TreeNode> path)
          Returns the weight of a node.
 Weighter getWeighter()
           
 java.lang.String getWeightFormatted(TreePath2<TreeNode> path)
          Returns the string formatted weight of a node.
 void init(TreeNode root)
          Initializes the node info.
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Removes a change listener from the button.
 void toggleColorWeighter()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNodeInfo

public DefaultNodeInfo()
Method Detail

getName

public java.lang.String getName(TreePath2<TreeNode> path)
Description copied from interface: NodeInfo
Returns the name of the node.

Specified by:
getName in interface NodeInfo

getColor

public java.awt.Color getColor(TreePath2<TreeNode> path)
Description copied from interface: NodeInfo
Returns the color of the node.

Specified by:
getColor in interface NodeInfo

getWeight

public long getWeight(TreePath2<TreeNode> path)
Description copied from interface: NodeInfo
Returns the weight of a node.

Specified by:
getWeight in interface NodeInfo
Returns:
The weight between 0 and Double.MAX_VALUE.

getTooltip

public java.lang.String getTooltip(TreePath2<TreeNode> path)
Description copied from interface: NodeInfo
Returns the tooltip of the node.

Specified by:
getTooltip in interface NodeInfo

getImage

public java.awt.Image getImage(TreePath2<TreeNode> path)
Description copied from interface: NodeInfo
Returns the image of the node.

Specified by:
getImage in interface NodeInfo

init

public void init(TreeNode root)
Description copied from interface: NodeInfo
Initializes the node info.

Specified by:
init in interface NodeInfo

getWeighter

public Weighter getWeighter()
Specified by:
getWeighter in interface NodeInfo

getColorizer

public Colorizer getColorizer()
Specified by:
getColorizer in interface NodeInfo

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Specified by:
addChangeListener in interface NodeInfo

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Removes a change listener from the button.

Specified by:
removeChangeListener in interface NodeInfo

fireStateChanged

protected void fireStateChanged()

getWeightFormatted

public java.lang.String getWeightFormatted(TreePath2<TreeNode> path)
Description copied from interface: NodeInfo
Returns the string formatted weight of a node.

Specified by:
getWeightFormatted in interface NodeInfo

toggleColorWeighter

public void toggleColorWeighter()
Specified by:
toggleColorWeighter in interface NodeInfo

getCumulatedWeight

public long getCumulatedWeight(TreePath2<TreeNode> path)
Description copied from interface: NodeInfo
Returns the cumulated weight of a node (the sum of the weights of this node and of all its children).

Specified by:
getCumulatedWeight in interface NodeInfo
Returns:
The weight between 0 and Double.MAX_VALUE.

Copyright 2007-2008 (c) Werner Randelshofer.
All rights reserved.