yu.ac.bg.etf.javaqx.qswing.tree
Interface TreeModel

All Known Implementing Classes:
DefaultTreeModel

public interface TreeModel

Tree Model.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Method Summary
 void addTreeModelListener(TreeModelListener listener)
          Adds tree mode listener.
 java.lang.Object getChild(java.lang.Object parent, int index)
          Returns child of the specified parent at specified index.
 int getChildCount(java.lang.Object parent)
          Returns the number of children of specified parent.
 int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
          Returns index of child of specified parent.
 java.lang.Object getRoot()
          Returns root.
 boolean isLeaf(java.lang.Object node)
          Returns true if node is leaf.
 void removeTreeModelListener(TreeModelListener listener)
          Removes tree mode listener.
 void valueForPathChanged(TreePath path, java.lang.Object value)
          Sets new value for the specified node.
 

Method Detail

getRoot

public java.lang.Object getRoot()
Returns root.

Returns:
root

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Returns child of the specified parent at specified index.

Parameters:
parent - the parent
index - the index
Returns:
child of the specified parent at specified index

getChildCount

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

Parameters:
parent - the parent
Returns:
the number of children of specified parent

isLeaf

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

Parameters:
node - the node
Returns:
true if node is leaf

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                java.lang.Object value)
Sets new value for the specified node.

Parameters:
path - the path to the node that should be modified
value - the new value

getIndexOfChild

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

Parameters:
parent - the parent
child - the child
Returns:
index of child of specified parent

addTreeModelListener

public void addTreeModelListener(TreeModelListener listener)
Adds tree mode listener.

Parameters:
listener - the tree mode listener

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener listener)
Removes tree mode listener.

Parameters:
listener - the tree mode listener


Copyright © 2007 ETF and contributors. All Rights Reserved.