svn commit: r15189 - 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: mvw
Date: 2008-07-06 23:13:01-0700
New Revision: 15189

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

Log:
Removed the semaphore and the reduction of drawing refreshes, since the updateLayout() calls are NOT functionally identical. They would be if the updateLayout() function had no parameter.

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=15189&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=15188&r2=15189
==============================================================================
--- 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-07-06 23:13:01-0700
@@ -283,13 +283,6 @@
     // TODO: A more strongly typed data structure could be used here.
     private Collection<Object[]> listeners = new ArrayList<Object[]>();
 
-    /**
-     * 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 layoutUpdatePending = false;
 
     /**
      * The main constructor. <p>
@@ -1007,35 +1000,24 @@
                 stereotypeChanged(event);            
             }
 
-            /*
-             * 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 (!layoutUpdatePending) {
-                layoutUpdatePending = true;
-                Runnable doWorkRunnable = new Runnable() {
-                    public void run() {
-                        try {
-                            layoutUpdatePending = false;
-                            updateLayout(event);
-                        } catch (InvalidElementException e) {
-                            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);
-                            }
+            Runnable doWorkRunnable = new Runnable() {
+                public void run() {
+                    try {
+                        updateLayout(event);
+                    } catch (InvalidElementException e) {
+                        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);
                         }
-                    }  
-                };
-                SwingUtilities.invokeLater(doWorkRunnable);
-            }
+                    }
+                }  
+            };
+            SwingUtilities.invokeLater(doWorkRunnable);
         }
     }
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.