|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbeowulf.model.tree.AbstractBinaryTreeModel
This abstract class defines event handling procedures common to all of its
implementors. This is simply another level of abstraction, and allows
another class to provide all of the implementation details on the actual
operation of the tree. Certain rules must be followed by its subclasses to
ensure that events are delivered to the approrpriate listeners. These rules
are largely limited to calling the appropriate fireXXXX method after the
occurrance of a certain TreeModelEvent.
| Field Summary | |
protected EventListenerList |
listenerList
This list contains references to all interested listeners. |
| Constructor Summary | |
AbstractBinaryTreeModel()
|
|
| Method Summary | |
abstract void |
add(Object value)
This method will create a new node with the given value, and add it to the tree. |
void |
addTreeModelListener(TreeModelListener l)
This method adds a TreeModelListener as an interested listener of events to this Tree. |
protected void |
fireNodesChanged(Object source,
BinaryTreeNode[] path)
This method must be called by all subclasses after the value of a node has changed. |
protected void |
fireNodesInserted(Object source,
BinaryTreeNode[] path)
This method must be called by all subclasses after a node is added to the Tree. |
protected void |
fireNodesRemoved(Object source,
BinaryTreeNode[] path)
This method must be called by all subclasses after a node is removed from the Tree. |
protected void |
fireStructureChanged(Object source,
BinaryTreeNode[] path)
This method must be called by all subclasses after the structure of the tree has changed in some large way that will not fit into the simple classifications of the other fireXxx methods. |
EventListener[] |
getListeners(Class listenerType)
Returns an array of all the objects currently registered as FooListeners upon this model. |
TreeModelListener[] |
getTreeListeners()
Returns an array of all the tree listeners registered on this AbstractTreeModel. |
abstract void |
remove(Object value)
Given a node's value, this method will find and remove that node from the tree. |
void |
removeTreeModelListener(TreeModelListener l)
This method removes the TreeModelListener as an interested listener of events to this Tree. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface beowulf.model.tree.BinaryTreeModel |
elements, getMaxDepth, getNodeCount, toString |
| Methods inherited from interface javax.swing.tree.TreeModel |
getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, valueForPathChanged |
| Field Detail |
protected EventListenerList listenerList
| Constructor Detail |
public AbstractBinaryTreeModel()
| Method Detail |
public void addTreeModelListener(TreeModelListener l)
addTreeModelListener in interface TreeModell - The tree listener to add.public void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener in interface TreeModell - The tree listener to remove.
protected void fireNodesInserted(Object source,
BinaryTreeNode[] path)
source - The tree on which the event occurred.path - The path to the node that was added.
protected void fireNodesRemoved(Object source,
BinaryTreeNode[] path)
source - The tree on which the event occurred.path - The path to the node that was removed.
protected void fireNodesChanged(Object source,
BinaryTreeNode[] path)
source - The tree on which the event occurred.path - The path to the node whose value changed.
protected void fireStructureChanged(Object source,
BinaryTreeNode[] path)
source - The tree on which the event occurred.path - The path to the root of the subtree whose structure changed.public TreeModelListener[] getTreeListeners()
AbstractTreeModel.
TreeListeners, or an empty
array if no tree listeners are currently registeredpublic EventListener[] getListeners(Class listenerType)
FooListeners upon this model.
FooListeners are registered using the
addFooListener method.
You can specify the listenerType argument with a class
literal, such as FooListener.class. For example,
you can query a list model m for its list data listeners
with the following code:
TreeListener[] gls = (TreeListener[])(m.getListeners(TreeListener.class));If no such listeners exist, this method returns an empty array.
listenerType - the type of listeners requested; this parameter
should specify an interface that descends from
java.util.EventListener
FooListeners on this model, or an empty array if
no such listeners have been added
ClassCastException - if listenerType doesn't
specify a class or interface that implements
java.util.EventListenerpublic abstract void remove(Object value)
value - The value of the node to be removed.public abstract void add(Object value)
value - The value of the new node.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||