Treeviz 0.37 2010-10-17

ch.randelshofer.tree.demo
Class TreevizFileSystemXMLNodeInfo

java.lang.Object
  extended by ch.randelshofer.tree.demo.AbstractNodeInfo
      extended by ch.randelshofer.tree.demo.TreevizFileSystemXMLNodeInfo
All Implemented Interfaces:
NodeInfo

public class TreevizFileSystemXMLNodeInfo
extends AbstractNodeInfo

XMLNodeInfo produces information about generic XML files. It attempts to interpret the XML attrMap 'name', 'size', and 'created' like file system attrMap.

Version:
1.2 2010-10-17 Use preferences for determining the weight, color and name attribute.
1.1 2009-03-20 Factured weight formatting out.
1.0.1 2009-03-04 Get cumulatedWeight if node has no fileSize attribute.
1.0 23. Juni 2008 Created.
Author:
Werner Randelshofer

Nested Class Summary
 class TreevizFileSystemXMLNodeInfo.InfoTableModel
           
 
Nested classes/interfaces inherited from class ch.randelshofer.tree.demo.AbstractNodeInfo
AbstractNodeInfo.DataType
 
Constructor Summary
TreevizFileSystemXMLNodeInfo(TreevizFileSystemXMLTree tree)
          Creates a new instance.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
           
 void collectAttributesRecursively(TreevizFileSystemXMLNode node, java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> attrMap)
           
 void computeBasicStats(TreevizFileSystemXMLNode root, java.util.HashMap<java.lang.String,AbstractNodeInfo.DataType> typeMap, java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> attrMap)
           
 void computeFilesStats(TreevizFileSystemXMLNode root)
           
 void computeUserFileStatsRecursive(TreevizFileSystemXMLNode filesNode)
           
 void computeUserStats(TreevizFileSystemXMLNode usersRoot, TreevizFileSystemXMLNode filesRoot)
           
protected  void fireStateChanged()
           
 long getAccumulatedWeight(TreePath2<TreeNode> path)
           
 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.
 AbstractNodeInfo.DataType getType(java.lang.String key)
           
 javax.swing.table.TableModel getUserTable()
           
 java.util.Set<java.lang.String> getValues(java.lang.String key)
           
 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 init(TreevizFileSystemXMLNode root)
           
 boolean isNodeSelected(TreevizFileSystemXMLNode node)
           
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Removes a change listener from the button.
 void setSelectedUsers(java.util.HashMap<java.lang.String,TreevizFileSystemXMLNode> newValue)
           
 void toggleColorWeighter()
           
 
Methods inherited from class ch.randelshofer.tree.demo.AbstractNodeInfo
determineDataType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreevizFileSystemXMLNodeInfo

public TreevizFileSystemXMLNodeInfo(TreevizFileSystemXMLTree tree)
Creates a new instance.

Method Detail

getName

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


getColor

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


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).

Returns:
The weight between 0 and Double.MAX_VALUE.

getWeight

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

Returns:
The weight between 0 and Double.MAX_VALUE.

getAccumulatedWeight

public long getAccumulatedWeight(TreePath2<TreeNode> path)

getTooltip

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


getImage

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


getWeighter

public Weighter getWeighter()

getColorizer

public Colorizer getColorizer()

init

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


init

public void init(TreevizFileSystemXMLNode root)

computeBasicStats

public void computeBasicStats(TreevizFileSystemXMLNode root,
                              java.util.HashMap<java.lang.String,AbstractNodeInfo.DataType> typeMap,
                              java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> attrMap)

computeFilesStats

public void computeFilesStats(TreevizFileSystemXMLNode root)

collectAttributesRecursively

public void collectAttributesRecursively(TreevizFileSystemXMLNode node,
                                         java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> attrMap)

computeUserStats

public void computeUserStats(TreevizFileSystemXMLNode usersRoot,
                             TreevizFileSystemXMLNode filesRoot)

computeUserFileStatsRecursive

public void computeUserFileStatsRecursive(TreevizFileSystemXMLNode filesNode)

getType

public AbstractNodeInfo.DataType getType(java.lang.String key)

getValues

public java.util.Set<java.lang.String> getValues(java.lang.String key)

isNodeSelected

public boolean isNodeSelected(TreevizFileSystemXMLNode node)

setSelectedUsers

public void setSelectedUsers(java.util.HashMap<java.lang.String,TreevizFileSystemXMLNode> newValue)

getUserTable

public javax.swing.table.TableModel getUserTable()

toggleColorWeighter

public void toggleColorWeighter()

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)

removeChangeListener

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


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.


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