svn commit: r16367 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2008-12-16 07:58:26-0800
New Revision: 16367

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

Log:
Issue 5538: Make sure that change of diagram due to model element removal happens on awt thread.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java?view=diff&pathrev=16367&r1=16366&r2=16367
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	2008-12-16 07:58:26-0800
@@ -617,7 +617,17 @@
         Object src = pve.getSource();
         String pName = pve.getPropertyName();
         if (pve instanceof DeleteInstanceEvent && src == getOwner()) {
-            removeFromDiagram();
+            Runnable doWorkRunnable = new Runnable() {
+                public void run() {
+                    try {
+                        removeFromDiagram();
+                    } catch (InvalidElementException e) {
+                            LOG.error("updateLayout method accessed "
+                                    + "deleted element", e);
+                    }
+                }  
+            };
+            SwingUtilities.invokeLater(doWorkRunnable);
             return;
         }
         // We handle and consume editing events

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

To unsubscribe from this discussion, e-mail: [[email protected]].
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.