Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.table.group
Class TreeTableColumnModelMap

java.lang.Object
  extended by com.sciapp.treetable.AbstractTreeTableModel
      extended by com.sciapp.treetable.TreeModelMap
          extended by com.sciapp.treetable.TreeTableModelMap
              extended by com.sciapp.table.group.TreeTableColumnModelMap
All Implemented Interfaces:
ReorderListener, CacheableTreeTableModel, TreeTableColumnModel, ReorderModel, TreeTableModel, Serializable, EventListener, TreeModelListener, TreeModel

public class TreeTableColumnModelMap
extends TreeTableModelMap
implements TreeTableColumnModel

TreeTableColumnModelMap is used for transparently transforming an underlying TreeTableColumnModel. You can use this class in combination with a DefaultFilterTreeTableModel and DefaultSortTreeTableModel.
For example:

DefaultFilterTreeTableModel ftm = new DefaultFilterTreeTableModel(treeColumnModel);
DefaultSortTreeTableModel stm = new DefaultSortTreeTableModel(ftm);
TreeTableColumnModelMap model = new TreeTableColumnModelMap(stm);
TreeTableHeader treeHeader = new TreeTableHeader(model);

In the example above, we have created a filterable and sortable treetable header.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sciapp.treetable.TreeTableModelMap
treeTableModel
 
Fields inherited from class com.sciapp.treetable.TreeModelMap
treeModel
 
Fields inherited from class com.sciapp.treetable.AbstractTreeTableModel
listenerList, root
 
Fields inherited from interface com.sciapp.treetable.TreeTableModel
CHANGE_COLUMN_SOURCE
 
Constructor Summary
TreeTableColumnModelMap(TreeTableModel treeTableModel)
          Constructs a ColumnModelMapper.
 
Method Summary
protected  MutableTreeNode createMutableColumnNode(TableColumn aColumn)
          Creates and returns a tree-node containing the table column passed as argument.
 TableColumn getColumn(Object node)
          Returns the table column at the specified node.
protected  TableColumn getColumnFromModel(MutableTreeTableModel model, Object node)
          Returns the column from the mutable treetable model's node passed as argument.
 Object insertColumnInto(TableColumn aColumn, Object columnNode, Object parentNode, int index)
          Inserts a table column at the specified node's index.
 void removeColumnFrom(Object node)
          Removes a node from the model.
 
Methods inherited from class com.sciapp.treetable.TreeTableModelMap
addReorderListener, fireRowsMapped, fireRowsReordered, getColumnClass, getColumnCount, getColumnName, getInnerTreeTableModel, getMappedIndexes, getTreeTableModel, getUncachedChildren, getUncachedGroupCount, getUncachedGroups, getValueAt, isAggregate, isCellEditable, isCountCached, isFooter, isHeader, isRangedModel, isValueCached, removeReorderListener, rowsReordered, setTreeModel, setTreeTableModel, setValueAt
 
Methods inherited from class com.sciapp.treetable.TreeModelMap
getChild, getChildCount, getIndexOfChild, getPathToRoot, getPathToRoot, getRoot, getTreeModel, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, treeNodesChanged, treeNodesInserted, treeNodesRemoved, treeStructureChanged, valueForPathChanged
 
Methods inherited from class com.sciapp.treetable.AbstractTreeTableModel
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, fireTreeTableStructureChanged, fireTreeTableStructureChanged, removeTreeModelListener, setRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged
 

Constructor Detail

TreeTableColumnModelMap

public TreeTableColumnModelMap(TreeTableModel treeTableModel)
Constructs a ColumnModelMapper.

Method Detail

createMutableColumnNode

protected MutableTreeNode createMutableColumnNode(TableColumn aColumn)
Creates and returns a tree-node containing the table column passed as argument.

Parameters:
aColumn - the column for which a tree-node is being added
Returns:
a tree-node containing the supplied column

getColumn

public TableColumn getColumn(Object node)
Returns the table column at the specified node.

Specified by:
getColumn in interface TreeTableColumnModel
Returns:
the table column

getColumnFromModel

protected TableColumn getColumnFromModel(MutableTreeTableModel model,
                                         Object node)
Returns the column from the mutable treetable model's node passed as argument.

Parameters:
model - the mutable treetable model
node - the model's node
Returns:
the table column at node

insertColumnInto

public Object insertColumnInto(TableColumn aColumn,
                               Object columnNode,
                               Object parentNode,
                               int index)
Inserts a table column at the specified node's index.

Specified by:
insertColumnInto in interface TreeTableColumnModel
Parameters:
aColumn - the table column to insert
columnNode - the node that 'contains' the column. If this is null, a new node should be created.
parentNode - the node under which the column is to be inserted
index - the parent node's index to insert the column into
Returns:
the newly created node or columnNode if this wasn't null

removeColumnFrom

public void removeColumnFrom(Object node)
Removes a node from the model. The node presumably 'contains' a table column.

Specified by:
removeColumnFrom in interface TreeTableColumnModel
Parameters:
node - the node at which the column is found

Copyright © 2005 Scientific Applications. All Rights Reserved.