Merge branch 'develop' of https://source.jalview.org/git/jalview.git into develop
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 29 Jun 2020 10:55:14 +0000 (11:55 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 29 Jun 2020 10:55:14 +0000 (11:55 +0100)
src/ext/edu/ucsf/rbvi/strucviz2/ChimeraManager.java
src/jalview/bin/Cache.java
src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java
src/jalview/gui/IdCanvas.java

index ea48cb6..375fa4a 100644 (file)
@@ -814,7 +814,9 @@ public class ChimeraManager
    */
   public List<String> sendChimeraCommand(String command, boolean reply)
   {
-    System.out.println("chimeradebug>> " + command);
+    if (debug) {
+      System.out.println("chimeradebug>> " + command);
+    }
     if (!isChimeraLaunched() || command == null
             || "".equals(command.trim()))
     {
index 788cb02..85d23df 100755 (executable)
@@ -313,6 +313,9 @@ public class Cache
       // lcastor = Logger.getLogger("org.exolab.castor.xml.Marshaller");
       // lcastor.setLevel(Level.toLevel(Cache.getDefault("logs.Castor.Level",
       // Level.INFO.toString())));
+      // we shouldn't need to do this
+      org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.INFO); 
+
       jalview.bin.Cache.log.setLevel(Level.toLevel(Cache
               .getDefault("logs.Jalview.level", Level.INFO.toString())));
       // laxis.addAppender(ap);
index 487e93b..549636b 100644 (file)
@@ -339,8 +339,10 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
     if (getResponse)
     {
       reply = lastReply;
-      Cache.log.debug(
-              "Response from command ('" + cmd + "') was:\n" + lastReply);
+      if (Cache.log.isDebugEnabled()) {
+        Cache.log.debug(
+              "Response from command ('" + cmd + "') was:\n" + lastReply); 
+      }
     }
 
     return reply;
@@ -442,40 +444,51 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
      * Ask Chimera for its current selection
      */
     StructureCommandI command = getCommandGenerator().getSelectedResidues();
-    List<String> chimeraReply = executeCommand(command, true);
-    List<String> selectedResidues = new ArrayList<>();
-    if (chimeraReply != null)
+    
+    Runnable action = new Runnable()
     {
-      /*
-       * expect 0, 1 or more lines of the format either
-       * Chimera:
-       * residue id #0:43.A type GLY
-       * ChimeraX:
-       * residue id /A:89 name THR index 88
-       * We are only interested in the atomspec (third token of the reply)
-       */
-      for (String inputLine : chimeraReply)
+      @Override
+      public void run()
       {
-        String[] inputLineParts = inputLine.split("\\s+");
-        if (inputLineParts.length >= 5)
+        List<String> chimeraReply = executeCommand(command, true);
+        
+        List<String> selectedResidues = new ArrayList<>();
+        if (chimeraReply != null)
         {
-          selectedResidues.add(inputLineParts[2]);
+          /*
+           * expect 0, 1 or more lines of the format either
+           * Chimera:
+           * residue id #0:43.A type GLY
+           * ChimeraX:
+           * residue id /A:89 name THR index 88
+           * We are only interested in the atomspec (third token of the reply)
+           */
+          for (String inputLine : chimeraReply)
+          {
+            String[] inputLineParts = inputLine.split("\\s+");
+            if (inputLineParts.length >= 5)
+            {
+              selectedResidues.add(inputLineParts[2]);
+            }
+          }
         }
-      }
-    }
-
-    /*
-     * Parse model number, residue and chain for each selected position,
-     * formatted as #0:123.A or #1.2:87.B (#model.submodel:residue.chain)
-     */
-    List<AtomSpec> atomSpecs = convertStructureResiduesToAlignment(
-            selectedResidues);
 
-    /*
-     * Broadcast the selection (which may be empty, if the user just cleared all
-     * selections)
-     */
-    getSsm().mouseOverStructure(atomSpecs);
+        /*
+         * Parse model number, residue and chain for each selected position,
+         * formatted as #0:123.A or #1.2:87.B (#model.submodel:residue.chain)
+         */
+        List<AtomSpec> atomSpecs = convertStructureResiduesToAlignment(
+                selectedResidues);
+
+        /*
+         * Broadcast the selection (which may be empty, if the user just cleared all
+         * selections)
+         */
+        getSsm().mouseOverStructure(atomSpecs);
+        
+      }
+    };
+    new Thread(action).start();
   }
 
   /**
index 10c0787..1a8e79f 100755 (executable)
@@ -324,6 +324,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
       if (hasHiddenRows || alignViewport.isDisplayReferenceSeq())
       {
         g.setFont(getHiddenFont(sequence, alignViewport));
+        fm = g.getFontMetrics();
       }
 
       // Selected sequence colours