FreeHEP API
Version current

hep.io.root.util
Class RootDirectoryTreeModel

java.lang.Object
  extended byhep.io.root.util.RootDirectoryTreeModel
All Implemented Interfaces:
TreeModel

public class RootDirectoryTreeModel
extends Object
implements TreeModel

An adaptor that converts a root TDirectory into a TreeModel, allowing any directory structure to be dislayed by a Swing JTree.

This model will also drill down into TTree's, showing the branch and leaf structure inside.

Version:
$Id: RootDirectoryTreeModel.java,v 1.22 2005/08/10 00:56:35 tonyj Exp $
Author:
Tony Johnson (tonyj@slac.stanford.edu)
Source Code:
RootDirectoryTreeModel.java

Constructor Summary
RootDirectoryTreeModel(TDirectory topDir)
          Create the tree model
 
Method Summary
 void addTreeModelListener(TreeModelListener p1)
           
 Object getChild(Object parent, int index)
           
 int getChildCount(Object parent)
           
 int getIndexOfChild(Object parent, Object child)
           
 Object getRoot()
           
protected  void handleException(IOException x)
          Handle IOExceptions when reading the root file.
protected  void handleException(RootClassNotFound x)
           
 boolean isLeaf(Object parent)
           
 void removeTreeModelListener(TreeModelListener p1)
           
 void valueForPathChanged(TreePath p1, Object p2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootDirectoryTreeModel

public RootDirectoryTreeModel(TDirectory topDir)
Create the tree model

Parameters:
topDir - The TDirectory that is to appear as the "root" of the tree
Method Detail

getChild

public Object getChild(Object parent,
                       int index)
Specified by:
getChild in interface TreeModel

getChildCount

public int getChildCount(Object parent)
Specified by:
getChildCount in interface TreeModel

getIndexOfChild

public int getIndexOfChild(Object parent,
                           Object child)
Specified by:
getIndexOfChild in interface TreeModel

isLeaf

public boolean isLeaf(Object parent)
Specified by:
isLeaf in interface TreeModel

getRoot

public Object getRoot()
Specified by:
getRoot in interface TreeModel

addTreeModelListener

public void addTreeModelListener(TreeModelListener p1)
Specified by:
addTreeModelListener in interface TreeModel

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener p1)
Specified by:
removeTreeModelListener in interface TreeModel

valueForPathChanged

public void valueForPathChanged(TreePath p1,
                                Object p2)
Specified by:
valueForPathChanged in interface TreeModel

handleException

protected void handleException(IOException x)
Handle IOExceptions when reading the root file. Can be overriden in order to handle IOExceptions encountered when reading objects from the root file. The default implementation throws a RuntimeException


handleException

protected void handleException(RootClassNotFound x)

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.