svn commit: r14791 - trunk/src/argouml-app/src/org/argouml/notation/providers/uml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-05-23 10:08:28-0700
New Revision: 14791

Modified:
   trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AssociationNameNotationUml.java
   trunk/src/argouml-app/src/org/argouml/notation/providers/uml/ModelElementNameNotationUml.java

Log:
We do not want to show something that is not in the model.

Modified: trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AssociationNameNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AssociationNameNotationUml.java?view=diff&rev=14791&p1=trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AssociationNameNotationUml.java&p2=trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AssociationNameNotationUml.java&r1=14790&r2=14791
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AssociationNameNotationUml.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AssociationNameNotationUml.java	2008-05-23 10:08:28-0700
@@ -42,7 +42,7 @@
 /**
  * Handles the notation of the name of an association modelelement in UML,
  * ie a string on the format:<pre>
- *     [ &lt;&lt; stereotype &gt;&gt;] [+|-|#] [name]
+ *     [ &lt;&lt; stereotype &gt;&gt;] [+|-|#|~] [name]
  * </pre>
  *
  * @author Michiel
@@ -145,18 +145,14 @@
         String s = "";
         if (isValue("visibilityVisible", args)) {
             Object v = Model.getFacade().getVisibility(modelElement);
-            if (v == null) {
-                /* Initially, the visibility is not set in the model.
-                 * Still, we want to show the default, i.e. public.
-                 */
-                v = Model.getVisibilityKind().getPublic();
+            if (v != null) {
+                s = NotationUtilityUml.generateVisibility(v);
             }
-            s = NotationUtilityUml.generateVisibility(v);
+            /* When nothing is generated: omit the space. */
             if (s.length() > 0) {
                 s = s + " ";
             }
         }
-        /* This for when nothing is generated: omit the space. */
         return s;
     }
 }

Modified: trunk/src/argouml-app/src/org/argouml/notation/providers/uml/ModelElementNameNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/notation/providers/uml/ModelElementNameNotationUml.java?view=diff&rev=14791&p1=trunk/src/argouml-app/src/org/argouml/notation/providers/uml/ModelElementNameNotationUml.java&p2=trunk/src/argouml-app/src/org/argouml/notation/providers/uml/ModelElementNameNotationUml.java&r1=14790&r2=14791
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/notation/providers/uml/ModelElementNameNotationUml.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/notation/providers/uml/ModelElementNameNotationUml.java	2008-05-23 10:08:28-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2005-2007 The Regents of the University of California. All
+// Copyright (c) 2005-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
@@ -166,13 +166,10 @@
         String s = "";
         if (isValue("visibilityVisible", args)) {
             Object v = Model.getFacade().getVisibility(modelElement);
-            if (v == null) {
-                /* Initially, the visibility is not set in the model.
-                 * Still, we want to show the default, i.e. public.
-                 */
-                v = Model.getVisibilityKind().getPublic();
+            if (v != null) {
+                s = NotationUtilityUml.generateVisibility(v);
             }
-            s = NotationUtilityUml.generateVisibility(v);
+            /* When nothing is generated: omit the space. */
             if (s.length() > 0) {
                 s = s + " ";
             }
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.