JAL-4369 invokeAndWait to avoid hang whilst calling getFiles if a Jmol redraw is...
authorJames Procter <j.procter@dundee.ac.uk>
Wed, 10 Jan 2024 15:51:52 +0000 (15:51 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Tue, 23 Jan 2024 14:13:04 +0000 (14:13 +0000)
src/jalview/bin/Commands.java

index c848908..8ba4194 100644 (file)
@@ -1275,8 +1275,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)