svn commit: r16208 - trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/uml/diagram/sequence2/ui/FigMessage.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-11-30 09:21:18-0800
New Revision: 16208

Modified:
   trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/uml/diagram/sequence2/ui/FigMessage.java

Log:
Issue 5150 : Start using notation for a FigMessage on a sequence2 diagram.

Modified: trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/uml/diagram/sequence2/ui/FigMessage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/uml/diagram/sequence2/ui/FigMessage.java?view=diff&rev=16208&p1=trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/uml/diagram/sequence2/ui/FigMessage.java&p2=trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/uml/diagram/sequence2/ui/FigMessage.java&r1=16207&r2=16208
==============================================================================
--- trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/uml/diagram/sequence2/ui/FigMessage.java	(original)
+++ trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/uml/diagram/sequence2/ui/FigMessage.java	2008-11-30 09:21:18-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 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
@@ -28,6 +28,7 @@
 import java.awt.Point;
 
 import org.argouml.model.Model;
+import org.argouml.notation.NotationProviderFactory2;
 import org.argouml.uml.diagram.ui.FigEdgeModelElement;
 import org.argouml.uml.diagram.ui.FigTextGroup;
 import org.tigris.gef.base.PathConvPercent;
@@ -57,7 +58,7 @@
     private Object action = null;
     
     /**
-     * Contructs a new figlink and sets the owner of the figlink.
+     * Constructs a new figlink and sets the owner of the figlink.
      *
      * @param owner is the owner.
      */
@@ -71,6 +72,24 @@
     }
     
     @Override
+    protected int getNotationProviderType() {
+        /* Use the same notation as Messages on a collaboration diagram: */
+        return NotationProviderFactory2.TYPE_MESSAGE;
+    }
+    
+    /* This next argument may be used to switch off 
+     * the generation of sequence numbers - this is 
+     * still to be implemented.
+     * They are less desired in sequence diagrams, 
+     * since they do not add any information. 
+     * In collaboration diagrams they are needed, 
+     * and they are still optional in sequence diagrams. */
+    protected void initNotationProviders(Object own) {
+        super.initNotationProviders(own);
+        putNotationArgument("showSequenceNrs", Boolean.FALSE);
+    }
+
+    @Override
     public void setOwner(Object owner) {       
         super.setOwner(owner);
         action = Model.getFacade().getAction(owner);
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.