svn commit: r17307 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociation.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-09-02 15:28:15-0700
New Revision: 17307

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

Log:
Reverse previous commit. I thought I had tested this successfully but I think I used wrong launcher.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociation.java?view=diff&pathrev=17307&r1=17306&r2=17307
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociation.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociation.java	2009-09-02 15:28:15-0700
@@ -25,13 +25,8 @@
 package org.argouml.uml.diagram.ui;
 
 import java.awt.Color;
-import java.awt.Point;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Iterator;
-import java.util.List;
 
 import org.argouml.model.IllegalModelElementConnectionException;
 import org.argouml.model.Model;
@@ -90,20 +85,37 @@
             Layer lay = editor.getLayerManager().getActiveLayer();
             FigAssociation fe = (FigAssociation) lay.presentationFor(getNewEdge());
             _newItem.setLineColor(Color.black);
-            
-            // With MDR (UML1.4) we know that when creating an association the
-            // first association end returned by that association is the source
-            // from which we are drawing. In eUML (UML2.x) the opposite seems to
-            // be true so we need to reverse the way the edge has been drawn.
-            if (Model.getFacade().getUmlVersion().startsWith("2")) {
-                List<Point> pointList = Arrays.asList(_newItem.getPoints());
-                Collections.reverse(pointList);
-                Point[] points = new Point[pointList.size()];
-                pointList.toArray(points);
-                _newItem.setPoints(points);
-            }
-            
             fe.setFig(_newItem);
+            
+//            boolean flip = false;
+//            
+//            final Iterator iter = 
+//                Model.getFacade().getConnections(association).iterator();
+//            
+//            Object sourceAssociationEnd = iter.next();
+//            Object destAssociationEnd = iter.next();
+//            
+//            if (getArg("unidirectional").equals(Boolean.TRUE)) {
+//                if (!Model.getFacade().isNavigable(destAssociationEnd)) {
+//                    flip = true;
+//                }
+//            } else if (!getArg("aggregation").equals(Model.getAggregationKind().getNone())) {
+//                if (Model.getFacade().getAggregation(destAssociationEnd).equals(
+//                        getArg("aggregation"))) {
+//                    flip = true;
+//                }
+//            }
+//            if (flip) {
+//                fe.setDestPortFig(getStartPortFig());
+//                fe.setDestFigNode(getSourceFigNode());
+//                fe.setSourcePortFig(destFigNode);
+//                fe.setSourceFigNode((FigNode) destFigNode);
+//            } else {
+//                fe.setSourcePortFig(getStartPortFig());
+//                fe.setSourceFigNode(getSourceFigNode());
+//                fe.setDestPortFig(destFigNode);
+//                fe.setDestFigNode((FigNode) destFigNode);
+//            }
             return fe;
 
         } else {

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2390456

To unsubscribe from this discussion, e-mail: [[email protected]].
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.