fi.hut.tml.xsmiles.mlfc.xforms.dom.swing
Class XMLTreeModel

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.xforms.dom.swing.XMLTreeModel
All Implemented Interfaces:
javax.swing.tree.TreeModel

public class XMLTreeModel
extends java.lang.Object
implements javax.swing.tree.TreeModel


Constructor Summary
XMLTreeModel(org.w3c.dom.Node root)
           
 
Method Summary
 void addTreeModelListener(javax.swing.event.TreeModelListener l)
          Adds a listener for the TreeModelEvent posted after the tree changes.
protected  void fireTreeStructureChanged(org.w3c.dom.Node n, org.w3c.dom.Node parent, boolean removed)
          The only event raised by this model is TreeStructureChanged with the root as path, i.e.
 java.lang.Object getChild(java.lang.Object parent, int index)
          Returns the child of parent at index index in the parent's child array.
protected  int getChildCount(org.w3c.dom.Element e)
           
 int getChildCount(java.lang.Object parent)
          Returns the number of children of parent.
protected  org.w3c.dom.Node getChildNode(org.w3c.dom.Element e, int index)
           
 int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
          Returns the index of child in parent.
 java.lang.Object getRoot()
          Returns the root of the tree.
 boolean isLeaf(java.lang.Object node)
          Returns true if node is a leaf.
 void removeTreeModelListener(javax.swing.event.TreeModelListener l)
          Removes a listener previously added with addTreeModelListener().
 void setRoot(org.w3c.dom.Node root)
           
 void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
          Messaged when the user has altered the value for the item identified by path to newValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLTreeModel

public XMLTreeModel(org.w3c.dom.Node root)
Method Detail

setRoot

public void setRoot(org.w3c.dom.Node root)

fireTreeStructureChanged

protected void fireTreeStructureChanged(org.w3c.dom.Node n,
                                        org.w3c.dom.Node parent,
                                        boolean removed)
The only event raised by this model is TreeStructureChanged with the root as path, i.e. the whole tree has changed.


addTreeModelListener

public void addTreeModelListener(javax.swing.event.TreeModelListener l)
Adds a listener for the TreeModelEvent posted after the tree changes.

Specified by:
addTreeModelListener in interface javax.swing.tree.TreeModel

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Returns the child of parent at index index in the parent's child array.

Specified by:
getChild in interface javax.swing.tree.TreeModel

getChildCount

public int getChildCount(java.lang.Object parent)
Returns the number of children of parent.

Specified by:
getChildCount in interface javax.swing.tree.TreeModel

getChildNode

protected org.w3c.dom.Node getChildNode(org.w3c.dom.Element e,
                                        int index)

getChildCount

protected int getChildCount(org.w3c.dom.Element e)

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
                           java.lang.Object child)
Returns the index of child in parent.

Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel

getRoot

public java.lang.Object getRoot()
Returns the root of the tree.

Specified by:
getRoot in interface javax.swing.tree.TreeModel

isLeaf

public boolean isLeaf(java.lang.Object node)
Returns true if node is a leaf.

Specified by:
isLeaf in interface javax.swing.tree.TreeModel

removeTreeModelListener

public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
Removes a listener previously added with addTreeModelListener().

Specified by:
removeTreeModelListener in interface javax.swing.tree.TreeModel

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath path,
                                java.lang.Object newValue)
Messaged when the user has altered the value for the item identified by path to newValue. Not used by this model.

Specified by:
valueForPathChanged in interface javax.swing.tree.TreeModel


X-Smiles 1.2