JAL-3390 first pass refactoring for JalviewJmolBinding.showStructures
[jalview.git] / src / jalview / ext / rbvi / chimera / JalviewChimeraBinding.java
index 44bcbe4..381bbea 100644 (file)
@@ -650,32 +650,32 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
   /**
    * Sends a set of colour commands to the structure viewer
    * 
-   * @param colourBySequenceCommands
+   * @param commands
    */
   @Override
-  protected void colourBySequence(
-          StructureMappingcommandSet[] colourBySequenceCommands)
+  protected void colourBySequence(String[] commands)
   {
-    for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands)
+    for (String command : commands)
     {
-      for (String command : cpdbbyseq.commands)
-      {
-        sendAsynchronousCommand(command, COLOURING_CHIMERA);
-      }
+      sendAsynchronousCommand(command, COLOURING_CHIMERA);
     }
   }
 
   /**
+   * Computes and returns a set of commands to colour residues in Chimera the same
+   * as mapped residues in the alignment
+   * 
    * @param files
    * @param viewPanel
    * @return
    */
   @Override
-  protected StructureMappingcommandSet[] getColourBySequenceCommands(
+  protected String[] getColourBySequenceCommands(
           String[] files, AlignmentViewPanel viewPanel)
   {
-    return ChimeraCommands.getColourBySequenceCommand(files, viewPanel,
-            this);
+    Map<Object, AtomSpecModel> colourMap = buildColoursMap(viewPanel);
+
+    return ChimeraCommands.getColourBySequenceCommand(colourMap, this);
   }
 
   /**