dsto.dfc.swing.commands
Class CommandViewTreeModel

java.lang.Object
  extended by dsto.dfc.swing.tree.BasicTreeModelEventSource
      extended by dsto.dfc.swing.tree.AbstractDfcTreeModel
          extended by dsto.dfc.swing.commands.CommandViewTreeModel
All Implemented Interfaces:
CommandViewNodeListener, DfcTreeModel, Disposable, Serializable, EventListener, TreeModel

public class CommandViewTreeModel
extends AbstractDfcTreeModel
implements DfcTreeModel, CommandViewNodeListener

See Also:
Serialized Form

Constructor Summary
CommandViewTreeModel(CommandViewNode root)
           
 
Method Summary
 void childAdded(CommandViewNodeEvent e)
          Fired when a child is added to the node.
 void childMoved(CommandViewNodeEvent e)
          Fired when a child is moved within the node.
 void childRemoved(CommandViewNodeEvent e)
          Fired when a child is removed from the node.
 void commandChanged(CommandViewNodeEvent e)
          Fired when a child is moved within the node.
 Object getChild(Object parent, int index)
           
 int getChildCount(Object parent)
           
 int getIndexOfChild(Object parent, Object child)
           
 Object getParent(Object entry)
          Get the parent for a given entry, or null if the entry is the root.
 Object getRoot()
           
 boolean isLeaf(Object entry)
           
protected  void registerListener(CommandViewNode node)
           
protected  void unregisterListener(CommandViewNode node)
           
 void valueForPathChanged(TreePath path, Object newValue)
           
 
Methods inherited from class dsto.dfc.swing.tree.AbstractDfcTreeModel
addEntry, canAddEntry, canCopyEntry, canMoveEntry, canPasteEntry, canRemoveEntry, copyEntry, getPathForEntry, isAncestor, isMutable, moveEntry, pasteEntry, removeEntry
 
Methods inherited from class dsto.dfc.swing.tree.BasicTreeModelEventSource
addTreeModelListener, dispose, fireTreeNodeChanged, fireTreeNodeInserted, fireTreeNodeRemoved, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, fireTreeStructureChanged, getTreeModelListenerCount, removeTreeModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dsto.dfc.swing.tree.DfcTreeModel
addEntry, canAddEntry, canCopyEntry, canMoveEntry, canPasteEntry, canRemoveEntry, copyEntry, getPathForEntry, isMutable, moveEntry, pasteEntry, removeEntry
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, removeTreeModelListener
 

Constructor Detail

CommandViewTreeModel

public CommandViewTreeModel(CommandViewNode root)
Method Detail

getRoot

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

getChild

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

getChildCount

public int getChildCount(Object parent)
Specified by:
getChildCount in interface TreeModel
Specified by:
getChildCount in class AbstractDfcTreeModel

isLeaf

public boolean isLeaf(Object entry)
Specified by:
isLeaf in interface TreeModel
Specified by:
isLeaf in class AbstractDfcTreeModel

getIndexOfChild

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

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object newValue)
Specified by:
valueForPathChanged in interface TreeModel
Overrides:
valueForPathChanged in class AbstractDfcTreeModel

getParent

public Object getParent(Object entry)
Description copied from interface: DfcTreeModel
Get the parent for a given entry, or null if the entry is the root.

Specified by:
getParent in interface DfcTreeModel
Specified by:
getParent in class AbstractDfcTreeModel

registerListener

protected void registerListener(CommandViewNode node)

unregisterListener

protected void unregisterListener(CommandViewNode node)

childAdded

public void childAdded(CommandViewNodeEvent e)
Description copied from interface: CommandViewNodeListener
Fired when a child is added to the node.

Specified by:
childAdded in interface CommandViewNodeListener
Parameters:
e - The event. e e.getNode () == new node, e.getOldIndex () == -1, e.getNewIndex () == index of new node.

childRemoved

public void childRemoved(CommandViewNodeEvent e)
Description copied from interface: CommandViewNodeListener
Fired when a child is removed from the node.

Specified by:
childRemoved in interface CommandViewNodeListener
Parameters:
e - The event. e.getNode () == removed node, e.getOldIndex () == old index of node, e.getNewIndex () == -1.

childMoved

public void childMoved(CommandViewNodeEvent e)
Description copied from interface: CommandViewNodeListener
Fired when a child is moved within the node.

Specified by:
childMoved in interface CommandViewNodeListener
Parameters:
e - The event. e.getNode () == moved node, e.getOldIndex () == old index of node, e.getNewIndex () == new index.

commandChanged

public void commandChanged(CommandViewNodeEvent e)
Description copied from interface: CommandViewNodeListener
Fired when a child is moved within the node.

Specified by:
commandChanged in interface CommandViewNodeListener
Parameters:
e - The event. e.getSourceNode () == node that changed, e.getNode () == null, e.getOldCommand () == old command (may be null), e.getNewCommand () == new command.


Copyright © 2008 Commonwealth of Australia