JAL-3404 explicit getModelForPdbFile lookup
[jalview.git] / src / jalview / ext / jmol / JmolCommands.java
index 512080a..a900701 100644 (file)
@@ -28,12 +28,11 @@ import jalview.datamodel.AlignmentI;
 import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.SequenceI;
 import jalview.ext.rbvi.chimera.AtomSpecModel;
-import jalview.ext.rbvi.chimera.StructureCommands;
 import jalview.renderer.seqfeatures.FeatureColourFinder;
 import jalview.structure.StructureMapping;
 import jalview.structure.StructureMappingcommandSet;
 import jalview.structure.StructureSelectionManager;
-import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.StructureCommands;
 
 import java.awt.Color;
 import java.util.ArrayList;
@@ -51,21 +50,18 @@ public class JmolCommands extends StructureCommands
   private static final String COMMA = ",";
 
   /**
-   * Jmol utility which constructs the commands to colour chains by the given
-   * alignment
-   * 
-   * @returns Object[] { Object[] { <model being coloured>,
+   * Get commands to colour structure by sequence
    * 
+   * @param ssm
+   * @param files
+   * @param sequence
+   * @param sr
+   * @param viewPanel
+   * @return
+   * @deprecated only called by applet code
+   * @see #getColourBySequenceCommand(Map)
    */
-  public static StructureMappingcommandSet[] getColourBySequenceCommand(
-          StructureSelectionManager ssm, String[] files,
-          AAStructureBindingModel binding, AlignmentViewPanel viewPanel)
-  {
-    SequenceRenderer sr = binding.getSequenceRenderer(viewPanel);
-    SequenceI[][] sequence = binding.getSequence();
-    return getColourBySequenceCommand(ssm, files, sequence, sr, viewPanel);
-  }
-
+  @Deprecated
   public static StructureMappingcommandSet[] getColourBySequenceCommand(
           StructureSelectionManager ssm, String[] files,
           SequenceI[][] sequence, SequenceRenderer sr,
@@ -238,7 +234,7 @@ public class JmolCommands extends StructureCommands
       StringBuilder cmd = new StringBuilder(128);
       Color c = (Color) o;
       String atomSpec = getAtomSpec(map.get(o));
-      cmd.append("select ").append(atomSpec).append(";color[")
+      cmd.append("color (").append(atomSpec).append(") [")
               .append(c.getRed()).append(COMMA).append(c.getGreen())
               .append(COMMA).append(c.getBlue()).append("];");
       cmds[i] = cmd.toString();
@@ -252,10 +248,13 @@ public class JmolCommands extends StructureCommands
    * Builds a Jmol syntax selection expression from the given model, for example
    * 
    * <pre>
-   * 61-64,70:A/1.1,12-25,41-44:B/1.1,12:A/2.1
+   * (61-64,70)&:A/1.1,(12-25,41-44)&:B/1.1,12:A/2.1
    * for model 1, chain A, residues 61-64 and 70, chain B residues 12-25 and 41-44, model 2 chain A residue 12
    * </pre>
    * 
+   * Note the brackets to group multiple residue ranges for the same chain
+   * (without bracketing, ranges would apply to all chains)
+   * 
    * @param atomSpecModel
    * @return
    */