JAL-2422 'label' command to highlight ChimeraX residue on mouseover
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 13 Dec 2019 16:42:05 +0000 (16:42 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 13 Dec 2019 16:42:05 +0000 (16:42 +0000)
src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java

index c16ce13..01deea8 100644 (file)
@@ -788,6 +788,7 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
       return;
     }
 
+    boolean forChimeraX = viewer.isChimeraX();
     StringBuilder cmd = new StringBuilder(128);
     boolean first = true;
     boolean found = false;
@@ -802,18 +803,26 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
       {
         if (first)
         {
-          cmd.append("rlabel #").append(cms.get(0).getModelNumber())
-                  .append(":");
+          cmd.append(forChimeraX ? "label #" : "rlabel #");
         }
         else
         {
           cmd.append(",");
         }
         first = false;
-        cmd.append(pdbResNum);
-        if (!chain.equals(" "))
+        if (forChimeraX)
+        {
+          cmd.append(cms.get(0).getModelNumber())
+                  .append("/").append(chain).append(":").append(pdbResNum);
+        }
+        else
         {
-          cmd.append(".").append(chain);
+          cmd.append(cms.get(0).getModelNumber())
+                  .append(":").append(pdbResNum);
+          if (!chain.equals(" ") && !forChimeraX)
+          {
+            cmd.append(".").append(chain);
+          }
         }
         found = true;
       }