|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The TreeTableDataModel
interface is used to mediate
between the underlying data store and the TreeTable. The interface
supports two major mechanisms for retrieving tree data: as enumerations
or by getting the first child/getting the next sibling of a node.
The model only needs to implement one. After initially setting the data
model for the TreeTable
, the model should notify listeners
of changes using the TreeTableModelListener
interface.
TreeTable
,
TreeTableModelListener
Method Summary | |
void |
addTreeTableModelListener(TreeTableModelListener aListener)
Adds a TreeTableModelListener . |
java.lang.Object |
getChild(java.lang.Object aNode)
Retrieves the first child of the given node. |
java.util.Enumeration |
getChildren(java.lang.Object aNode)
Retrieves the children of a given node. |
java.lang.Object |
getData(java.lang.Object aNode,
java.lang.Object aID)
Retrieves the data for the given node at the column with the given id. |
javax.swing.Icon |
getIcon(java.lang.Object aNode)
Retrieves an icon representing the given node. |
java.lang.Object |
getNextSibling(java.lang.Object aNode)
Retrieves the next sibling of the given node. |
javax.swing.Icon |
getOverlayIcon(java.lang.Object aNode)
Retrieves an icon representing a modified state for a given node. |
java.lang.Object |
getRoot()
Retrieves the root node of the tree. |
boolean |
isCollapsed(TreePath aPath)
Indicates whether the given node is collapsed. |
boolean |
isLeaf(java.lang.Object aNode)
Indicates whether the given node is a leaf. |
void |
removeTreeTableModelListener(TreeTableModelListener aListener)
Removes a TreeTableModelListener . |
void |
setCollapsed(TreePath aPath,
boolean aCollapsed)
Method to set the collapsed state of a node. |
void |
setData(java.lang.Object aNode,
java.lang.Object aID,
java.lang.Object aValue)
Method for setting the data for the given node at the column with the given id. |
boolean |
showRoot()
Indicates whether the root node is visible. |
Method Detail |
public boolean showRoot()
true
if the root node should be displayed.public java.util.Enumeration getChildren(java.lang.Object aNode)
aNode
is null
then the enumeration returned should represent
the nodes at the root level. An implementation that supports this
method does not need to implement the getRoot()
,
getChild()
or getNextSibling()
methods
(they can return null
).getRoot()
,
getChild(java.lang.Object)
,
getNextSibling(java.lang.Object)
public java.lang.Object getRoot()
getChild()
and
getNextSibling()
methods and does not need to implement
the getChildren()
method (it can return
null
).getChildren(java.lang.Object)
,
getChild(java.lang.Object)
,
getNextSibling(java.lang.Object)
public java.lang.Object getChild(java.lang.Object aNode)
null
if the node has no children. An implementation that
supports this method should implement the getRoot()
and
getNextSibling()
methods and does not need to implement
the getChildren()
method (it can return
null
).getChildren(java.lang.Object)
,
getRoot()
,
getNextSibling(java.lang.Object)
public java.lang.Object getNextSibling(java.lang.Object aNode)
null
if the node has no next sibling. An implementation
thatsupports this method should implement the getChild()
and getNextSibling()
methods and does not need to
implement the getChildren()
method (it can return
null
).getChildren(java.lang.Object)
,
getRoot()
,
getChild(java.lang.Object)
public boolean isLeaf(java.lang.Object aNode)
isLeaf()
and getChild()
or getChildren()
should be consistent.true
if the given node is a leaf.public boolean isCollapsed(TreePath aPath)
true
if the given node is collapsed.public void setCollapsed(TreePath aPath, boolean aCollapsed)
public java.lang.Object getData(java.lang.Object aNode, java.lang.Object aID)
CellRenderer
of the column
for rendering.Object
representing the data at the
given column for the given node.CellRenderer
,
Column
public void setData(java.lang.Object aNode, java.lang.Object aID, java.lang.Object aValue)
CellEditor
of the
column.CellEditor
,
Column
public javax.swing.Icon getIcon(java.lang.Object aNode)
null
if no icon is to be drawn.Icon
representing the given node.public javax.swing.Icon getOverlayIcon(java.lang.Object aNode)
null
if no overlay icon is to
be drawn. The overlay icon should be transparent and the same size
as the returned icon.Icon
representing the given node state.getIcon(java.lang.Object)
public void addTreeTableModelListener(TreeTableModelListener aListener)
TreeTableModelListener
.public void removeTreeTableModelListener(TreeTableModelListener aListener)
TreeTableModelListener
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |