Author: mes
Date: 2011-09-27 12:07:33 -0700 (Tue, 27 Sep 2011)
New Revision: 26985

Modified:
   
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/AttributeComboBoxPropertyEditor.java
Log:
minor optimization

Modified: 
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/AttributeComboBoxPropertyEditor.java
===================================================================
--- 
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/AttributeComboBoxPropertyEditor.java
    2011-09-27 18:21:01 UTC (rev 26984)
+++ 
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/propertyeditor/AttributeComboBoxPropertyEditor.java
    2011-09-27 19:07:33 UTC (rev 26985)
@@ -4,6 +4,7 @@
 import java.awt.event.ActionListener;
 
 import javax.swing.JComboBox;
+import javax.swing.SwingUtilities;
 
 import org.cytoscape.application.CyApplicationManager;
 import org.cytoscape.application.events.SetCurrentNetworkViewEvent;
@@ -77,14 +78,18 @@
        }
 
        @Override
-       public void handleEvent(SetCurrentNetworkViewEvent e) {
-               final CyNetworkView networkView = e.getNetworkView();
-               if ( networkView == null ) {
-                       logger.debug("Current network view switched to null");
-                       updateComboBox(null);
-               } else {
-                       logger.debug("Current network view switched to " + 
networkView.getModel());
-                       updateComboBox(networkView.getModel());
-               }
+       public void handleEvent(final SetCurrentNetworkViewEvent e) {
+               SwingUtilities.invokeLater(new Runnable() {
+                       public void run() {
+                               final CyNetworkView networkView = 
e.getNetworkView();
+                               if ( networkView == null ) {
+                                       logger.debug("Current network view 
switched to null");
+                                       updateComboBox(null);
+                               } else {
+                                       logger.debug("Current network view 
switched to " + networkView.getModel());
+                                       updateComboBox(networkView.getModel());
+                               }
+                       }
+               });
        }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to