org.xnap.gui.table
Class AbstractTreeTableModel

java.lang.Object
  extended by org.xnap.gui.table.AbstractTreeTableModel
All Implemented Interfaces:
javax.swing.tree.TreeModel, TreeTableModel
Direct Known Subclasses:
AbstractColumnTreeTableModel

public abstract class AbstractTreeTableModel
extends java.lang.Object
implements TreeTableModel

Version:
1.2 10/27/98 An abstract implementation of the TreeTableModel interface, handling the list of listeners.
Author:
Philip Milne

Field Summary
protected  javax.swing.event.EventListenerList listenerList
           
protected  java.lang.Object root
           
 
Constructor Summary
AbstractTreeTableModel()
           
AbstractTreeTableModel(java.lang.Object root)
           
 
Method Summary
 void addTreeModelListener(javax.swing.event.TreeModelListener l)
          Adds a listener to the model.
protected  void fireTreeNodesChanged(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireTreeNodesInserted(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireTreeNodesRemoved(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireTreeStructureChanged(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
          Notify all listeners that have registered interest for notification on this event type.
 java.lang.Class getColumnClass(int column)
          Returns the type for column number column.
 int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
           
 java.lang.Object getRoot()
           
 boolean isCellEditable(java.lang.Object node, int column)
          By default, make the column with the Tree in it the only editable one.
 boolean isLeaf(java.lang.Object node)
           
 void removeTreeModelListener(javax.swing.event.TreeModelListener l)
          Removes a listener from the model.
 void setValueAt(java.lang.Object aValue, java.lang.Object node, int column)
          Sets the value for node node, at column number column.
 void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xnap.gui.table.TreeTableModel
getColumnCount, getColumnName, getValueAt
 
Methods inherited from interface javax.swing.tree.TreeModel
getChild, getChildCount
 

Field Detail

root

protected java.lang.Object root

listenerList

protected javax.swing.event.EventListenerList listenerList
Constructor Detail

AbstractTreeTableModel

public AbstractTreeTableModel(java.lang.Object root)

AbstractTreeTableModel

public AbstractTreeTableModel()
Method Detail

getRoot

public java.lang.Object getRoot()
Specified by:
getRoot in interface javax.swing.tree.TreeModel

isLeaf

public boolean isLeaf(java.lang.Object node)
Specified by:
isLeaf in interface javax.swing.tree.TreeModel

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath path,
                                java.lang.Object newValue)
Specified by:
valueForPathChanged in interface javax.swing.tree.TreeModel

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
                           java.lang.Object child)
Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel

addTreeModelListener

public void addTreeModelListener(javax.swing.event.TreeModelListener l)
Adds a listener to the model.

Specified by:
addTreeModelListener in interface javax.swing.tree.TreeModel

removeTreeModelListener

public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
Removes a listener from the model.

Specified by:
removeTreeModelListener in interface javax.swing.tree.TreeModel

fireTreeNodesChanged

protected void fireTreeNodesChanged(java.lang.Object source,
                                    java.lang.Object[] path,
                                    int[] childIndices,
                                    java.lang.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(java.lang.Object source,
                                     java.lang.Object[] path,
                                     int[] childIndices,
                                     java.lang.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(java.lang.Object source,
                                    java.lang.Object[] path,
                                    int[] childIndices,
                                    java.lang.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(java.lang.Object source,
                                        java.lang.Object[] path,
                                        int[] childIndices,
                                        java.lang.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

getColumnClass

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

Specified by:
getColumnClass in interface TreeTableModel

isCellEditable

public boolean isCellEditable(java.lang.Object node,
                              int column)
By default, make the column with the Tree in it the only editable one. Making this column editable causes the JTable to forward mouse and keyboard events in the Tree column to the underlying JTree.

Specified by:
isCellEditable in interface TreeTableModel

setValueAt

public void setValueAt(java.lang.Object aValue,
                       java.lang.Object node,
                       int column)
Description copied from interface: TreeTableModel
Sets the value for node node, at column number column.

Specified by:
setValueAt in interface TreeTableModel


Copyright © 2001-2005 XNap Team. All Rights Reserved.