|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.sdsc.grid.gui.JargonTreeModel
public class JargonTreeModel
The class extends the default tree model to use GeneralFiles as the
nodes of the tree. Optimization code was added to reduce the number of
remote system calls made during the building, expanding or redrawing
of the tree.
This class uses a non-thread-safe storage, to keep the javax.swing classes
from constantly querying the filesystem for every refresh and change. All
those network calls really hurt performance. Unfortunately, as this class is
no longer thread safe, changes to the filesystem won't be displayed until
the model is updated.
JargonGui| Field Summary | |
|---|---|
static javax.swing.Icon |
FILE_ICON
The icon displayed for file nodes, leaf nodes. |
static javax.swing.Icon |
FOLDER_ICON
The icon displayed for folder nodes, non-leaf nodes. |
protected javax.swing.event.EventListenerList |
listenerList
The listeners |
static java.lang.String |
TOP_LEVEL
Top level name for trees with multiple GeneralFile roots. |
| Constructor Summary | |
|---|---|
JargonTreeModel(GeneralFile root)
Starts the tree with this GeneralFile as the root node. |
|
JargonTreeModel(GeneralFile[] roots)
Starts the tree with a fake root node, TOP_LEVEL,
with the roots as children to that root. |
|
JargonTreeModel(GeneralFile[] roots,
MetaDataCondition[] conditions)
Starts the tree with a fake root node, TOP_LEVEL,
with the roots as children to that root. |
|
JargonTreeModel(GeneralFile[] roots,
MetaDataCondition[] conditions,
MetaDataSelect[] selects)
Starts the tree with a fake root node, TOP_LEVEL,
with the roots as children to that root. |
|
JargonTreeModel(GeneralFile[] roots,
MetaDataSelect[] selects)
Starts the tree with a fake root node, TOP_LEVEL,
with the roots as children to that root. |
|
JargonTreeModel(GeneralFile root,
MetaDataCondition[] conditions)
Starts the tree with this GeneralFile as the root node. |
|
JargonTreeModel(GeneralFile root,
MetaDataCondition[] conditions,
MetaDataSelect[] selects)
Starts the tree with this GeneralFile as the root node. |
|
JargonTreeModel(GeneralFile root,
MetaDataSelect[] selects)
Starts the tree with this GeneralFile as the root node. |
|
| Method Summary | |
|---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener listener)
Adds a listener for the TreeModelEvent posted after the tree changes. |
protected void |
fireTreeStructureChanged(java.lang.Object oldRoot)
The only event raised by this model is TreeStructureChanged with the root as path, i.e. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Returns the child of parent at index in the parent's child array. |
int |
getChildCount(java.lang.Object parent)
Returns the number of children of parent. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Returns the index of child in parent. |
MetaDataRecordList |
getMetaDataRecordList(java.lang.Object node)
Returns the metadata query result associated with this node of the tree. |
java.lang.Object |
getRoot()
Returns the root of the tree. |
boolean |
isLeaf(java.lang.Object node)
Returns true if node is a leaf. |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener l)
Removes a listener previously added with addTreeModelListener(). |
void |
setRoot(java.lang.Object newRoot)
Change the root of the tree. |
boolean |
showMetaData()
Returns if this treemodel will show metadata. |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
Messaged when the user has altered the value for the item identified by path to newValue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String TOP_LEVEL
protected javax.swing.event.EventListenerList listenerList
public static javax.swing.Icon FOLDER_ICON
public static javax.swing.Icon FILE_ICON
| Constructor Detail |
|---|
public JargonTreeModel(GeneralFile root)
public JargonTreeModel(GeneralFile[] roots)
TOP_LEVEL,
with the roots as children to that root.
public JargonTreeModel(GeneralFile root,
MetaDataCondition[] conditions)
throws java.io.IOException
java.io.IOException
public JargonTreeModel(GeneralFile[] roots,
MetaDataCondition[] conditions)
throws java.io.IOException
TOP_LEVEL,
with the roots as children to that root. Only file nodes
which fit the conditions will be displayed on the tree.
java.io.IOException
public JargonTreeModel(GeneralFile root,
MetaDataSelect[] selects)
throws java.io.IOException
selects
java.io.IOException
public JargonTreeModel(GeneralFile[] roots,
MetaDataSelect[] selects)
throws java.io.IOException
TOP_LEVEL,
with the roots as children to that root. File nodes
on the tree will list the metadata described by selects
java.io.IOException
public JargonTreeModel(GeneralFile root,
MetaDataCondition[] conditions,
MetaDataSelect[] selects)
throws java.io.IOException
selects
java.io.IOException
public JargonTreeModel(GeneralFile[] roots,
MetaDataCondition[] conditions,
MetaDataSelect[] selects)
throws java.io.IOException
TOP_LEVEL,
with the roots as children to that root. Only file nodes
which fit the conditions will be displayed on the tree. File nodes
on the tree will list the metadata described by selects
java.io.IOException| Method Detail |
|---|
public void addTreeModelListener(javax.swing.event.TreeModelListener listener)
addTreeModelListener in interface javax.swing.tree.TreeModelprotected void fireTreeStructureChanged(java.lang.Object oldRoot)
public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
removeTreeModelListener in interface javax.swing.tree.TreeModelpublic void setRoot(java.lang.Object newRoot)
java.lang.ClassCastException - if newRoot is not a GeneralFile
java.lang.NullPointerException - if newRoot is nullpublic java.lang.Object getRoot()
getRoot in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object parent,
int index)
getChild in interface javax.swing.tree.TreeModelpublic int getChildCount(java.lang.Object parent)
getChildCount in interface javax.swing.tree.TreeModel
public int getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
getIndexOfChild in interface javax.swing.tree.TreeModelpublic boolean isLeaf(java.lang.Object node)
isLeaf in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
valueForPathChanged in interface javax.swing.tree.TreeModelpublic MetaDataRecordList getMetaDataRecordList(java.lang.Object node)
node has not been queried or does not exist.
JargonTreeCellEditor.getTreeCellEditorComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int)public boolean showMetaData()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||