From: gmungoc Date: Mon, 5 Dec 2016 10:08:29 +0000 (+0000) Subject: JAL-1753 JAL-1596 JAL-1933 ensure AWT updates are on AWT thread X-Git-Tag: Release_2_11_0~62^2~35 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8f3b3ddf42faa51a857e4483a4177412f64f7600;p=jalview.git JAL-1753 JAL-1596 JAL-1933 ensure AWT updates are on AWT thread --- diff --git a/src/jalview/gui/JalviewChimeraBindingModel.java b/src/jalview/gui/JalviewChimeraBindingModel.java index 8d11ca0..bd890d9 100644 --- a/src/jalview/gui/JalviewChimeraBindingModel.java +++ b/src/jalview/gui/JalviewChimeraBindingModel.java @@ -28,6 +28,8 @@ import jalview.ext.rbvi.chimera.JalviewChimeraBinding; import jalview.io.DataSourceType; import jalview.structure.StructureSelectionManager; +import javax.swing.SwingUtilities; + public class JalviewChimeraBindingModel extends JalviewChimeraBinding { private ChimeraViewFrame cvf; @@ -122,17 +124,13 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding protected void sendAsynchronousCommand(final String command, final String progressMsg) { - Thread thread = new Thread(new Runnable() + final long handle = progressMsg == null ? 0 : cvf + .startProgressBar(progressMsg); + SwingUtilities.invokeLater(new Runnable() { - @Override public void run() { - long handle = 0; - if (progressMsg != null) - { - handle = cvf.startProgressBar(progressMsg); - } try { sendChimeraCommand(command, false); @@ -145,8 +143,6 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding } } }); - thread.start(); - } @Override