From 8f3b3ddf42faa51a857e4483a4177412f64f7600 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 5 Dec 2016 10:08:29 +0000 Subject: [PATCH] JAL-1753 JAL-1596 JAL-1933 ensure AWT updates are on AWT thread --- src/jalview/gui/JalviewChimeraBindingModel.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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 -- 1.7.10.2