Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table.group
Class DefaultTreeTableColumnModel

java.lang.Object
  extended by com.citra.treetable.AbstractTreeTableModel
      extended by com.citra.treetable.MutableTreeTableModel
          extended by com.citra.treetable.ComparableTreeTableModel
              extended by com.citra.treetable.ObjectTreeTableModel
                  extended by com.citra.table.group.DefaultTreeTableColumnModel
All Implemented Interfaces:
TreeTableColumnModel, ReorderModel, TreeTableModel, Serializable, TreeModel
Direct Known Subclasses:
TreeColumnModelMask

public class DefaultTreeTableColumnModel
extends ObjectTreeTableModel
implements TreeTableColumnModel

DefaultTreeTableColumnModel is the default implementation of a TreeTableColumnModel. DefaultTreeTableColumnModel extends ObjectTreeTableModel and thus utilizes all of its methods and properties. In addition, the inherited methods are actually calls to MutableTreeTableModel's methods. Each node is a DefaultMutableTreeNode having TableColumn as its user object.

Since:
3.4
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.citra.treetable.ComparableTreeTableModel
addChildForGroup, comparators, defaultComparatorsByColumnClass
 
Fields inherited from class com.citra.treetable.MutableTreeTableModel
classes, columns
 
Fields inherited from class com.citra.treetable.AbstractTreeTableModel
listenerList, root
 
Fields inherited from interface com.citra.treetable.TreeTableModel
CHANGE_COLUMN_SOURCE
 
Constructor Summary
DefaultTreeTableColumnModel()
          Constructs a DefaultTreeTableColumnModel.
DefaultTreeTableColumnModel(DefaultMutableTreeNode root)
          Constructs a DefaultTreeTableColumnModel.
 
Method Summary
 void addColumnInvalidatorListener(ColumnInvalidatorListener x)
          Adds a listener that is notified when the columns of the model were changed (via additions or removals).
 void fireColumnsInvalidated()
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeTableStructureChanged(boolean adapterStructureChange)
          Generates an event that notifies listeners that the whole treetable structure has changed: both row and column data.
 TableColumn getColumn(Object node)
          Returns the table column at the specified node.
 Class getColumnClass(int column)
          Returns the class of all the cells in the column.
 Object getObjectAt(Object userObject, int column)
          This method returns the userObject passed as argument.
 Object getValueAt(Object node, int column)
          Returns the value to be displayed for node, at column index column.
 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.
 void removeColumnInvalidatorListener(ColumnInvalidatorListener x)
          Removes a listener that is notified when the columns of the model were changed (via additions or removals).
 
Methods inherited from class com.citra.treetable.ObjectTreeTableModel
createLeafNode, createNonLeafNode, replicateLeafNode, setObjectAt, setValueAt
 
Methods inherited from class com.citra.treetable.ComparableTreeTableModel
add, add, addNode, addRowComparator, clearComparators, comparatorsChanged, createDefaultComparators, findTreeNode, getAddChildForGroup, getDefaultComparator, getRowComparator, getRowComparators, getRowComparatorSize, insertRowComparator, loadComparators, refreshComparators, removeRowComparator, removeRowComparator, saveComparators, setAddChildForGroup, setDefaultComparator, setRowComparator
 
Methods inherited from class com.citra.treetable.MutableTreeTableModel
addColumn, addColumn, addReorderListener, clear, fireRowsMapped, fireRowsReordered, getChild, getChildCount, getColumnCount, getColumnName, getIndexOfChild, getPathToRoot, getPathToRoot, insertNodeInto, isCellEditable, isLeaf, moveNode, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, removeNodeFromParent, removeReorderListener, setColumnClasses, setColumnNames, valueForPathChanged
 
Methods inherited from class com.citra.treetable.AbstractTreeTableModel
addTreeModelListener, fireTreeNodesChanged, fireTreeTableStructureChanged, getRoot, isAggregate, isFooter, isHeader, 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

DefaultTreeTableColumnModel

public DefaultTreeTableColumnModel()
Constructs a DefaultTreeTableColumnModel.


DefaultTreeTableColumnModel

public DefaultTreeTableColumnModel(DefaultMutableTreeNode root)
Constructs a DefaultTreeTableColumnModel.

Method Detail

getColumn

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

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

getObjectAt

public Object getObjectAt(Object userObject,
                          int column)
This method returns the userObject passed as argument.

Returns the value for object at column

Specified by:
getObjectAt in class ObjectTreeTableModel
Parameters:
userObject - the object whose value is to be queried
column - the column whose value is to be queried
Returns:
the value of the Object at the specified index

getValueAt

public Object getValueAt(Object node,
                         int column)
Returns the value to be displayed for node, at column index column.

Specified by:
getValueAt in interface TreeTableModel
Overrides:
getValueAt in class ObjectTreeTableModel
Parameters:
node - the node to query
column - the column index
Returns:
the value

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

getColumnClass

public Class getColumnClass(int column)
Returns the class of all the cells in the column.

Specified by:
getColumnClass in interface TreeTableModel
Overrides:
getColumnClass in class MutableTreeTableModel
Parameters:
column - the index of the column
Returns:
the class of all the cells in the column.

fireTreeTableStructureChanged

public void fireTreeTableStructureChanged(boolean adapterStructureChange)
Generates an event that notifies listeners that the whole treetable structure has changed: both row and column data. The adapterStructureChange argument is significant only if the model is contained within a TreeTableModelAdapter. In this case, using adapterStructureChange with a true value will make TreeTableModelAdapter fire a table structure event.

Overrides:
fireTreeTableStructureChanged in class AbstractTreeTableModel
Parameters:
adapterStructureChange - true if this event will triger a structure change TableModelEvent, false otherwise

addColumnInvalidatorListener

public void addColumnInvalidatorListener(ColumnInvalidatorListener x)
Adds a listener that is notified when the columns of the model were changed (via additions or removals).

Specified by:
addColumnInvalidatorListener in interface TreeTableColumnModel
Parameters:
x - the listener to be added

fireColumnsInvalidated

public void fireColumnsInvalidated()
Notifies all listeners that have registered interest for notification on this event type.


fireTreeNodesInserted

public void fireTreeNodesInserted(Object source,
                                  Object[] path,
                                  int[] childIndices,
                                  Object[] children)
Notifies all listeners that have registered interest for notification on this event type.

Overrides:
fireTreeNodesInserted in class AbstractTreeTableModel

fireTreeNodesRemoved

public void fireTreeNodesRemoved(Object source,
                                 Object[] path,
                                 int[] childIndices,
                                 Object[] children)
Notifies all listeners that have registered interest for notification on this event type.

Overrides:
fireTreeNodesRemoved in class AbstractTreeTableModel

fireTreeStructureChanged

public void fireTreeStructureChanged(Object source,
                                     Object[] path,
                                     int[] childIndices,
                                     Object[] children)
Notifies all listeners that have registered interest for notification on this event type.

Overrides:
fireTreeStructureChanged in class AbstractTreeTableModel

removeColumnInvalidatorListener

public void removeColumnInvalidatorListener(ColumnInvalidatorListener x)
Removes a listener that is notified when the columns of the model were changed (via additions or removals).

Specified by:
removeColumnInvalidatorListener in interface TreeTableColumnModel
Parameters:
x - the listener to be removed

Copyright © 2011 Citra Technologies. All Rights Reserved.