From 600c6bd8804790ba5515416be8425c1c3a1d9af2 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 5 Jun 2015 14:49:22 +0100 Subject: [PATCH] JAL-1753 JAL-1596 asynchronous command to Chimera (with progress update) --- src/jalview/gui/JalviewChimeraBindingModel.java | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/jalview/gui/JalviewChimeraBindingModel.java b/src/jalview/gui/JalviewChimeraBindingModel.java index 0dcde11..a5af244 100644 --- a/src/jalview/gui/JalviewChimeraBindingModel.java +++ b/src/jalview/gui/JalviewChimeraBindingModel.java @@ -89,4 +89,31 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding public void refreshPdbEntries() { } + + /** + * Send an asynchronous command to Chimera, in a new thread, optionally with + * an 'in progress' message in a progress bar somewhere + */ + protected void sendAsynchronousCommand(final String command, + final String progressMsg) + { + Thread thread = new Thread(new Runnable() + { + + @Override + public void run() + { + long stm = cvf.startProgressBar(progressMsg); + try + { + sendChimeraCommand(command, false); + } finally + { + cvf.stopProgressBar(null, stm); + } + } + }); + thread.start(); + + } } -- 1.7.10.2