FreeHEP API
Version current

org.freehep.swing.treetable
Class AbstractTreeTableModel

java.lang.Object
  extended byorg.freehep.swing.treetable.AbstractTreeTableModel
All Implemented Interfaces:
TreeModel, TreeTableModel

public abstract class AbstractTreeTableModel
extends Object
implements TreeTableModel

An abstract implementation of the TreeTableModel interface, handling the list of listeners.

Version:
$Id: AbstractTreeTableModel.java,v 1.1 2004/07/16 18:33:35 tonyj Exp $
Author:
Philip Milne
Source Code:
AbstractTreeTableModel.java

Field Summary
protected  EventListenerList listenerList
           
protected  Object root
           
 
Constructor Summary
AbstractTreeTableModel(Object root)
           
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
           
protected  void fireTreeNodesChanged(Object source, TreePath path, int[] childIndices, Object[] children)
           
protected  void fireTreeNodesInserted(Object source, TreePath path, int[] childIndices, Object[] children)
           
protected  void fireTreeNodesRemoved(Object source, TreePath path, int[] childIndices, Object[] children)
           
protected  void fireTreeStructureChanged(Object source, TreePath path, int[] childIndices, Object[] children)
           
 Class getColumnClass(int column)
          Returns the type for column number column.
 int getIndexOfChild(Object parent, Object child)
           
 Object getRoot()
           
abstract  Object getValueAt(Object node, int column)
           
 Object getValueAt(TreePath path, int column)
          Returns the value to be displayed for node node, at column number column.
 boolean isCellEditable(Object node, int column)
          By default, make the column with the Tree in it the only editable one.
 boolean isCellEditable(TreePath path, int column)
          Indicates whether the the value for node node, at column number column is editable.
 boolean isLeaf(Object node)
           
 void removeTreeModelListener(TreeModelListener l)
           
 void setValueAt(Object aValue, Object node, int column)
           
 void setValueAt(Object aValue, TreePath path, int column)
          Sets the value for node node, at column number column.
 void valueForPathChanged(TreePath path, 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.freehep.swing.treetable.TreeTableModel
getColumnCount, getColumnName
 
Methods inherited from interface javax.swing.tree.TreeModel
getChild, getChildCount
 

Field Detail

listenerList

protected EventListenerList listenerList

root

protected Object root
Constructor Detail

AbstractTreeTableModel

public AbstractTreeTableModel(Object root)
Method Detail

isCellEditable

public boolean isCellEditable(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.


isCellEditable

public boolean isCellEditable(TreePath path,
                              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

getColumnClass

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

Specified by:
getColumnClass in interface TreeTableModel

getIndexOfChild

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

isLeaf

public boolean isLeaf(Object node)
Specified by:
isLeaf in interface TreeModel

getRoot

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

setValueAt

public void setValueAt(Object aValue,
                       Object node,
                       int column)

setValueAt

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

Specified by:
setValueAt in interface TreeTableModel

getValueAt

public Object getValueAt(TreePath path,
                         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

getValueAt

public abstract Object getValueAt(Object node,
                                  int column)

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)
Specified by:
addTreeModelListener in interface TreeModel

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)
Specified by:
removeTreeModelListener in interface TreeModel

valueForPathChanged

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

fireTreeNodesChanged

protected void fireTreeNodesChanged(Object source,
                                    TreePath path,
                                    int[] childIndices,
                                    Object[] children)

fireTreeNodesInserted

protected void fireTreeNodesInserted(Object source,
                                     TreePath path,
                                     int[] childIndices,
                                     Object[] children)

fireTreeNodesRemoved

protected void fireTreeNodesRemoved(Object source,
                                    TreePath path,
                                    int[] childIndices,
                                    Object[] children)

fireTreeStructureChanged

protected void fireTreeStructureChanged(Object source,
                                        TreePath path,
                                        int[] childIndices,
                                        Object[] children)

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.