|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectechopointng.treetable.AbstractTreeTableModel
public abstract class AbstractTreeTableModel
AbstractTreeTableModel provides an implementation of
TreeTableModelas a convenient starting point
in defining custom data models for TreeTable.
| Field Summary | |
|---|---|
static java.lang.Class |
hierarchicalColumnClass
Value returned by getColumnClassfor the
hierarchicalcolumn. |
protected EventListenerList |
listenerList
Event listener list |
protected java.lang.Object |
root
Root node of the model |
| Constructor Summary | |
|---|---|
AbstractTreeTableModel()
Constructs an AbstractTreeTableModel with a null root node |
|
AbstractTreeTableModel(java.lang.Object root)
Constructs an AbstractTreeTableModel with the specified
node as the root node. |
|
| Method Summary | |
|---|---|
void |
addTreeModelListener(TreeModelListener l)
Adds a listener for the TreeModelEvent posted after the tree changes. |
protected void |
fireTreeNodesChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireTreeNodesInserted(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireTreeNodesRemoved(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireTreeStructureChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Notify all listeners that have registered interest for notification on this event type. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Returns the child of parent at index index in the parent's child array. |
int |
getChildCount(java.lang.Object parent)
Returns the number of children in the specified parent node. |
java.lang.Class |
getColumnClass(int column)
|
int |
getColumnCount()
This is one of the methods you must override as it simply returns 1. |
java.lang.String |
getColumnName(int column)
|
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Returns the index of child in parent. |
java.lang.Object |
getParent(java.lang.Object child)
Returns the parent of child . |
java.lang.Object[] |
getPathToRoot(java.lang.Object node)
Builds the parents of node up to and including the root node, where the original node is the last element in the returned array. |
protected TreeNode[] |
getPathToRoot(TreeNode aNode,
int depth)
Builds the parents of node up to and including the root node, where the original node is the last element in the returned array. |
java.lang.Object |
getRoot()
Returns the root of the tree. |
TreeModelListener[] |
getTreeModelListeners()
|
boolean |
isLeaf(java.lang.Object node)
Returns true if the specified node is a leaf node; false otherwise. |
void |
removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with addTreeModelListener(). |
void |
valueForPathChanged(TreePath path,
java.lang.Object newValue)
Called when value for the item identified by path has been changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface echopointng.treetable.TreeTableModel |
|---|
getValueAt |
| Field Detail |
|---|
public static final java.lang.Class hierarchicalColumnClass
getColumnClassfor the
hierarchicalcolumn.
protected java.lang.Object root
protected EventListenerList listenerList
| Constructor Detail |
|---|
public AbstractTreeTableModel()
AbstractTreeTableModel with a null root node
public AbstractTreeTableModel(java.lang.Object root)
AbstractTreeTableModel with the specified
node as the root node.
root - root node| Method Detail |
|---|
public java.lang.Class getColumnClass(int column)
getColumnClass in interface TreeTableModelTableModel.getColumnClass(int)public java.lang.String getColumnName(int column)
getColumnName in interface TreeTableModelTableModel.getColumnName(int)public java.lang.Object getRoot()
getRoot in interface TreeModel
public java.lang.Object getChild(java.lang.Object parent,
int index)
getChild in interface TreeModelparent - a node in the tree, obtained from this data source
TreeNode.public java.lang.Object getParent(java.lang.Object child)
child - a node in the tree
public int getChildCount(java.lang.Object parent)
getChildCount in interface TreeModelparent - node whose child count is being requested
public int getColumnCount()
getColumnCount in interface TreeTableModelTreeTableModel.getColumnCount()
public int getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
null, returns -1.
getIndexOfChild in interface TreeModelparent - a note in the tree, obtained from this data sourcechild - the node we are interested in
nullpublic boolean isLeaf(java.lang.Object node)
isLeaf in interface TreeModelnode - node to test
protected TreeNode[] getPathToRoot(TreeNode aNode,
int depth)
aNode - the TreeNode to get the path fordepth - an int giving the number of steps already taken towards
the root (on recursive calls), used to size the returned array
public java.lang.Object[] getPathToRoot(java.lang.Object node)
node - the TreeNode to get the path for
public void valueForPathChanged(TreePath path,
java.lang.Object newValue)
treeNodesChanged event.
valueForPathChanged in interface TreeModelpath - path to the node that has changednewValue - the new valuepublic void addTreeModelListener(TreeModelListener l)
TreeModel
addTreeModelListener in interface TreeModell - the listener to addpublic void removeTreeModelListener(TreeModelListener l)
TreeModel
removeTreeModelListener in interface TreeModelpublic TreeModelListener[] getTreeModelListeners()
protected void fireTreeNodesChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
EventListenerList
protected void fireTreeNodesInserted(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
EventListenerList
protected void fireTreeNodesRemoved(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
EventListenerList
protected void fireTreeStructureChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
EventListenerList
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||