|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sciapp.treetable.AbstractTreeTableModel
com.sciapp.treetable.MutableTreeTableModel
com.sciapp.treetable.ComparableTreeTableModel
com.sciapp.treetable.DefaultMutableTreeTableModel
com.sciapp.treetable.TreeTableModelMask
public class TreeTableModelMask
TreeTableModelMask masks a TreeTableModel so that different values for a node can be returned, depending on the values of the underlying model.
By default, TreeTableModelMask's behaviour and values are exactly the same as the underlying model.
Usually, developers should subclass it and override the getValueAt method,
in order to return a different value.
| Field Summary | |
|---|---|
protected TreeTableModel |
model
the underlying treetable model |
| Fields inherited from class com.sciapp.treetable.DefaultMutableTreeTableModel |
|---|
editable |
| Fields inherited from class com.sciapp.treetable.ComparableTreeTableModel |
|---|
addChildForGroup, comparators, defaultComparatorsByColumnClass |
| Fields inherited from class com.sciapp.treetable.MutableTreeTableModel |
|---|
classes, columns |
| Fields inherited from class com.sciapp.treetable.AbstractTreeTableModel |
|---|
listenerList, root |
| Fields inherited from interface com.sciapp.treetable.TreeTableModel |
|---|
CHANGE_COLUMN_SOURCE |
| Constructor Summary | |
|---|---|
TreeTableModelMask(TreeTableModel model)
Constructs a TreeTableModelMask. |
|
| Method Summary | |
|---|---|
Object |
createMaskedNode(Object node)
Creates and returns a new node masking node. |
int |
getChildCount(Object parent)
Returns the number of children of parent.
Returns 0 if the node
is a leaf or if it has no children. parent must be a node
previously obtained from this data source. |
Class |
getColumnClass(int column)
Returns the class of all the cells in the column. |
int |
getColumnCount()
Returns the number of columns. |
String |
getColumnName(int column)
Returns the name of the column at columnIndex as it will be displayed by the table |
Object |
getMaskedNode(Object node)
Returns the enclosed node of the underlying model, that node represents. |
TreeTableModel |
getTreeTableModel()
Returns the underlying treetable model. |
Object |
getValueAt(Object node,
int column)
Returns the value to be displayed for node,
at column index column. |
void |
insertNodeInto(MutableTreeNode newChild,
MutableTreeNode parent,
int index)
Inserts a node at a specific location index in its parents children. |
boolean |
isLeaf(Object node)
Returns true if node is a leaf.
It is possible for this method to return false
even if node has no children.
A directory in a filesystem, for example,
may contain no files; the node representing
the directory is not a leaf, but it also has no children. |
void |
rowsReordered(ReorderEvent e)
Called whenever the rows of a JTable have been restructured. |
void |
setMaskedNode(Object node,
Object mask)
Assigns a new masked node. |
void |
setTreeTableModel(TreeTableModel model)
Assigns a new underlying treetable model |
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. |
void |
treeNodesRemoved(TreeModelEvent e)
Invoked after nodes have been removed from the tree. |
void |
treeStructureChanged(TreeModelEvent e)
Invoked after the tree has drastically changed structure from a given node down. |
| Methods inherited from class com.sciapp.treetable.DefaultMutableTreeTableModel |
|---|
createLeafNode, createNonLeafNode, getEditable, isCellEditable, replicateLeafNode, setEditable, setValueAt |
| Methods inherited from class com.sciapp.treetable.MutableTreeTableModel |
|---|
addColumn, addColumn, addReorderListener, clear, fireRowsMapped, fireRowsReordered, getChild, getIndexOfChild, getPathToRoot, getPathToRoot, moveNode, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, removeNodeFromParent, removeReorderListener, setColumnClasses, setColumnNames, valueForPathChanged |
| Methods inherited from class com.sciapp.treetable.AbstractTreeTableModel |
|---|
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, fireTreeTableStructureChanged, 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 |
| Field Detail |
|---|
protected TreeTableModel model
| Constructor Detail |
|---|
public TreeTableModelMask(TreeTableModel model)
| Method Detail |
|---|
public Object createMaskedNode(Object node)
node - the node to mask
public int getChildCount(Object parent)
parent.
Returns 0 if the node
is a leaf or if it has no children. parent must be a node
previously obtained from this data source.
getChildCount in interface TreeModelgetChildCount in class MutableTreeTableModelparent - a node in the tree, obtained from this data source
parentpublic Class getColumnClass(int column)
getColumnClass in interface TreeTableModelgetColumnClass in class MutableTreeTableModelcolumn - the index of the column
public int getColumnCount()
getColumnCount in interface TreeTableModelgetColumnCount in class MutableTreeTableModelpublic String getColumnName(int column)
getColumnName in interface TreeTableModelgetColumnName in class MutableTreeTableModelcolumn - the index of the column
public Object getMaskedNode(Object node)
node - a node of TreeTableModelMask
public TreeTableModel getTreeTableModel()
public Object getValueAt(Object node,
int column)
node,
at column index column.
getValueAt in interface TreeTableModelgetValueAt in class DefaultMutableTreeTableModelnode - the node to querycolumn - the column index
public void insertNodeInto(MutableTreeNode newChild,
MutableTreeNode parent,
int index)
insertNodeInto in class MutableTreeTableModelnewChild - the node to insertparent - the parent node to remove node fromindex - the location in the parent node's childrenspublic boolean isLeaf(Object node)
true if node is a leaf.
It is possible for this method to return false
even if node has no children.
A directory in a filesystem, for example,
may contain no files; the node representing
the directory is not a leaf, but it also has no children.
isLeaf in interface TreeModelisLeaf in class MutableTreeTableModelnode - a node in the tree, obtained from this data source
node is a leafpublic void rowsReordered(ReorderEvent e)
rowsReordered in interface ReorderListenere - the ReorderEvent object
public void setMaskedNode(Object node,
Object mask)
node - the node to maskmask - the masked node to setpublic void setTreeTableModel(TreeTableModel model)
model - the new treetablemodel to assignpublic void treeNodesChanged(TreeModelEvent e)
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 TreeModelListenerpublic 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 TreeModelListenerpublic 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 TreeModelListenerpublic 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
|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||