Author: kono
Date: 2011-09-27 15:23:14 -0700 (Tue, 27 Sep 2011)
New Revision: 26999
Modified:
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
Log:
SwitchVS method will be called in different thread.
Modified:
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
===================================================================
---
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
2011-09-27 22:01:02 UTC (rev 26998)
+++
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
2011-09-27 22:23:14 UTC (rev 26999)
@@ -46,6 +46,7 @@
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTable;
+import javax.swing.SwingUtilities;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
@@ -190,7 +191,7 @@
private void switchVS(final VisualStyle style, boolean forceUpdate) {
- logger.debug("######## Switching start: " + style.getTitle());
+ logger.debug("######## Switching VS start: " +
style.getTitle());
// If new VS name is the same, ignore.
if (!forceUpdate &&
style.equals(manager.getCurrentVisualStyle()))
@@ -199,8 +200,7 @@
// Close editor windows
editorWindowManager.closeAllEditorWindows();
- final List<Property> props = vizMapPropertySheetBuilder
- .getPropertyList(style);
+ final List<Property> props =
vizMapPropertySheetBuilder.getPropertyList(style);
if (props.size() != 0) {
logger.debug("######## Style exists in buffer: " +
style.getTitle());
@@ -239,10 +239,15 @@
final CyNetworkView currentView =
applicationManager.getCurrentNetworkView();
if (currentView != null) {
- vmm.setVisualStyle((VisualStyle)
visualStyleComboBox.getModel().getSelectedItem(), currentView);
- style.apply(currentView);
- // Update view
- currentView.updateView();
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ vmm.setVisualStyle((VisualStyle)
visualStyleComboBox.getModel().getSelectedItem(), currentView);
+ style.apply(currentView);
+ // Update view
+ currentView.updateView();
+ }
+ });
+
}
/*
--
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.