From: gmungoc Date: Fri, 2 Feb 2018 14:23:21 +0000 (+0000) Subject: JAL-2899 asynchronous Jmol colour updates X-Git-Tag: Release_2_10_4~12^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0defe3aeb990d75fd672e882edbe9e8156b34414;p=jalview.git JAL-2899 asynchronous Jmol colour updates --- diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 41bc116..bbb75cf 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -52,6 +52,8 @@ import java.util.List; import java.util.Map; import java.util.Vector; +import javax.swing.SwingUtilities; + import org.jmol.adapter.smarter.SmarterJmolAdapter; import org.jmol.api.JmolAppConsoleInterface; import org.jmol.api.JmolSelectionListener; @@ -485,15 +487,22 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel */ @Override protected void colourBySequence( - StructureMappingcommandSet[] colourBySequenceCommands) + final StructureMappingcommandSet[] colourBySequenceCommands) { - for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands) + SwingUtilities.invokeLater(new Runnable() { - for (String cbyseq : cpdbbyseq.commands) + @Override + public void run() { - executeWhenReady(cbyseq); + for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands) + { + for (String cbyseq : cpdbbyseq.commands) + { + executeWhenReady(cbyseq); + } + } } - } + }); } /**