import jalview.io.DataSourceType;
import jalview.structure.StructureSelectionManager;
+import javax.swing.SwingUtilities;
+
public class JalviewChimeraBindingModel extends JalviewChimeraBinding
{
private ChimeraViewFrame cvf;
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 stm = cvf.startProgressBar(progressMsg);
try
{
sendChimeraCommand(command, false);
} finally
{
- cvf.stopProgressBar(null, stm);
+ if (progressMsg != null)
+ {
+ cvf.stopProgressBar(null, handle);
+ }
}
}
});
- thread.start();
-
}
@Override