|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.swing.control.tree.strategy.AbstractTreeStrategy
com.tensegrity.gui.swing.control.tree.strategy.AbstractVisualGraphTreeStrategy
com.tensegrity.gui.swing.control.tree.strategy.DefaultVisualGraphTreeStrategy
This is the default javax.swing implementation of the abstract
AbstractVisualGraphTreeStrategy.
It has a one-to-one relationship with DefaultVisualGraphTreeModel
Documents passed to/used
into this class are in fact SwingGraphDocuments.
AbstractVisualGraphTreeStrategy,
OutlinerStrategy,
TreeOutliner,
DefaultVisualGraphTreeModel| Field Summary |
| Fields inherited from class com.tensegrity.gui.swing.control.tree.strategy.AbstractVisualGraphTreeStrategy |
DOCUMENT_TYPE_KEY, VISUAL_EDGE_TREE_NODE, VISUAL_NODE_TREE_NODE, VISUAL_SUBGRAPH_TREE_NODE |
| Constructor Summary | |
DefaultVisualGraphTreeStrategy(UIManager uiManager)
Initialises instances of this class with the passed
instance.
|
|
| Method Summary | |
javax.swing.tree.DefaultMutableTreeNode |
findNodeByID(javax.swing.tree.DefaultMutableTreeNode parent,
long id)
Utility method. |
javax.swing.tree.DefaultMutableTreeNode |
findNodeByID(long id)
This method retrieves the DefaultMutableTreeNode
associated to a VisualGraphObject given its unique ID. |
int |
getParentIndex(javax.swing.tree.DefaultMutableTreeNode parent)
Returns the index reserved for the given parent node. |
protected javax.swing.tree.DefaultMutableTreeNode |
getVisualSubgraphTreeNode(VisualSubgraph vsg)
Returns the DefaultMutableTreeNode associated to
vsg
|
javax.swing.tree.DefaultTreeModel |
initializeModel(java.util.Map uiMap,
Document document,
java.lang.String name,
boolean recreateModelEvenIfExists)
Note that the assertion is made that the Documents passed to/used
into this method are in fact SwingGraphDocuments. |
void |
isolatedVisualEdgeAdded(VisualGraphEvent event)
An isolated VisualEdge was added to the VisualGraph. |
protected void |
isolatedVisualEdgeAddedToSubgraph(VisualSubgraph vsg,
VisualEdge ve)
Routine used when an isolated VisualEdge is added to a
VisualSubgraph.
|
protected void |
isolatedVisualEdgeAddedToVisualgraph(VisualGraph vgv,
VisualEdge ve)
Routine used when an isolated VisualEdge is added to a VisualGraph.
|
void |
isolatedVisualEdgeRemoved(VisualGraphEvent event)
An isolated VisualEdge was removed from the
VisualGraph. |
void |
layout(VisualGraphEvent visualgraphevent)
Do nothing |
void |
removeNode(javax.swing.tree.DefaultMutableTreeNode parent,
long id)
Method removeNode removes a Node from the TreeModel identified by the given id. |
void |
removeNode(long id)
Removes from the
the DefaultMutableTreeNode with ID id.
|
protected void |
setModel(javax.swing.tree.DefaultTreeModel model)
Locally stores the passed model. |
protected void |
setSelectionOnTree(java.util.List selection)
Selects on the TreeOutliner the s corresponding to the
BaseComposite s contained in selection.
|
void |
visualEdgeAdded(VisualGraphEvent event)
A VisualEdge was added to the VisualGraph. |
protected void |
visualEdgeAddedToSubgraph(VisualSubgraph vsg,
VisualEdge ve)
Routine used when a VisualEdge is added to a VisualSubgraph.
|
protected void |
visualEdgeAddedToVisualgraph(VisualGraph vgv,
VisualEdge ve)
Routine used when a VisualEdge is added to a VisualGraph.
|
void |
visualEdgeAttachRejected(VisualGraphEvent visualgraphevent)
Do nothing |
void |
visualEdgeRemoved(VisualGraphEvent event)
A VisualEdge was removed from the VisualGraph. |
void |
visualEdgeSplit(VisualGraphEvent visualgraphevent)
An edge-split was performed. |
void |
visualNodeAdded(VisualGraphEvent event)
A VisualNode was added to the VisualGraph. |
protected void |
visualNodeAddedToSubgraph(VisualSubgraph vsg,
VisualNode vn)
Routine used when a VisualNode is added to a VisualSubgraph.
|
protected void |
visualNodeAddedToVisualgraph(VisualGraph vgv,
VisualNode vn)
Routine used when a VisualNode is added to a VisualGraph.
|
void |
visualNodeDeleteEdgeCascade(VisualGraphEvent visualgraphevent)
An edge-cascade was performed. |
void |
visualNodeRemoved(VisualGraphEvent event)
A VisualNode was added to the VisualGraph. |
| Methods inherited from class com.tensegrity.gui.swing.control.tree.strategy.AbstractVisualGraphTreeStrategy |
addNode, getComparator, getNewTreeNode |
| Methods inherited from class com.tensegrity.gui.swing.control.tree.strategy.AbstractTreeStrategy |
getActiveDocument, getDocumentIdNodeMap, getDocumentModelMap, getIdNodeMap, getModel, getRoot, getTree, getUIManager, removeModel, setActiveDocument, setTree, updateNode |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultVisualGraphTreeStrategy(UIManager uiManager)
Initialises instances of this class with the passed
instance.
UIManager
uiManager - the application UIManager.| Method Detail |
public javax.swing.tree.DefaultTreeModel initializeModel(java.util.Map uiMap,
Document document,
java.lang.String name,
boolean recreateModelEvenIfExists)
Documents passed to/used
into this method are in fact SwingGraphDocuments.
initializeModel in class AbstractTreeStrategyuiMap - this is the UI Map.document - The document of which the Model is requiredname - The name of the documentrecreateModelEvenIfExists - True if the Model should be recreated even if a Model is
already associated to the document.
AbstractTreeStrategy.initializeModel(java.util.Map, com.tensegrity.gui.document.Document, java.lang.String, boolean)protected void setModel(javax.swing.tree.DefaultTreeModel model)
AbstractTreeStrategyLocally stores the passed model.
Important Note
It is internally storing the model in a for
which the key is the Map corresponding to
the passed model.
Document
Document local instance is
set to the desired Document before this method is
called. This is done by AbstractTreeStrategy.initializeModel(Map, Document, String, boolean).
setModel in class AbstractTreeStrategymodel - the DefaultTreeModel associated to the
active Docuement, if any.
public javax.swing.tree.DefaultMutableTreeNode findNodeByID(javax.swing.tree.DefaultMutableTreeNode parent,
long id)
AbstractTreeStrategyDefaultMutableTreeNode which matches
the given id. If no such node is found, null is returned.
findNodeByID in class AbstractTreeStrategyparent - DefaultMutableTreeNode representing
the parent of the DefaultMutableTreeNode
we are looking for.id - unique identifier for a tree node.
DefaultMutableTreeNode
which matches the given id, or nulll/code> if no match is found.public javax.swing.tree.DefaultMutableTreeNode findNodeByID(long id)
This method retrieves the DefaultMutableTreeNode
associated to a VisualGraphObject given its unique ID. The
unique id is retrieve using
.
System.identityHashCode(java.lang.Object)
id - Unique ID used to retrieve the
DefaultMutableTreeNode associated to a
VisualGraphObject.
DefaultMutableTreeNode associated with the
VisualGraphObject with unique ID id.public void removeNode(long id)
Removes from the
the TreeOutlinerDefaultMutableTreeNode with ID id.
id - ID of the DefaultMutableTreeNode to remove from
the
TreeOutliner.findNodeByID(long)public void visualEdgeRemoved(VisualGraphEvent event)
VisualGraphListenerVisualEdge was removed from the VisualGraph.
event - the VisualGraphEvent structure
that contains the event information.com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#visualEdgeRemoved(com.tensegrity.graph.event.VisualGraphEvent)public void isolatedVisualEdgeAdded(VisualGraphEvent event)
VisualGraphListenerVisualEdge was added to the VisualGraph.
event - the VisualGraphEvent structure
that contains the event information.com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#isolatedVisualEdgeAdded(com.tensegrity.graph.event.VisualGraphEvent)public void isolatedVisualEdgeRemoved(VisualGraphEvent event)
VisualGraphListenerVisualEdge was removed from the
VisualGraph.
event - the VisualGraphEvent structure
that contains the event information.com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#isolatedVisualEdgeRemoved(com.tensegrity.graph.event.VisualGraphEvent)public void visualEdgeSplit(VisualGraphEvent visualgraphevent)
VisualGraphListener
visualgraphevent - the VisualGraphEvent structure that
contains the event information.com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#visualEdgeSplit(com.tensegrity.graph.event.VisualGraphEvent)public void visualNodeDeleteEdgeCascade(VisualGraphEvent visualgraphevent)
VisualGraphListener
visualgraphevent - the VisualGraphEvent structure that
contains the event information.com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#visualNodeDeleteEdgeCascade(com.tensegrity.graph.event.VisualGraphEvent)public void visualNodeRemoved(VisualGraphEvent event)
VisualGraphListenerVisualNode was added to the VisualGraph.
event - the VisualGraphEvent
structure that contains the event information.com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#visualNodeRemoved(com.tensegrity.graph.event.VisualGraphEvent)public void visualNodeAdded(VisualGraphEvent event)
VisualGraphListenerVisualNode was added to the VisualGraph.
event - the VisualGraphEvent
structure that contains the event information.com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#visualNodeAdded(com.tensegrity.graph.event.VisualGraphEvent)
protected void visualNodeAddedToVisualgraph(VisualGraph vgv,
VisualNode vn)
Routine used when a VisualNode is added to a VisualGraph.
It is important to notice that if the passed VisualNode is in fact a
, then the
VisualSubgraph
will be registered as listener of this TreeOutlinerVisualSubgraph.
See
for more information.
Also, in such a case this routine iterates through the list of com.tensegrity.gui.swing.control.tree.TreeOutliner#doAddListeners(VisualSubgraph)
contained within VisualGraphObjectvn and depending on their type calls
,
isolatedVisualEdgeAddedToSubgraph(VisualSubgraph, VisualEdge) or
visualEdgeAddedToSubgraph(VisualSubgraph, VisualEdge).
This method is called by visualNodeAddedToSubgraph(VisualSubgraph, VisualNode)
and initializeModel(Map, Document, String, boolean).
visualNodeAdded(VisualGraphEvent)
vgv - a VisualGraph.vn - a VisualNode which was added to
vgv.
protected void visualNodeAddedToSubgraph(VisualSubgraph vsg,
VisualNode vn)
Routine used when a VisualNode is added to a VisualSubgraph.
It is important to notice that if the passed VisualNode is in fact a
, then the
VisualSubgraph
will be registered as listener of this TreeOutlinerVisualSubgraph.
See
for more information.
Also, in such a case this routine iterates through the list of com.tensegrity.gui.swing.control.tree.TreeOutliner#doAddListeners(VisualSubgraph)
contained within VisualGraphObjectvn and depending on their type calls
,
isolatedVisualEdgeAddedToSubgraph(VisualSubgraph, VisualEdge) or
visualEdgeAddedToSubgraph(VisualSubgraph, VisualEdge).
visualNodeAddedToSubgraph(VisualSubgraph, VisualNode)
vsg - a VisualSubgraph.vn - a VisualNode which was added to
vsg.protected javax.swing.tree.DefaultMutableTreeNode getVisualSubgraphTreeNode(VisualSubgraph vsg)
Returns the DefaultMutableTreeNode associated to
vsg
vsg - the VisualSubgraph of which the associated
DefaultMutableTreeNode is requested.
DefaultMutableTreeNode associated to
vsgpublic void layout(VisualGraphEvent visualgraphevent)
visualgraphevent - the VisualGraphEvent structure that
contains the event information.VisualGraphListener.layout(com.tensegrity.graph.event.VisualGraphEvent)public void visualEdgeAttachRejected(VisualGraphEvent visualgraphevent)
visualgraphevent - the VisualGraphEvent structure
that contains the event information.VisualGraphListener.visualEdgeAttachRejected(com.tensegrity.graph.event.VisualGraphEvent)public void visualEdgeAdded(VisualGraphEvent event)
VisualGraphListenerVisualEdge was added to the VisualGraph.
event - the VisualGraphEvent structure
that contains the event information.com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#visualEdgeAdded(com.tensegrity.graph.event.VisualGraphEvent)public int getParentIndex(javax.swing.tree.DefaultMutableTreeNode parent)
TreeStrategy
parent - the parent of which you want the index
com.tensegrity.component.organigram.gui.panels.tree.TreeStrategy#getParentIndex(javax.swing.tree.DefaultMutableTreeNode)
public void removeNode(javax.swing.tree.DefaultMutableTreeNode parent,
long id)
TreeStrategy
parent - the parent of the node to be removed.id - unique identifier for the node to be removed.TreeStrategy.removeNode(javax.swing.tree.DefaultMutableTreeNode, long),
removeNode(long)
protected void visualEdgeAddedToVisualgraph(VisualGraph vgv,
VisualEdge ve)
Routine used when a VisualEdge is added to a VisualGraph.
This method is called by
and initializeModel(Map, Document, String, boolean).
visualEdgeAdded(VisualGraphEvent)
vgv - a VisualGraph.ve - a VisualEdge which was added to
vgv.
protected void visualEdgeAddedToSubgraph(VisualSubgraph vsg,
VisualEdge ve)
Routine used when a VisualEdge is added to a VisualSubgraph.
vsg - a VisualSubgraph.ve - a VisualEdge which was added to
vsg.
protected void isolatedVisualEdgeAddedToVisualgraph(VisualGraph vgv,
VisualEdge ve)
Routine used when an isolated VisualEdge is added to a VisualGraph.
This method is called by
and initializeModel(Map, Document, String, boolean).
isolatedVisualEdgeAdded(VisualGraphEvent)
vgv - a VisualGraph.ve - an isolated VisualEdge which was added to
vgv.
protected void isolatedVisualEdgeAddedToSubgraph(VisualSubgraph vsg,
VisualEdge ve)
Routine used when an isolated VisualEdge is added to a
VisualSubgraph.
vsg - a VisualSubgraph.ve - an isolated VisualEdge which was added
to vsg.protected void setSelectionOnTree(java.util.List selection)
Selects on the TreeOutliner the
s corresponding to the
DefaultMutableTreeNodeBaseComposite s contained in selection.
selection - a list of BaseComposite s for which the
corresponding DefaultMutableTreeNode of
the TreeOutliner should be selected.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||