Merge branch 'improvement/JAL-3783_upgrade_to_groovy-4' into jims/bug/JAL-4298_java_c...
authorJames Procter <j.procter@dundee.ac.uk>
Fri, 20 Oct 2023 16:00:05 +0000 (17:00 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Fri, 20 Oct 2023 16:00:05 +0000 (17:00 +0100)
help/help/html/features/viewingpdbs.html
help/markdown/releases/release-2_11_3_0.md
src/jalview/analysis/TreeModel.java
src/jalview/bin/Jalview.java
src/jalview/datamodel/ColumnSelection.java
src/jalview/ext/jmol/JalviewJmolBinding.java
src/jalview/gui/Console.java
src/jalview/gui/JvOptionPane.java
src/jalview/gui/SplashScreen.java
src/jalview/gui/TreeCanvas.java
src/jalview/structures/models/AAStructureBindingModel.java

index 947b96b..df76f89 100755 (executable)
@@ -87,7 +87,7 @@
     <strong>Structure Viewers in the Jalview Desktop</strong><br /> The
     <a href="jmol.html">Jmol viewer</a> has been included since Jalview
     2.3. Jalview 2.8.2 included support for <a href="chimera.html">Chimera</a>,
-    provided it is installed and can be launched by Jalview. ChimeraX and PyMOL
+    provided it is installed and can be launched by Jalview. ChimeraX and <a href="pymol.html">PyMOL</a>
     support is included from Jalview 2.11.2. The default
     viewer can be configured in the <a href="preferences.html#structure">Structure
       tab</a> in the <strong>Tools&rarr;Preferences</strong> dialog box.
     un-tick the <strong>Superpose Structures</strong> checkbox.
 
   </p>
-  <p>
-    <em>Superposing structures</em><br/>Jalview superposes structures using
-    the visible portions of any associated sequence alignments. A
-    message in the structure viewer's status bar will be shown if not
-    enough aligned columns were available to perform a superposition.
-  </p>
-  <p>
-  See the <a href="jmol.html">Jmol
-    </a> and <a href="chimera.html">Chimera</a> help pages for
-      more information about their capabilities.</p>
-  
-
-  <p>
+       <p>
+               <em>Superposing structures</em><br />Jalview superposes structures
+               using the currently selected columns (if more than 3 columns are
+               selected), or the visible portions of any associated sequence
+               alignments. Depending on the viewer, Root Mean Squared Deviation (RMS
+               or RMSD) for each pair of superpositions may be output in the
+               structure viewer's console.
+       </p>
+       <p>A message in the structure viewer's status bar will be shown if
+               not enough aligned columns were available to perform a superposition.
+       </p>
+       <p>
+               See the <a href="jmol.html">Jmol</a>, <a href="chimera.html">Chimera/X</a>
+               and <a href="pymol.html">Pymol</a> help pages for more information
+               about their individual capabilities.
+       </p>
+       <p>
     <strong>Retrieving sequences from the PDB</strong><br>You can
     retrieve sequences from the PDB using the <a
       href="pdbsequencefetcher.html">Sequence Fetcher</a>. The sequences
index 80f8cf4..8847eb2 100644 (file)
@@ -88,6 +88,8 @@ channel: "release"
 - <!-- JAL-2910 --> HeadlessException in console in headless mode (actually fixed in 2.11.{0,1,2))
 
 ## New Known defects
+- <!-- JAL-4303 --> EBI-AlphaFold PLDDT colours cannot be overlaid on alignment via 'Colour by annotation' unless the alignment's colourscheme has been set to 'None' via the Colours menu.
+- <!-- JAL-4302 --> Tree renderer doesn't show bottom-most leaves of tree when Fit-To-Window is enabled.
 - <!-- JAL-4178 --> Cannot cancel structure view open action once it has been started via the structure chooser dialog
 - <!-- JAL-4142 --> Example project's multiple views do not open in distinct locations when eXpand views is used to show them all separately
 - <!-- JAL-4127 --> 'Reload' for a jalview project results in all windows being duplicated
index 90fe089..ce79a65 100644 (file)
@@ -353,6 +353,7 @@ public class TreeModel
 
     if ((nd.left() == null) && (nd.right() == null))
     {
+       // TODO FIX FOR COLUMN TREES
       jalview.bin.Console.outPrintln("Leaf = " + ((SequenceI) nd.element()).getName());
       jalview.bin.Console.outPrintln("Dist " + nd.dist);
       jalview.bin.Console.outPrintln("Boot " + nd.getBootstrap());
@@ -430,7 +431,7 @@ public class TreeModel
 
     if ((nd.left() == null) && (nd.right() == null))
     {
-      nd.height = ((BinaryNode) nd.parent()).height + nd.dist;
+      nd.height = nd.parent().height + nd.dist;
 
       if (nd.height > maxheight)
       {
@@ -445,7 +446,7 @@ public class TreeModel
     {
       if (nd.parent() != null)
       {
-        nd.height = ((BinaryNode) nd.parent()).height + nd.dist;
+        nd.height = nd.parent().height + nd.dist;
       }
       else
       {
index 83efe7d..e343b0f 100755 (executable)
@@ -449,7 +449,7 @@ public class Jalview implements JalviewObjectI
       }
       else if (bootstrapArgs.contains(Arg.DEBUG))
       {
-        logLevel = "DEBUG";
+        logLevel = bootstrapArgs.getBoolean(Arg.DEBUG) ? "DEBUG" : "INFO";
       }
       if (logLevel == null && !(bootstrapProperties == null))
       {
index 4a38ec0..b427739 100644 (file)
@@ -340,10 +340,12 @@ public class ColumnSelection
 
   /**
    * Returns a read-only view of the (possibly empty) list of selected columns
+   * (base 1)
    * <p>
-   * The list contains no duplicates but is not necessarily ordered. It also may
-   * include columns hidden from the current view. To modify (for example sort)
-   * the list, you should first make a copy.
+   * The list contains no duplicates but is not necessarily ordered. Columns are
+   * reported in alignment coordinates (base 1), so may also include columns
+   * hidden from the current view. To modify (for example sort) the list, you
+   * should first make a copy.
    * <p>
    * The list is not thread-safe: iterating over it could result in
    * ConcurrentModificationException if it is modified by another thread.
index 870db65..dc18369 100644 (file)
@@ -267,16 +267,30 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
   {
     if (atoms != null)
     {
-      boolean useScriptWait = atoms.size() > 1;
       if (resetLastRes.length() > 0)
       {
-        jmolScript(resetLastRes.toString(), useScriptWait);
+        jmolScript(resetLastRes.toString());
         resetLastRes.setLength(0);
       }
+      StringBuilder highlightCommands=null;
       for (AtomSpec atom : atoms)
       {
-        highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(),
-                atom.getChain(), atom.getPdbFile(), useScriptWait);
+        StringBuilder thisAtom = highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(),
+                atom.getChain(), atom.getPdbFile());
+        if (thisAtom!=null) {
+          if (highlightCommands==null)
+          {
+            highlightCommands=thisAtom;                  
+          } else {
+            highlightCommands.append(thisAtom);
+          }
+        }
+      }
+      if (highlightCommands!=null)
+      {
+        jmolHistory(false);
+        jmolScript(highlightCommands.toString());
+        jmolHistory(true);
       }
       // Highlight distances between atoms with a 'measure' command - not yet
       // working
@@ -306,17 +320,15 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
   }
 
   // jmol/ssm only
-  public void highlightAtom(int atomIndex, int pdbResNum, String chain,
-          String pdbfile, boolean useScriptWait)
+  private StringBuilder highlightAtom(int atomIndex, int pdbResNum, String chain,
+          String pdbfile)
   {
     String modelId = getModelIdForFile(pdbfile);
     if (modelId.isEmpty())
     {
-      return;
+      return null;
     }
 
-    jmolHistory(false, useScriptWait);
-
     StringBuilder selection = new StringBuilder(32);
     StringBuilder cmd = new StringBuilder(64);
     selection.append("select ").append(String.valueOf(pdbResNum));
@@ -333,8 +345,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
     resetLastRes.append(selection).append(";wireframe 0;").append(selection)
             .append(" and not hetero; spacefill 0;");
 
-    jmolScript(cmd.toString(), useScriptWait);
-    jmolHistory(true, useScriptWait);
+    return cmd;
   }
 
   private boolean debug = true;
index bf3942a..b8aad21 100644 (file)
@@ -217,30 +217,14 @@ public class Console extends WindowAdapter
     // logLevelCombo.addItem(LogLevel.ERROR);
     // logLevelCombo.addItem(LogLevel.OFF);
     // set startingLogLevel
-    if (jalview.bin.Console.log == null)
+    
+    if (jalview.bin.Console.getLogger() == null)
     {
-      try
-      {
-        startingLogLevel = LogLevel
-                .valueOf(Cache.getDefault(Cache.JALVIEWLOGLEVEL, null));
-      } catch (IllegalArgumentException e1)
-      {
-        jalview.bin.Console.debug(
-                "Invalid value for preference " + Cache.JALVIEWLOGLEVEL);
-      } catch (NullPointerException e2)
-      {
-        // no value in preferences
-      } finally
-      {
-        if (startingLogLevel == null)
-        {
-          startingLogLevel = LogLevel.INFO;
-        }
-      }
+      startingLogLevel = jalview.bin.Console.getCachedLogLevel();
     }
     else
     {
-      startingLogLevel = jalview.bin.Console.log.getLevel();
+      startingLogLevel = jalview.bin.Console.getLogger().getLevel();
     }
     setChosenLogLevelCombo();
     logLevelCombo.addActionListener(new ActionListener()
@@ -637,7 +621,7 @@ public class Console extends WindowAdapter
         {
           try
           {
-            this.wait(100);
+            this.wait(100); // ##### implicated BLOCKED
             if (pin.available() == 0)
             {
               trimBuffer(false);
@@ -670,7 +654,7 @@ public class Console extends WindowAdapter
         {
           try
           {
-            this.wait(100);
+            this.wait(100); // ##### implicated BLOCKED
             if (pin2.available() == 0)
             {
               trimBuffer(false);
@@ -713,12 +697,16 @@ public class Console extends WindowAdapter
               displayPipe = tmp;
             }
             // simply append whole buffer
-            textArea.append(replace.toString());
-            count += replace.length();
-            if (count > byteslim)
+            synchronized (textArea.getDocument())
             {
-              trimBuffer(false);
+              textArea.append(replace.toString()); // ##### implicated BLOCKED
+              count += replace.length();
+              if (count > byteslim)
+              {
+                trimBuffer(false);
+              }
             }
+
           }
           if (displayPipe.length() == 0)
           {
index 8edab03..7a5daf7 100644 (file)
@@ -1334,6 +1334,7 @@ public class JvOptionPane extends JOptionPane
 
     // A better hack which works is to create a new JFrame parent with
     // setAlwaysOnTop(true)
+    boolean parentOnTop = dialogParent.isAlwaysOnTop();
     dialogParent.setAlwaysOnTop(true);
     parentComponent = dialogParent;
 
@@ -1341,6 +1342,8 @@ public class JvOptionPane extends JOptionPane
             JOPTIONPANE_MESSAGETYPE, icon, options, initialValue, modal,
             buttons);
 
+    dialogParent.setAlwaysOnTop(parentOnTop);
+
     if (dispose)
     {
       dialogParent.setAlwaysOnTop(false);
index 52c1d18..1060d8a 100755 (executable)
@@ -342,7 +342,7 @@ public class SplashScreen extends JPanel
     try
     {
 
-      iframe.setClosed(true);
+      iframe.setClosed(true); // ##### implicated BLOCKED
     } catch (Exception ex)
     {
     }
index 6fbd422..2d4bdc8 100755 (executable)
@@ -406,9 +406,9 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
       }
 
       int ystart = (node.left() == null ? 0
-              : (int) (((BinaryNode) node.left()).ycount * chunk)) + offy;
+              : (int) (node.left().ycount * chunk)) + offy;
       int yend = (node.right() == null ? 0
-              : (int) (((BinaryNode) node.right()).ycount * chunk)) + offy;
+              : (int) (node.right().ycount * chunk)) + offy;
 
       Rectangle pos = new Rectangle(xend - 2, ypos - 2, 5, 5);
       nodeHash.put(node, pos);
@@ -791,11 +791,11 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
     if (top.count == 0)
     {
-      top.count = ((BinaryNode) top.left()).count
-              + ((BinaryNode) top.right()).count;
+      top.count = top.left().count
+              + top.right().count;
     }
 
-    double chunk = (double) (height - (offy)) / (double)top.count;
+    float chunk = (float) (height - (offy)) / top.count;
 
     drawNode(g2, tree.getTopNode(), chunk, wscale, width, offx, offy);
 
index 4b11494..dcedafa 100644 (file)
@@ -884,14 +884,7 @@ public abstract class AAStructureBindingModel
       {
         for (int s : cs.getSelected())
         {
-          if (hiddenCols == null)
-          {
             matched.set(s);
-          }
-          else
-          {
-            matched.set(hiddenCols.visibleToAbsoluteColumn(s));
-          }
         }
       }
       else