|
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.treetable.NodeTreeTableModelMap
public class NodeTreeTableModelMap
NodeTreeTableModelMap will show only a single branch of a TreeTableModel.
Whether the node's children will be visible, depends on
the showChildren property.
The tree node to show can be specified in the constructor, but can
be later specified by calling AbstractTreeTableModel.setRoot(java.lang.Object)
.
Field Summary | |
---|---|
protected boolean |
showChildren
determines whether to show the node's children |
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 | |
---|---|
NodeTreeTableModelMap(TreeTableModel treeTableModel,
Object root)
Constructs a NodeTreeTableModelMap. |
Method Summary | |
---|---|
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. |
Object |
getRoot()
Returns the root of the tree. Returns null
only if the tree has no nodes. |
boolean |
getShowChildren()
Determines whether to show the node's 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 |
setShowChildren(boolean showChildren)
Determines whether to show the node's children. |
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, getIndexOfChild, getPathToRoot, getPathToRoot, getTreeModel, nodeChanged, nodesChanged, nodeStructureChanged, treeNodesChanged, treeNodesInserted, treeNodesRemoved, 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, getIndexOfChild, removeTreeModelListener, valueForPathChanged |
Field Detail |
---|
protected boolean showChildren
Constructor Detail |
---|
public NodeTreeTableModelMap(TreeTableModel treeTableModel, Object root)
Method Detail |
---|
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 TreeModelMap
parent
- a node in the tree, obtained from this data source
parent
public Object getRoot()
null
only if the tree has no nodes.
getRoot
in interface TreeModel
getRoot
in class TreeModelMap
public boolean getShowChildren()
public 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 TreeModelMap
node
- a node in the tree, obtained from this data source
node
is a leafpublic void setShowChildren(boolean showChildren)
showChildren
- true if the children will be shown, false otherwisepublic 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
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |