kiwi.ui.model
Interface ITreeModel

All Known Implementing Classes:
StaticTreeModel, DynamicTreeModel

public abstract interface ITreeModel

This interface defines the behavior for a data model for hierarchical data structures.

Version:
1.1 (10/98)
Author:
Mark Lindner, PING Software Group

Method Summary
 void addTreeModelListener(TreeModelListener listener)
          Add a TreeModelListener to this model's list of listeners.
 void collapse(ITreeNode node)
          Collapse a node.
 void expand(ITreeNode node)
          Expand a node.
 int getChildCount(ITreeNode node)
          Get a child count for a node.
 ITreeNode[] getChildren(ITreeNode node)
          Get the children of a node.
 ITreeNode getParent(ITreeNode node)
          Get the parent of a node.
 ITreeNode getRoot()
          Get the roots.
 Object getValueForProperty(String property, ITreeNode node)
          Get the value of an arbitrary property for a given node.
 boolean isExpandable(ITreeNode node)
          Determine if a node is expandable.
 boolean isExpanded(ITreeNode node)
          Determine if a node is currently expanded.
 void removeTreeModelListener(TreeModelListener listener)
          Remove a TreeModelListener from this model's list of listeners.
 

Method Detail

getChildCount

public int getChildCount(ITreeNode node)
Get a child count for a node.
Parameters:
node - The parent node.
Returns:
The number of children that node has.

getChildren

public ITreeNode[] getChildren(ITreeNode node)
Get the children of a node.
Parameters:
node - The parent node.
Returns:
An array of the child nodes.

getRoot

public ITreeNode getRoot()
Get the roots.
Returns:
The hierarchy's root object.

getParent

public ITreeNode getParent(ITreeNode node)
Get the parent of a node.
Parameters:
node - The child node. return The parent of the specified child node.

isExpandable

public boolean isExpandable(ITreeNode node)
Determine if a node is expandable.
Parameters:
node - The node to test.
Returns:
true if the node is expandable, false otherwise.
See Also:
isExpanded(kiwi.ui.model.ITreeNode)

isExpanded

public boolean isExpanded(ITreeNode node)
Determine if a node is currently expanded.
Parameters:
node - The node to test.
Returns:
true if the node is expanded, false otherwise.

getValueForProperty

public Object getValueForProperty(String property,
                                  ITreeNode node)
Get the value of an arbitrary property for a given node.
Parameters:
node - The node.
property - The name of the property.
Returns:
The value of the specified property, or null if there is no value for this property.

expand

public void expand(ITreeNode node)
Expand a node.
Parameters:
node - The node to expand.
See Also:
collapse(kiwi.ui.model.ITreeNode)

collapse

public void collapse(ITreeNode node)
Collapse a node.
Parameters:
node - The node to collapse.
See Also:
expand(kiwi.ui.model.ITreeNode), isExpandable(kiwi.ui.model.ITreeNode)

addTreeModelListener

public void addTreeModelListener(TreeModelListener listener)
Add a TreeModelListener to this model's list of listeners.
Parameters:
listener - The listener to add.
See Also:
removeTreeModelListener(kiwi.event.TreeModelListener)

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener listener)
Remove a TreeModelListener from this model's list of listeners.
Parameters:
listener - The listener to remove.
See Also:
addTreeModelListener(kiwi.event.TreeModelListener)