Author: mvw
Date: 2011-05-05 23:24:38-0700
New Revision: 19355

Modified:
   
trunk/src/argouml-app/src/org/argouml/notation/providers/EnumerationLiteralNotation.java
   
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java

Log:
Fix for issue 6247: Enumeration literal is not refreshed in class diagram.

Modified: 
trunk/src/argouml-app/src/org/argouml/notation/providers/EnumerationLiteralNotation.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/notation/providers/EnumerationLiteralNotation.java?view=diff&pathrev=19355&r1=19354&r2=19355
==============================================================================
--- 
trunk/src/argouml-app/src/org/argouml/notation/providers/EnumerationLiteralNotation.java
    (original)
+++ 
trunk/src/argouml-app/src/org/argouml/notation/providers/EnumerationLiteralNotation.java
    2011-05-05 23:24:38-0700
@@ -1,6 +1,6 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009-2010 Contributors - see below
+ * Copyright (c) 2009-2011 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -67,10 +67,10 @@
     @Override
     public void initialiseListener(Object modelElement) {
         addElementListener(modelElement, 
-                new String[] {"remove", "stereotype"} );
+                new String[] {"name", "remove", "stereotype"} );
         Collection c = Model.getFacade().getStereotypes(modelElement);
         for (Object st : c) {
-            addElementListener(st, "name");
+            addElementListener(st, new String[] {"name", "remove"});
         }
     }
 

Modified: 
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java?view=diff&pathrev=19355&r1=19354&r2=19355
==============================================================================
--- 
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java
   (original)
+++ 
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java
   2011-05-05 23:24:38-0700
@@ -1,13 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2011 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
+ *    Michiel van der Wulp
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -44,7 +45,6 @@
 
 import org.argouml.model.Model;
 import org.argouml.uml.diagram.DiagramSettings;
-import org.argouml.uml.diagram.ui.FigEnumLiteralsCompartment;
 import org.tigris.gef.base.Selection;
 
 /**
@@ -73,7 +73,16 @@
     protected String getKeyword() {
         return "enumeration";
     }
-    
+
+    @Override
+    public void renderingChanged() {
+        super.renderingChanged();
+
+        if 
(isCompartmentVisible(Model.getMetaTypes().getEnumerationLiteral())) {
+            updateCompartment(Model.getMetaTypes().getEnumerationLiteral());
+        }
+    }
+
     @Override
     public Selection makeSelection() {
         return new SelectionEnumeration(this);
@@ -81,30 +90,30 @@
 
     @Override
     protected void updateListeners(Object oldOwner, Object newOwner) {
-        Set<Object[]> l = new HashSet<Object[]>();
+        Set<Object[]> lst = new HashSet<Object[]>();
         if (newOwner != null) {
             // add the listeners to the newOwner
-            l.add(new Object[] {newOwner, null});
+            lst.add(new Object[] {newOwner, null});
             // and its stereotypes
             for (Object stereo : Model.getFacade().getStereotypes(newOwner)) {
-                l.add(new Object[] {stereo, null});                
+                lst.add(new Object[] {stereo, null});                
             }
             // and its features
             for (Object feat : Model.getFacade().getFeatures(newOwner)) {
-                l.add(new Object[] {feat, null});
+                lst.add(new Object[] {feat, null});
                 // and the stereotypes of its features
                 for (Object stereo : Model.getFacade().getStereotypes(feat)) {
-                    l.add(new Object[] {stereo, null});
+                    lst.add(new Object[] {stereo, null});
                 }
             }
             // and its enumerationLiterals
             for (Object literal : Model.getFacade().getEnumerationLiterals(
                     newOwner)) {
-                l.add(new Object[] {literal, null});
+                lst.add(new Object[] {literal, null});
             }
         }
         // And now add listeners to them all:
-        updateElementListeners(l);
+        updateElementListeners(lst);
 
     }

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

To unsubscribe from this discussion, e-mail: 
[[email protected]].

Reply via email to