From: James Procter Date: Wed, 10 Jan 2024 15:51:52 +0000 (+0000) Subject: JAL-4369 invokeAndWait to avoid hang whilst calling getFiles if a Jmol redraw is... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0041b370235a60faada5dde14f7fd7e0cd881e4d;p=jalview.git JAL-4369 invokeAndWait to avoid hang whilst calling getFiles if a Jmol redraw is in progress --- diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 4a04b21..de8ca8e 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -1274,8 +1274,19 @@ public class Commands private void colourAlignFrame(AlignFrame af, ColourSchemeI cs) { - // Note that cs == null removes colour scheme from af - af.changeColour(cs); + try { + SwingUtilities.invokeAndWait(new Runnable() + { + @Override + public void run() + { + // Note that cs == null removes colour scheme from af + af.changeColour(cs); + } + }); } catch (Exception x) { + Console.trace("Interrupted whilst waiting for colorAlignFrame action",x); + + } } private ColourSchemeI getColourScheme(AlignFrame af)