svn commit: r16586 - trunk/src/argouml-app/src/org/argouml/uml/diagram: collaboration/ui ui

Michiel van der Wulp <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2009-01-12 13:28:43-0800
New Revision: 16586

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigAssociationRole.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigMessage.java

Log:
Fix for issue 5595: The arrow next to a message in a collaboration diagram points the right way now.
Tested by creation of a message, and by dragging classifierRoles around to see the Message arrows flip direction - yeah!

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigAssociationRole.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigAssociationRole.java?view=diff&pathrev=16586&r1=16585&r2=16586
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigAssociationRole.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigAssociationRole.java	2009-01-12 13:28:43-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2008 The Regents of the University of California. All
+// Copyright (c) 1996-2009 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -56,7 +56,7 @@
     /**
      * Main Constructor
      * 
-     * @deprecate for 0.27.3 by tfmorris. Use
+     * @deprecated for 0.27.3 by tfmorris. Use
      *            {@link #FigAssociationRole(Object, DiagramSettings)}.
      */
     @SuppressWarnings("deprecation")
@@ -72,7 +72,7 @@
      * 
      * @param edge the owning UML element
      * @param lay the layer
-     * @deprecate for 0.27.3 by tfmorris. Use
+     * @deprecated for 0.27.3 by tfmorris. Use
      *            {@link #FigAssociationRole(Object, DiagramSettings)}.
      */
     @SuppressWarnings("deprecation")
@@ -112,6 +112,12 @@
     	messages.damage();
     }
 
+@Override
+public void computeRouteImpl() {
+    super.computeRouteImpl();
+    messages.updateArrows();
+}
+    
 } /* end class FigAssociationRole */
 
 /**
@@ -121,7 +127,7 @@
 
     /**
      * Constructor for FigMessageGroup.
-     * @deprecate for 0.27.3 by tfmorris. Use
+     * @deprecated for 0.27.3 by tfmorris. Use
      *            {@link #FigMessageGroup(Object, DiagramSettings)}.
      */
     @SuppressWarnings("deprecation")
@@ -134,7 +140,7 @@
      * Constructor for FigMessageGroup.
      * 
      * @param figs
-      * @deprecate for 0.27.3 by tfmorris. Use
+     * @deprecated for 0.27.3 by tfmorris. Use
      *            {@link #FigMessageGroup(Object, DiagramSettings)}.
      */
     @SuppressWarnings("deprecation")
@@ -209,7 +215,15 @@
     public void addFig(Fig f) {
 	super.addFig(f);
 	updateFigPositions();
+	updateArrows();
 	calcBounds();
     }
+    
+    void updateArrows() {
+        for (FigMessage fm : (List<FigMessage>) getFigs()) {
+            fm.updateArrow();
+        }
+    }
+
 }
 

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigMessage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigMessage.java?view=diff&pathrev=16586&r1=16585&r2=16586
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigMessage.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigMessage.java	2009-01-12 13:28:43-0800
@@ -62,7 +62,7 @@
     /**
      * The current arrow direction set to constants above.
      */
-    private int arrowDirection = 0;
+    private int arrowDirection = -1;
 
     /**
      * The main constructor.
@@ -500,10 +500,10 @@
 
 
     /**
-     * Determines the direction of the message arrow. Deetermination of the type
-     * of arrow happens in modelchanged.
+     * Determines the direction of the message arrow. Determination of the type
+     * of arrow happens in modelChanged.
      */
-    protected void updateArrow() {
+    public void updateArrow() {
   	Object mes = getOwner(); // Message
 	if (mes == null || getLayer() == null) {
 	    return;

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

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.