|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractListModel edu.northwestern.at.utils.swing.TreeToListModel
public class TreeToListModel
Field Summary | |
---|---|
protected java.util.Vector |
cache
Cache of list entries. |
protected java.lang.Object |
currentValue
Currently selected list value. |
protected boolean |
invalid
True if list is currently invalid. |
protected javax.swing.tree.TreeModel |
source
The tree model whose entries will be mapped to list entries. |
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
TreeToListModel(javax.swing.tree.TreeModel treeModel)
Create tree to list model mapper. |
Method Summary | |
---|---|
protected void |
addListEntry(java.lang.Object object,
int level,
boolean isNode)
Add an entry to the tree/list. |
protected void |
cacheTree(java.lang.Object object,
int level)
Add object to list/tree cache. |
java.lang.Object |
getElementAt(int index)
Get specified list element. |
java.lang.Object |
getSelectedItem()
Get the selected item. |
int |
getSize()
Return size of the list. |
void |
setSelectedItem(java.lang.Object anItem)
Set the selected item. |
void |
treeNodesChanged(javax.swing.event.TreeModelEvent e)
Called after a node (or a set of siblings) has changed in some way. |
void |
treeNodesInserted(javax.swing.event.TreeModelEvent e)
Called after nodes have been inserted into the tree. |
void |
treeNodesRemoved(javax.swing.event.TreeModelEvent e)
Called after nodes have been removed from the tree. |
void |
treeStructureChanged(javax.swing.event.TreeModelEvent e)
Called after the tree has drastically changed structure. |
protected void |
validate()
Validate the tree/list. |
Methods inherited from class javax.swing.AbstractListModel |
---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.ListModel |
---|
addListDataListener, removeListDataListener |
Field Detail |
---|
protected javax.swing.tree.TreeModel source
protected boolean invalid
protected java.lang.Object currentValue
protected java.util.Vector cache
Constructor Detail |
---|
public TreeToListModel(javax.swing.tree.TreeModel treeModel)
treeModel
- The tree model to be mapped to a list model. Method Detail |
---|
public java.lang.Object getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
public void setSelectedItem(java.lang.Object anItem)
setSelectedItem
in interface javax.swing.ComboBoxModel
anItem
- The item to make the selected item.
if null, the selection is cleared. public int getSize()
getSize
in interface javax.swing.ListModel
public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
index
- Index of element to return.
public void treeNodesChanged(javax.swing.event.TreeModelEvent e)
treeNodesChanged
in interface javax.swing.event.TreeModelListener
e
- The tree model event. public void treeNodesInserted(javax.swing.event.TreeModelEvent e)
treeNodesInserted
in interface javax.swing.event.TreeModelListener
e
- The tree model event. public void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
treeNodesRemoved
in interface javax.swing.event.TreeModelListener
e
- The tree model event. public void treeStructureChanged(javax.swing.event.TreeModelEvent e)
treeStructureChanged
in interface javax.swing.event.TreeModelListener
e
- The tree model event. protected void validate()
protected void cacheTree(java.lang.Object object, int level)
object
- Object to add.level
- Tree depth. protected void addListEntry(java.lang.Object object, int level, boolean isNode)
object
- Object to add.level
- Depth in the tree.isNode
- True if not a leaf node.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |