svn commit: r16130 - trunk/src/argouml-app/src/org/argouml/ui/DisplayTextTree.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-11-21 22:29:32-0800
New Revision: 16130

Modified:
   trunk/src/argouml-app/src/org/argouml/ui/DisplayTextTree.java

Log:
Use standard stereotype generation utility

Modified: trunk/src/argouml-app/src/org/argouml/ui/DisplayTextTree.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/DisplayTextTree.java?view=diff&rev=16130&p1=trunk/src/argouml-app/src/org/argouml/ui/DisplayTextTree.java&p2=trunk/src/argouml-app/src/org/argouml/ui/DisplayTextTree.java&r1=16129&r2=16130
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/DisplayTextTree.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/DisplayTextTree.java	2008-11-21 22:29:32-0800
@@ -47,6 +47,7 @@
 import org.argouml.model.Model;
 import org.argouml.notation.NotationProvider;
 import org.argouml.notation.NotationProviderFactory2;
+import org.argouml.notation.providers.uml.NotationUtilityUml;
 import org.argouml.uml.diagram.ArgoDiagram;
 import org.argouml.uml.ui.UMLTreeCellRenderer;
 
@@ -158,10 +159,8 @@
                         new HashMap<String, Object>();
                     Project p = ProjectManager.getManager().getCurrentProject();
                     if (p != null) {
-                        npArguments.put("rightGuillemot", 
-                                p.getProjectSettings().getRightGuillemot());
-                        npArguments.put("leftGuillemot", 
-                                p.getProjectSettings().getLeftGuillemot());
+                        npArguments.put("useGuillemets", p.getProjectSettings()
+                                .getDefaultDiagramSettings().isUseGuillemets());
                     }
                     name = notationProvider.toString(value, npArguments);
                 } else if (Model.getFacade().isAComment(value)) {
@@ -322,29 +321,11 @@
      * @return a string representing the given stereotype(s)
      */
     public static String generateStereotype(Collection<Object> st) {
-        if (st == null) {
-            return "";
-        }
-        StringBuilder sb = new StringBuilder(10);
-        boolean first = true;
-        for (Object o : st) {
-            if (!first) {
-                sb.append(',');
-            }
-            if (o != null) {
-                sb.append(Model.getFacade().getName(o));
-                first = false;
-            }
-        }
-        if (!first) {
-            Project project =
-                ProjectManager.getManager().getCurrentProject();
-            ProjectSettings ps = project.getProjectSettings();
-            return ps.getLeftGuillemot()
-                + sb.toString()
-                + ps.getRightGuillemot();
-        }
-        return "";
+        Project project =
+            ProjectManager.getManager().getCurrentProject();
+        ProjectSettings ps = project.getProjectSettings();
+        return NotationUtilityUml.generateStereotype(st, 
+                ps.getDefaultDiagramSettings().isUseGuillemets());
     }
 
     public static final String getModelElementDisplayName(Object modelElement) {
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.