|
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.MutableTreeTableModel
com.citra.treetable.ComparableTreeTableModel
com.citra.treetable.DefaultMutableTreeTableModel
com.citra.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.citra.treetable.DefaultMutableTreeTableModel |
---|
editable |
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 | |
---|---|
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. |
boolean |
isMasking(Object node)
Determines whether a node of the model is masking a node belonging to the underlying model. |
protected boolean |
nodeEquals(Object node1,
Object node2)
Checks for equality between two masking nodes. |
protected int |
nodeHashCode(Object node)
Returns the hashcode for the masking node. |
protected void |
nodePrepared(Object parent)
This method is called after a masked node encapsulating an underlying node has been prepared. |
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.citra.treetable.DefaultMutableTreeTableModel |
---|
createLeafNode, createNonLeafNode, getEditable, isCellEditable, replicateLeafNode, setEditable, setValueAt |
Methods inherited from class com.citra.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.citra.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
protected boolean nodeEquals(Object node1, Object node2)
node1
- the first masking nodenode2
- the second masking node
protected int nodeHashCode(Object node)
node
- the masking node
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 TreeModel
getChildCount
in class MutableTreeTableModel
parent
- a node in the tree, obtained from this data source
parent
public Class getColumnClass(int column)
getColumnClass
in interface TreeTableModel
getColumnClass
in class MutableTreeTableModel
column
- the index of the column
public int getColumnCount()
getColumnCount
in interface TreeTableModel
getColumnCount
in class MutableTreeTableModel
public String getColumnName(int column)
getColumnName
in interface TreeTableModel
getColumnName
in class MutableTreeTableModel
column
- 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 TreeTableModel
getValueAt
in class DefaultMutableTreeTableModel
node
- the node to querycolumn
- the column index
public void insertNodeInto(MutableTreeNode newChild, MutableTreeNode parent, int index)
insertNodeInto
in class MutableTreeTableModel
newChild
- 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 TreeModel
isLeaf
in class MutableTreeTableModel
node
- a node in the tree, obtained from this data source
node
is a leafprotected void nodePrepared(Object parent)
parent
- the masked node that was preparedpublic void rowsReordered(ReorderEvent e)
rowsReordered
in interface ReorderListener
e
- the ReorderEvent objectpublic 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 TreeModelListener
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
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
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
public boolean isMasking(Object node)
node
- the masking node
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |