|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.data.MSTTreeModel
public class MSTTreeModel
A bridge class between a MST and a JTree.
This class serves as a bridge between the in-memory representation of a MST
(represented by a recursively defined
MSTNode
set of classes). This class enables
reusing the data set hierarchy maintained by the
MSTNode
object to display it in a JTree.
Field Summary | |
---|---|
private ESTList |
estList
The list of ESTs for which this MST was constructed. |
private MST |
mst
The MST data file that provides all the necessary information for displaying the MST. |
private java.util.ArrayList<javax.swing.event.TreeModelListener> |
treeModelListeners
The list of tree mode listeners that were added to this tree model. |
private MSTData |
wsEntry
A handy reference to the workspace entry from which the data for this MST tree model was actually obtained. |
Constructor Summary | |
---|---|
MSTTreeModel(MST mst,
ESTList estList,
MSTData wsEntry)
The default constructor. |
Method Summary | |
---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener tml)
Adds a listener to be notified when the data associated with the data set changes. |
protected void |
fireTreeStructureChanged(java.lang.Object oldRoot)
The only event raised by this model is TreeStructureChanged with the appropriate entry to be |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
This method provides the actual child object to be displayed in a JTree under a given node. |
int |
getChildCount(java.lang.Object parent)
This method provides the child count for a given node. |
ESTList |
getESTList()
Obtain the list of ESTs for which this MST was generated. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
This method provides the zero-based logical index of a child node. |
MST |
getMST()
Obtain the raw MST file data associated with this model. |
java.lang.Object |
getRoot()
Obtain the root of the data set tree. |
MSTData |
getWsEntry()
Obtain the actual workspace entry whose data is contained in this model. |
boolean |
isLeaf(java.lang.Object entry)
Method to determine if a given entry is a leaf object. |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener tml)
Removes a listener from the list of listeners maintained by this class. |
void |
valueForPathChanged(javax.swing.tree.TreePath arg0,
java.lang.Object arg1)
This data model is meant to be used with a read-only type JTree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final MSTData wsEntry
private final MST mst
private final ESTList estList
private java.util.ArrayList<javax.swing.event.TreeModelListener> treeModelListeners
Constructor Detail |
---|
public MSTTreeModel(MST mst, ESTList estList, MSTData wsEntry)
mst
- The MST data structure that is used to generate
information for this tree model.estList
- The list of ESTs for which this MST was constructed.
The EST information is used to display additional EST information
in the MST display.wsEntry
- The workspace entry corresponding to the clusters being
adapted by this object.Method Detail |
---|
public MST getMST()
public ESTList getESTList()
public void addTreeModelListener(javax.swing.event.TreeModelListener tml)
addTreeModelListener
in interface javax.swing.tree.TreeModel
tml
- The listener to be added to the list of listeners to
be notified when the data associated with the work space changes.public void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
tml
- The listener to be removed from the list of listeners
to receive updates.public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
parent
- The object whose child is to be returned.index
- The index of the child to be returned by this method.TreeModel.getChildCount(java.lang.Object)
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
parent
- The object whose child counts is to be determined.public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
parent
- The object whose child index is to be determined.child
- The child node whose index is to be determined.
TreeModel.getChildCount(java.lang.Object)
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object entry)
isLeaf
in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath arg0, java.lang.Object arg1)
valueForPathChanged
in interface javax.swing.tree.TreeModel
protected void fireTreeStructureChanged(java.lang.Object oldRoot)
public MSTData getWsEntry()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |