JAL-3400 include sequence name in View | Show Chain menu
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index 8eea16f..b55885d 100644 (file)
@@ -108,11 +108,13 @@ public abstract class AAStructureBindingModel
    * a list of chains "pdbid:chainid" to show in the viewer;
    * empty means show all
    */
-  // TODO make private once showStructures() deals with this
+  // TODO make private once deprecated JalviewJmolBinding.centerViewer removed
   protected List<String> chainsToShow;
 
   private boolean hideHiddenRegions;
 
+  protected List<String> chainNames = new ArrayList<>();
+
   /**
    * Data bean class to simplify parameterisation in superposeStructures
    */
@@ -754,13 +756,6 @@ public abstract class AAStructureBindingModel
   }
 
   /**
-   * Returns a list of chains mapped in this viewer.
-   * 
-   * @return
-   */
-  public abstract List<String> getChainNames();
-
-  /**
    * Returns the Jalview panel hosting the structure viewer (if any)
    * 
    * @return
@@ -1072,7 +1067,7 @@ public abstract class AAStructureBindingModel
    * @param viewPanel
    * @return
    */
-  protected Map<Object, AtomSpecModel> buildColoursMap(
+  public Map<Object, AtomSpecModel> buildColoursMap(
           AlignmentViewPanel viewPanel)
   {
     FeatureRenderer fr = viewPanel.getFeatureRenderer();
@@ -1151,7 +1146,7 @@ public abstract class AAStructureBindingModel
               {
                 if (startPos != -1)
                 {
-                  ChimeraCommands.addMapRange(colourMap, lastColour,
+                  ChimeraCommands.addAtomSpecRange(colourMap, lastColour,
                           pdbfnum, startPos,
                           lastPos, lastChain);
                 }
@@ -1164,7 +1159,8 @@ public abstract class AAStructureBindingModel
             // final colour range
             if (lastColour != null)
             {
-              ChimeraCommands.addMapRange(colourMap, lastColour, pdbfnum,
+              ChimeraCommands.addAtomSpecRange(colourMap, lastColour,
+                      pdbfnum,
                       startPos, lastPos, lastChain);
             }
             // break;
@@ -1174,4 +1170,15 @@ public abstract class AAStructureBindingModel
     }
     return colourMap;
   }
+
+  /**
+   * Returns a list of chains mapped in this viewer. Note this list is not
+   * currently scoped per structure.
+   * 
+   * @return
+   */
+  public List<String> getChainNames()
+  {
+    return chainNames;
+  }
 }