|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.citra.treetable.AbstractTreeTableModel
com.citra.treetable.TreeModelMap
com.citra.treetable.TreeTableModelMap
com.citra.table.group.TreeTableColumnModelMap
public class TreeTableColumnModelMap
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.
Field Summary |
---|
Fields inherited from class com.citra.treetable.TreeTableModelMap |
---|
treeTableModel |
Fields inherited from class com.citra.treetable.TreeModelMap |
---|
treeModel |
Fields inherited from class com.citra.treetable.AbstractTreeTableModel |
---|
listenerList, root |
Fields inherited from interface com.citra.treetable.TreeTableModel |
---|
CHANGE_COLUMN_SOURCE |
Constructor Summary | |
---|---|
TreeTableColumnModelMap(TreeTableModel treeTableModel)
Constructs a ColumnModelMapper. |
Method Summary | |
---|---|
void |
addColumnInvalidatorListener(ColumnInvalidatorListener x)
Adds a listener that is notified when the columns of the model were changed (via additions or removals). |
protected MutableTreeNode |
createMutableColumnNode(TableColumn aColumn)
Creates and returns a tree-node containing the table column passed as argument. |
void |
fireColumnsInvalidated()
Notifies all listeners that have registered interest for notification on this event type. |
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. |
void |
removeColumnInvalidatorListener(ColumnInvalidatorListener x)
Removes a listener that is notified when the columns of the model were changed (via additions or removals). |
void |
treeNodesChanged(TreeModelEvent e)
Invoked after a node (or a set of siblings) has changed in some way. |
void |
treeNodesInserted(TreeModelEvent e)
Invoked after nodes have been inserted into the tree. Use |
void |
treeNodesRemoved(TreeModelEvent e)
Invoked after nodes have been removed from the tree. Note that if a subtree is removed from the tree, this method may only be invoked once for the root of the removed subtree, not once for each individual set of siblings removed. Use |
void |
treeStructureChanged(TreeModelEvent e)
Invoked after the tree has drastically changed structure from a given node down. If the path returned by e.getPath() is of length one and the first element does not identify the current root node the first element should become the new root of the tree.
Use |
Methods inherited from class com.citra.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.citra.treetable.TreeModelMap |
---|
getChild, getChildCount, getIndexOfChild, getPathToRoot, getPathToRoot, getRoot, getTreeModel, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, valueForPathChanged |
Methods inherited from class com.citra.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 |
---|
public TreeTableColumnModelMap(TreeTableModel treeTableModel)
Method Detail |
---|
public void addColumnInvalidatorListener(ColumnInvalidatorListener x)
addColumnInvalidatorListener
in interface TreeTableColumnModel
x
- the listener to be addedprotected MutableTreeNode createMutableColumnNode(TableColumn aColumn)
aColumn
- the column for which a tree-node is being added
public void fireColumnsInvalidated()
public void treeNodesChanged(TreeModelEvent e)
TreeModelMap
Invoked after a node (or a set of siblings) has changed in some way. The node(s) have not changed locations in the tree or altered their children arrays, but other attributes have changed and may affect presentation. Example: the name of a file has changed, but it is in the same location in the file system.
To indicate the root has changed, childIndices and children will be null.
Use e.getPath()
to get the parent of the changed node(s).
e.getChildIndices()
returns the index(es) of the changed node(s).
treeNodesChanged
in interface TreeModelListener
treeNodesChanged
in class TreeModelMap
public void treeNodesInserted(TreeModelEvent e)
Invoked after nodes have been inserted into the tree.
Use e.getPath()
to get the parent of the new node(s).
e.getChildIndices()
returns the index(es) of the new node(s)
in ascending order.
treeNodesInserted
in interface TreeModelListener
treeNodesInserted
in class TreeModelMap
public void treeNodesRemoved(TreeModelEvent e)
Invoked after nodes have been removed from the tree. Note that if a subtree is removed from the tree, this method may only be invoked once for the root of the removed subtree, not once for each individual set of siblings removed.
Use e.getPath()
to get the former parent of the deleted node(s).
e.getChildIndices()
returns, in ascending order, the index(es)
the node(s) had before being deleted.
treeNodesRemoved
in interface TreeModelListener
treeNodesRemoved
in class TreeModelMap
public void treeStructureChanged(TreeModelEvent e)
Invoked after the tree has drastically changed structure from a given node down. If the path returned by e.getPath() is of length one and the first element does not identify the current root node the first element should become the new root of the tree.
Use e.getPath()
to get the path to the node.
e.getChildIndices()
returns null.
treeStructureChanged
in interface TreeModelListener
treeStructureChanged
in class TreeModelMap
public TableColumn getColumn(Object node)
getColumn
in interface TreeTableColumnModel
protected TableColumn getColumnFromModel(MutableTreeTableModel model, Object node)
model
- the mutable treetable modelnode
- the model's node
node
public Object insertColumnInto(TableColumn aColumn, Object columnNode, Object parentNode, int index)
insertColumnInto
in interface TreeTableColumnModel
aColumn
- the table column to insertcolumnNode
- 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 insertedindex
- the parent node's index to insert the column into
columnNode
if this wasn't nullpublic void removeColumnFrom(Object node)
removeColumnFrom
in interface TreeTableColumnModel
node
- the node at which the column is foundpublic void removeColumnInvalidatorListener(ColumnInvalidatorListener x)
removeColumnInvalidatorListener
in interface TreeTableColumnModel
x
- the listener to be removed
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |