org.xnap.commons.gui.tree
Class AbstractTreeModel

java.lang.Object
  extended by org.xnap.commons.gui.tree.AbstractTreeModel
All Implemented Interfaces:
TreeModel
Direct Known Subclasses:
FileTreeModel

public abstract class AbstractTreeModel
extends Object
implements TreeModel

AbstractTreeModel provides a base class for tree models that is not based on TreeNode objects.

Author:
Steffen Pingel

Field Summary
protected  EventListenerList listenerList
           
protected  String root
           
 
Constructor Summary
AbstractTreeModel(String root)
           
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
           
protected  void fireTreeNodesInserted(TreeModelEvent e)
           
protected  void fireTreeNodesRemoved(TreeModelEvent e)
           
protected  void fireTreeStructureChanged(TreeModelEvent e)
           
abstract  Object getChild(Object parent, int index)
           
abstract  int getChildCount(Object node)
           
abstract  int getIndexOfChild(Object parent, Object child)
           
 Object getRoot()
           
abstract  boolean isLeaf(Object node)
           
 void reload()
           
 void removeTreeModelListener(TreeModelListener l)
           
 void valueForPathChanged(TreePath path, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected transient EventListenerList listenerList

root

protected String root
Constructor Detail

AbstractTreeModel

public AbstractTreeModel(String root)
Method Detail

addTreeModelListener

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

fireTreeNodesInserted

protected void fireTreeNodesInserted(TreeModelEvent e)

fireTreeNodesRemoved

protected void fireTreeNodesRemoved(TreeModelEvent e)

fireTreeStructureChanged

protected void fireTreeStructureChanged(TreeModelEvent e)

getChild

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

getChildCount

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

getIndexOfChild

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

getRoot

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

isLeaf

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

reload

public void reload()

removeTreeModelListener

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

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object value)
Specified by:
valueForPathChanged in interface TreeModel


Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.