|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This is the interface for the TreeStrategy.
This is part of a concrete implementation of the Strategy Design Pattern
which is used here in order to facilitate adding customized Tree models to the
TreeOutliner instances.
Note that there is a one-to-one relationship between an
TreeStrategy and its DefaultTreeModel.
In other words, if the client custom application requires a new model to
be set for the TreeOutliner, it is necessary to provide both
a new DefaultTreeModel and AbstractTreeStrategy
implementation.
This interface defines the following factory method in order to retrieve
the correct instance of DefaultMutableTreeNode associated to an object which
needs to be outlined in the Outliner.
TreeOutliner,
OutlinerStrategy,
AbstractTreeStrategy,
AbstractVisualGraphTreeStrategy| Method Summary | |
void |
addNode(javax.swing.tree.DefaultMutableTreeNode parent,
javax.swing.tree.DefaultMutableTreeNode node)
Method addNode adds the given node the the given parent.
|
javax.swing.tree.DefaultMutableTreeNode |
getNewTreeNode(int subClassType,
java.lang.Object documentObject)
Simple factory method returning a new instance of DefaultMutableTreeNode corresponding to documentObject depending on the passed
subClassType parameter.
|
int |
getParentIndex(javax.swing.tree.DefaultMutableTreeNode parent)
Returns the index reserved for the given parent node. |
void |
removeNode(javax.swing.tree.DefaultMutableTreeNode parent,
long id)
Method removeNode removes a Node from the TreeModel identified by the given id. |
void |
updateNode(javax.swing.tree.TreeNode node)
Method updateNode reflects the changes made on the passed TreeNode on the TreeModel |
| Methods inherited from interface com.tensegrity.gui.swing.control.tree.strategy.OutlinerStrategy |
getComparator |
| Method Detail |
public int getParentIndex(javax.swing.tree.DefaultMutableTreeNode parent)
parent - the parent of which you want the index
public void addNode(javax.swing.tree.DefaultMutableTreeNode parent,
javax.swing.tree.DefaultMutableTreeNode node)
node the the given parent.
If parent s childcount is 0 before the
adding, its added to the root. The current expanded TreePath instances
are saved and restored after the sucessful adding.
parent - the DefaultMutableTreeNode of which
node is going to be added as a childnode - the DefaultMutableTreeNode to add.
public void removeNode(javax.swing.tree.DefaultMutableTreeNode parent,
long id)
parent - the parent of the node to be removed.id - unique identifier for the node to be removed.public void updateNode(javax.swing.tree.TreeNode node)
Method updateNode reflects the changes made on the passed TreeNode on the TreeModel
node - The TreeNode which requires to be updated
public javax.swing.tree.DefaultMutableTreeNode getNewTreeNode(int subClassType,
java.lang.Object documentObject)
Simple factory method returning a new instance of DefaultMutableTreeNode
corresponding to documentObject depending on the passed
subClassType parameter.
Refer to the implementation provided in AbstractVisualGraphTreeStrategy
as an example on how is this method meant to be implemented.
subClassType - To be defined will implementing this method. This parameter
should allow distinguishing possible subClasses of
DefaultMutableTreeNode required by the caller.documentObject - This is the object located on the active document for which a
TreeNode is required.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||