gate.swing
Class AbstractTreeTableModel

java.lang.Object
  extended by gate.swing.AbstractTreeTableModel
All Implemented Interfaces:
TreeTableModel, TreeModel

public abstract class AbstractTreeTableModel
extends Object
implements TreeTableModel

An abstract implementation of the TreeTableModel interface. Its main purpose is handling the list of listeners.


Field Summary
protected  EventListenerList listenerList
          The list of listeners.
protected  Object root
          The root of the tree.
 
Constructor Summary
AbstractTreeTableModel(Object root)
          Constructor for a tree-table containing only one node: the root.
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
          Registers a new TreeModelListener with this model.
protected  void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
          Notify all listeners that have registered interest for notification on this event type.
abstract  Object getChild(Object parent, int index)
           
abstract  int getChildCount(Object parent)
           
abstract  Class getColumnClass(int column)
          Returns the type for column number column.
abstract  int getColumnCount()
          Returns the number ofs availible column.
abstract  String getColumnName(int column)
          Returns the name for column number column.
 int getIndexOfChild(Object parent, Object child)
          This method is not called by the current implementation of JTree.
 Object getRoot()
          Default implementation.
abstract  Object getValueAt(Object node, int column)
          Returns the value to be displayed for node node, at column number column.
abstract  boolean isCellEditable(Object node, int column)
          Indicates whether the the value for node node, at column number column is editable.
 boolean isLeaf(Object node)
          Is this node a leaf?
 void removeTreeModelListener(TreeModelListener l)
          Removes a TreeModelListener from the list of listeners registered with this model.
 void setValueAt(Object aValue, Object node, int column)
          Default implementation.
 void valueForPathChanged(TreePath path, Object newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected Object root
The root of the tree.


listenerList

protected EventListenerList listenerList
The list of listeners.

Constructor Detail

AbstractTreeTableModel

public AbstractTreeTableModel(Object root)
Constructor for a tree-table containing only one node: the root.

Method Detail

getRoot

public Object getRoot()
Default implementation. Gets the root of the tree.

Specified by:
getRoot in interface TreeModel

isLeaf

public boolean isLeaf(Object node)
Is this node a leaf?

Specified by:
isLeaf in interface TreeModel

valueForPathChanged

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

getIndexOfChild

public int getIndexOfChild(Object parent,
                           Object child)
This method is not called by the current implementation of JTree. Implemented only for completion.

Specified by:
getIndexOfChild in interface TreeModel

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)
Registers a new TreeModelListener with this model.

Specified by:
addTreeModelListener in interface TreeModel

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)
Removes a TreeModelListener from the list of listeners registered with this model.

Specified by:
removeTreeModelListener in interface TreeModel

fireTreeNodesChanged

protected void fireTreeNodesChanged(Object source,
                                    Object[] path,
                                    int[] childIndices,
                                    Object[] children)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

See Also:
EventListenerList

fireTreeNodesInserted

protected void fireTreeNodesInserted(Object source,
                                     Object[] path,
                                     int[] childIndices,
                                     Object[] children)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

See Also:
EventListenerList

fireTreeNodesRemoved

protected void fireTreeNodesRemoved(Object source,
                                    Object[] path,
                                    int[] childIndices,
                                    Object[] children)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

See Also:
EventListenerList

fireTreeStructureChanged

protected void fireTreeStructureChanged(Object source,
                                        Object[] path,
                                        int[] childIndices,
                                        Object[] children)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

See Also:
EventListenerList

setValueAt

public void setValueAt(Object aValue,
                       Object node,
                       int column)
Default implementation. Does nothing.

Specified by:
setValueAt in interface TreeTableModel

getColumnClass

public abstract Class getColumnClass(int column)
Description copied from interface: TreeTableModel
Returns the type for column number column.

Specified by:
getColumnClass in interface TreeTableModel

isCellEditable

public abstract boolean isCellEditable(Object node,
                                       int column)
Description copied from interface: TreeTableModel
Indicates whether the the value for node node, at column number column is editable.

Specified by:
isCellEditable in interface TreeTableModel

getChild

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

getChildCount

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

getColumnCount

public abstract int getColumnCount()
Description copied from interface: TreeTableModel
Returns the number ofs availible column.

Specified by:
getColumnCount in interface TreeTableModel

getColumnName

public abstract String getColumnName(int column)
Description copied from interface: TreeTableModel
Returns the name for column number column.

Specified by:
getColumnName in interface TreeTableModel

getValueAt

public abstract Object getValueAt(Object node,
                                  int column)
Description copied from interface: TreeTableModel
Returns the value to be displayed for node node, at column number column.

Specified by:
getValueAt in interface TreeTableModel