JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.swing.treetable
Class AbstractTreeTableModel<R,T>

java.lang.Object
  extended by net.sf.japi.swing.treetable.AbstractTreeTableModel<R,T>
All Implemented Interfaces:
TreeTableModel<R,T>
Direct Known Subclasses:
KeyStrokeTreeTableModel

public abstract class AbstractTreeTableModel<R,T>
extends Object
implements TreeTableModel<R,T>

Abstract base implementation of TreeTableModel.

Author:
Christian Hujer

Constructor Summary
protected AbstractTreeTableModel(R root)
          Create an AbstractTreeTableModel.
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
          
protected  void fireTreeNodesChanged(Object source, T[] path, int[] childIndices, T[] children)
          Informs all registered listeners of a change.
protected  void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
          Informs all registered listeners of an insertion.
protected  void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
          Informs all registered listeners of a removal.
protected  void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
          Informs all registered listeners of a structural change.
 Class<?> getColumnClass(int column)
          Returns the type for column number column.
 int getIndexOfChild(T parent, T child)
          
 R getRoot()
          Returns the root of the treetable.
 boolean isCellEditable(T node, int column)
          Indicates whether the the value for node node at column number column is editable.
 boolean isLeaf(T node)
          Returns if node is a leaf.
 void removeTreeModelListener(TreeModelListener l)
          
 void setValueAt(Object value, T node, int column)
          Sets the value for node node at column number column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.japi.swing.treetable.TreeTableModel
getChild, getChildCount, getColumnCount, getColumnName, getValueAt
 

Constructor Detail

AbstractTreeTableModel

protected AbstractTreeTableModel(R root)
Create an AbstractTreeTableModel.

Parameters:
root - tree root node content object
Method Detail

getRoot

public R getRoot()
Returns the root of the treetable.

Specified by:
getRoot in interface TreeTableModel<R,T>
Returns:
root of the treetable

isLeaf

public boolean isLeaf(T node)
Returns if node is a leaf.

Specified by:
isLeaf in interface TreeTableModel<R,T>
Parameters:
node - Node
Returns:
true if node is a leaf, otherwise false

getIndexOfChild

public int getIndexOfChild(T parent,
                           T child)


addTreeModelListener

public void addTreeModelListener(TreeModelListener l)


removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)


getColumnClass

public Class<?> getColumnClass(int column)
Returns the type for column number column.

Specified by:
getColumnClass in interface TreeTableModel<R,T>
Parameters:
column - Column to get type for
Returns:
type of column
See Also:
TableModel.getColumnClass(int)

isCellEditable

public boolean isCellEditable(T node,
                              int column)
Indicates whether the the value for node node at column number column is editable.

Specified by:
isCellEditable in interface TreeTableModel<R,T>
Parameters:
node - Node to check
column - Column to check
Returns:
true if the cell is editable, otherwise false
See Also:
TableModel.isCellEditable(int, int)

setValueAt

public void setValueAt(Object value,
                       T node,
                       int column)
Sets the value for node node at column number column.

Specified by:
setValueAt in interface TreeTableModel<R,T>
Parameters:
value - Value to be set
node - Node to set value at
column - Column of value in the node
See Also:
TableModel.setValueAt(Object, int, int)

fireTreeNodesChanged

protected void fireTreeNodesChanged(Object source,
                                    T[] path,
                                    int[] childIndices,
                                    T[] children)
Informs all registered listeners of a change.

Parameters:
source -
path -
childIndices -
children -

fireTreeNodesInserted

protected void fireTreeNodesInserted(Object source,
                                     Object[] path,
                                     int[] childIndices,
                                     Object[] children)
Informs all registered listeners of an insertion.

Parameters:
source -
path -
childIndices -
children -

fireTreeNodesRemoved

protected void fireTreeNodesRemoved(Object source,
                                    Object[] path,
                                    int[] childIndices,
                                    Object[] children)
Informs all registered listeners of a removal.

Parameters:
source -
path -
childIndices -
children -

fireTreeStructureChanged

protected void fireTreeStructureChanged(Object source,
                                        Object[] path,
                                        int[] childIndices,
                                        Object[] children)
Informs all registered listeners of a structural change.

Parameters:
source -
path -
childIndices -
children -

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright