svn commit: r14736 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2008-05-14 12:25:06-0700
New Revision: 14736

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java

Log:
Remove knowledge of current editor.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java?view=diff&rev=14736&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java&r1=14735&r2=14736
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java	2008-05-14 12:25:06-0700
@@ -39,6 +39,7 @@
 import org.tigris.gef.base.Editor;
 import org.tigris.gef.base.Globals;
 import org.tigris.gef.base.Layer;
+import org.tigris.gef.base.LayerPerspective;
 import org.tigris.gef.graph.GraphEdgeRenderer;
 import org.tigris.gef.graph.GraphModel;
 import org.tigris.gef.graph.MutableGraphModel;
@@ -147,21 +148,18 @@
      */
     private void reduceToBinary() {
         final Object association = getOwner();
-        final Editor editor = Globals.curEditor();
-        final MutableGraphModel gm = 
-            (MutableGraphModel) editor.getGraphModel();
-        final GraphEdgeRenderer renderer =
-            editor.getGraphEdgeRenderer();
+        final LayerPerspective lay = (LayerPerspective) getLayer();
+        final MutableGraphModel gm = (MutableGraphModel) lay.getGraphModel();
         gm.removeNode(association);
         removeFromDiagram();
-        final Layer lay = editor.getLayerManager().getActiveLayer();
+        
+        final GraphEdgeRenderer renderer =
+            lay.getGraphEdgeRenderer();
         final FigAssociation figEdge = (FigAssociation) renderer.getFigEdgeFor(
                 gm, lay, association, null);
-        editor.add(figEdge);
+        lay.add(figEdge);
         gm.addEdge(association);
         figEdge.computeRoute();
-        editor.getSelectionManager().deselectAll();
-        editor.damageAll();
     }
     
     /*
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.