|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kiwi.ui.model.TreeModelTreeAdapter
An adapter that allows a Swing JTree
to be used with the
StaticTreeModel
and DynamicTreeModel
data models.
The adapter translates messages and events between the JTree
and the ITreeModel
implementation.
JTree
,
ITreeModel
Constructor Summary | |
TreeModelTreeAdapter(JTree jtree)
Construct a new tree model tree adapter. |
Method Summary | |
void |
addTreeModelListener(TreeModelListener listener)
Add a tree model listener. |
void |
dispose()
Dispose of the adapter. |
protected void |
fireTreeNodesChanged(Object node,
int index,
Object parent)
Fire a tree nodes changed event. |
protected void |
fireTreeNodesInserted(Object node,
int index,
Object parent)
Fire a tree nodes inserted event. |
protected void |
fireTreeNodesRemoved(Object node,
int index,
Object parent)
Fire a tree nodes removed event. |
protected void |
fireTreeStructureChanged(ITreeNode node)
Fire a tree structure changed event. |
Object |
getChild(Object parent,
int index)
Get the child of a node. |
int |
getChildCount(Object parent)
Get the child count of a node. |
int |
getIndexOfChild(Object parent,
Object child)
Get the index of a child within its parent. |
TreePath |
getPathForNode(ITreeNode node)
Compute a TreePath for a given node. |
Object |
getRoot()
Get the root of the tree. |
ITreeModel |
getTreeModel()
Get the tree model in use by this adapter. |
boolean |
isLeaf(Object node)
Determine if a node is a leaf. |
void |
nodeAdded(TreeModelEvent evt)
Handle a node added event. |
void |
nodeChanged(TreeModelEvent evt)
Handle a node changed event. |
void |
nodeCollapsed(TreeModelEvent evt)
Handle folder closed events. |
void |
nodeCollapsing(TreeModelEvent evt)
Handle folder will close events. |
void |
nodeExpanded(TreeModelEvent evt)
Handle folder opened events. |
void |
nodeExpanding(TreeModelEvent evt)
Handle folder will open events. |
void |
nodeRemoved(TreeModelEvent evt)
Handle a node removed event. |
void |
nodeStructureChanged(TreeModelEvent evt)
Handle a node structure changed event. |
void |
removeTreeModelListener(TreeModelListener listener)
Remove a tree model listener. |
void |
setTreeModel(ITreeModel model)
Set the tree model to be used by this adapter. |
void |
valueForPathChanged(TreePath path,
Object newValue)
Handle JTree events. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TreeModelTreeAdapter(JTree jtree)
jtree
- The JFC tree component to be associated with this adapter.Method Detail |
public void setTreeModel(ITreeModel model)
model
- The model to set.getTreeModel()
public ITreeModel getTreeModel()
setTreeModel(kiwi.ui.model.ITreeModel)
public void addTreeModelListener(TreeModelListener listener)
TreeModelListener
to this
adapter's list of tree model listeners.listener
- The listener to add.removeTreeModelListener(javax.swing.event.TreeModelListener)
public void removeTreeModelListener(TreeModelListener listener)
TreeModelListener
from this adapter's list of tree model listeners.listener
- The listener to remove.addTreeModelListener(javax.swing.event.TreeModelListener)
public void nodeExpanding(TreeModelEvent evt)
ITreeModel
.public void nodeExpanded(TreeModelEvent evt)
ITreeModel
.public void nodeCollapsing(TreeModelEvent evt)
ITreeModel
.public void nodeCollapsed(TreeModelEvent evt)
ITreeModel
.public void nodeAdded(TreeModelEvent evt)
ITreeModel
.public void nodeRemoved(TreeModelEvent evt)
ITreeModel
.public void nodeChanged(TreeModelEvent evt)
ITreeModel
.public void nodeStructureChanged(TreeModelEvent evt)
ITreeModel
.public Object getChild(Object parent, int index)
TreeModel
.)public int getChildCount(Object parent)
TreeModel
.)public boolean isLeaf(Object node)
TreeModel
.)public void valueForPathChanged(TreePath path, Object newValue)
JTree
events. (Implementation of
TreeModel
.)public int getIndexOfChild(Object parent, Object child)
TreeModel
.)public Object getRoot()
TreeModel
.)public TreePath getPathForNode(ITreeNode node)
TreePath
for a given node.node
- The node.TreePath
to the given node.TreePath
protected void fireTreeNodesInserted(Object node, int index, Object parent)
JTree
that a new node has been added to the tree data model.node
- The node that was added.index
- The offset within the parent's list of children at which
this node was added.parent
- The parent of the inserted node.protected void fireTreeNodesRemoved(Object node, int index, Object parent)
JTree
that a node has been removed from the tree data model.node
- The node that was removed.index
- The offset within the parent's list of children of this node.parent
- The parent of the deleted node.protected void fireTreeNodesChanged(Object node, int index, Object parent)
JTree
that a node has changed in some way.node
- The node that changed.index
- The offset within the parent's list of children of this
node.parent
- The parent of the changed node.protected void fireTreeStructureChanged(ITreeNode node)
JTree
that the subtree rooted at a given node has changed in
some major way.node
- The node that is the root of the subtree that changed.public void dispose()
JTree
component, and then null out its
references to the JTree
and to the associated
ITreeModel
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |