Author: bobtarling
Date: 2008-05-14 12:45:37-0700
New Revision: 14737

Modified:
   
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java

Log:
Make sure thread safe, we must still get rid of this eventually though.

Modified: 
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java?view=diff&rev=14737&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java&r1=14736&r2=14737
==============================================================================
--- 
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java
 (original)
+++ 
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java
 2008-05-14 12:45:37-0700
@@ -41,6 +41,7 @@
 import org.argouml.model.AttributeChangeEvent;
 import org.argouml.model.Model;
 import org.argouml.model.RemoveAssociationEvent;
+import org.argouml.model.UmlChangeEvent;
 import org.argouml.ui.ArgoJMenu;
 import org.argouml.uml.diagram.AttributesCompartmentContainer;
 import org.argouml.uml.diagram.ui.CompartmentFigText;
@@ -442,20 +443,14 @@
     }
     
     /*
-     * Handles changes to the model. Takes into account the event that
-     * occurred. If you need to update the whole fig, consider using
-     * renderingChanged.
-     *
-     * @see 
org.argouml.uml.diagram.ui.FigNodeModelElement#modelChanged(java.beans.PropertyChangeEvent)
      * TODO: Based on my comments below, with that work done,
      * this method can be removed - Bob.
      */
-    protected void modelChanged(PropertyChangeEvent mee) {
-        // Let our superclass sort itself out first
-        super.modelChanged(mee);
+    protected void updateLayout(UmlChangeEvent event) {
+        super.updateLayout(event);
 
-        if (mee instanceof AttributeChangeEvent) {
-            Object source = mee.getSource();
+        if (event instanceof AttributeChangeEvent) {
+            Object source = event.getSource();
             if (Model.getFacade().isAAttribute(source)) {
                 // TODO: We just need to get someone to rerender a single line
                 // of text which represents the element here, but I'm not sure
@@ -465,13 +460,13 @@
                // change and the FigFeature should be update from that.
                 updateAttributes();
             }
-        } else if (mee instanceof AssociationChangeEvent 
-                && getOwner().equals(mee.getSource())) {
+        } else if (event instanceof AssociationChangeEvent 
+                && getOwner().equals(event.getSource())) {
             Object o = null;
-            if (mee instanceof AddAssociationEvent) {
-                o = mee.getNewValue();
-            } else if (mee instanceof RemoveAssociationEvent) {
-                o = mee.getOldValue();
+            if (event instanceof AddAssociationEvent) {
+                o = event.getNewValue();
+            } else if (event instanceof RemoveAssociationEvent) {
+                o = event.getOldValue();
             }
             if (Model.getFacade().isAAttribute(o)) {
                // TODO: Bob says - we should not be listening here for
@@ -479,8 +474,6 @@
                // FigAttributesCompartment.
                 updateAttributes();
             }
-            
-            // Our superclass has already updated all listeners
         }
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to