svn commit: r15098 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-06-28 07:09:02-0700
New Revision: 15098

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

Log:
Issue 5182: Give flag a more memorable name

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=15098&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=15097&r2=15098
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2008-06-28 07:09:02-0700
@@ -284,12 +284,12 @@
     private Collection<Object[]> listeners = new ArrayList<Object[]>();
 
     /**
-     * If this semaphore is false, then a Runnable to update the layout 
+     * If this semaphore is true, then a Runnable to update the layout 
      * is already waiting to be executed. The semaphore is then used to 
      * guarantee that not more than one such (functionally identical) Runnable
      * is created and queued in the SwingUtilities.invokeLater() call.
      */
-    private boolean semaphore = true;
+    private boolean layoutUpdatePending = false;
 
     /**
      * The main constructor. <p>
@@ -1008,26 +1008,29 @@
             }
 
             /*
-             * If this semaphore is false, then a Runnable to update the layout 
+             * If this semaphore is true, then a Runnable to update the layout 
              * is already waiting to be executed. The semaphore is then used to 
              * guarantee that not more than one such (functionally identical) 
              * Runnable is created and queued in the 
              * SwingUtilities.invokeLater() call.
              */
-            if (semaphore) {
-                semaphore = false;
+            if (!layoutUpdatePending) {
+                layoutUpdatePending = true;
                 Runnable doWorkRunnable = new Runnable() {
                     public void run() {
                         try {
-                            semaphore = true;
+                            layoutUpdatePending = false;
                             updateLayout(event);
                         } catch (InvalidElementException e) {
-                            LOG.debug("event = " + event.getClass().getName());
-                            LOG.debug("source = " + event.getSource());
-                            LOG.debug("old = " + event.getOldValue());
-                            LOG.debug("name = " + event.getPropertyName());
-                            LOG.debug("updateLayout method accessed "
+                            if (LOG.isDebugEnabled()) {
+                                LOG.debug("event = "
+                                        + event.getClass().getName());
+                                LOG.debug("source = " + event.getSource());
+                                LOG.debug("old = " + event.getOldValue());
+                                LOG.debug("name = " + event.getPropertyName());
+                                LOG.debug("updateLayout method accessed "
                             		+ "deleted element ", e);
+                            }
                         }
                     }  
                 };
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.