Merge branch 'features/r2_11_2_alphafold/JAL-2349_JAL-3855' into bug/JAL-4083_excepti...
authorJim Procter <j.procter@dundee.ac.uk>
Fri, 28 Oct 2022 12:21:41 +0000 (13:21 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Fri, 28 Oct 2022 12:21:41 +0000 (13:21 +0100)
src/jalview/bin/Jalview.java
src/jalview/ext/jmol/JalviewJmolBinding.java
test/jalview/bin/CommandLineOperations.java

index d1056bf..1428906 100755 (executable)
@@ -1146,12 +1146,16 @@ public class Jalview
     System.setProperty("com.apple.mrj.application.apple.menu.about.name",
             ChannelProperties.getProperty("app_name"));
     System.setProperty("apple.laf.useScreenMenuBar", "true");
+    /*
+     * broken native LAFs on (ARM?) macbooks
     set = setQuaquaLookAndFeel();
     if ((!set) || !UIManager.getLookAndFeel().getClass().toString()
             .toLowerCase(Locale.ROOT).contains("quaqua"))
     {
       set = setVaquaLookAndFeel();
     }
+     */
+    set = setFlatLookAndFeel();
     return set;
   }
 
index 895db9a..9436209 100644 (file)
@@ -122,8 +122,21 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
 
   private String jmolScript(String script)
   {
+    return jmolScript(script, false);
+  }
+
+  private String jmolScript(String script, boolean useScriptWait)
+  {
     Console.debug(">>Jmol>> " + script);
-    String s = jmolViewer.evalStringQuiet(script); // scriptWait(script); BH
+    String s;
+    if (useScriptWait)
+    {
+      s = jmolViewer.scriptWait(script);
+    }
+    else
+    {
+      s = jmolViewer.evalStringQuiet(script); // scriptWait(script); BH
+    }
     Console.debug("<<Jmol<< " + s);
 
     return s;
@@ -254,22 +267,23 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
   {
     if (atoms != null)
     {
+      boolean useScriptWait = atoms.size() > 1;
       if (resetLastRes.length() > 0)
       {
-        jmolScript(resetLastRes.toString());
+        jmolScript(resetLastRes.toString(), useScriptWait);
         resetLastRes.setLength(0);
       }
       for (AtomSpec atom : atoms)
       {
         highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(),
-                atom.getChain(), atom.getPdbFile());
+                atom.getChain(), atom.getPdbFile(), useScriptWait);
       }
     }
   }
 
   // jmol/ssm only
   public void highlightAtom(int atomIndex, int pdbResNum, String chain,
-          String pdbfile)
+          String pdbfile, boolean useScriptWait)
   {
     String modelId = getModelIdForFile(pdbfile);
     if (modelId.isEmpty())
@@ -277,7 +291,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
       return;
     }
 
-    jmolHistory(false);
+    jmolHistory(false, useScriptWait);
 
     StringBuilder selection = new StringBuilder(32);
     StringBuilder cmd = new StringBuilder(64);
@@ -295,15 +309,21 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
     resetLastRes.append(selection).append(";wireframe 0;").append(selection)
             .append(" and not hetero; spacefill 0;");
 
-    jmolScript(cmd.toString());
-    jmolHistory(true);
+    jmolScript(cmd.toString(), useScriptWait);
+    jmolHistory(true, useScriptWait);
   }
 
   private boolean debug = true;
 
   private void jmolHistory(boolean enable)
   {
-    jmolScript("History " + ((debug || enable) ? "on" : "off"));
+    jmolHistory(enable, false);
+  }
+
+  private void jmolHistory(boolean enable, boolean useScriptWait)
+  {
+    jmolScript("History " + ((debug || enable) ? "on" : "off"),
+            useScriptWait);
   }
 
   public void loadInline(String string)
index 3bfd4f3..7e775d8 100644 (file)
@@ -250,7 +250,7 @@ public class CommandLineOperations
 
     // number of lines expected on STDERR when Jalview starts up normally
     // may need to adjust this if Jalview is excessively noisy ?
-    final int STDERR_SETUPLINES = 30;
+    final int STDERR_SETUPLINES = 50;
 
     // thread monitors stderr - bails after SETUP_TIMEOUT or when
     // STDERR_SETUPLINES have been read