JAL-4366 revive broken alignDNAasDNA test
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index dcedafa..4f29096 100644 (file)
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -884,7 +885,7 @@ public abstract class AAStructureBindingModel
       {
         for (int s : cs.getSelected())
         {
-            matched.set(s);
+          matched.set(s);
         }
       }
       else
@@ -1427,7 +1428,7 @@ public abstract class AAStructureBindingModel
               lastChain = chain;
             }
             // final colour range
-            if (lastColour != null)
+            if (lastColour != null && startPos!=-1)
             {
               addAtomSpecRange(colourMap, lastColour, modelId, startPos,
                       lastPos, lastChain);
@@ -1539,7 +1540,6 @@ public abstract class AAStructureBindingModel
     return f;
   }
 
-
   /**
    * Use restoreSession when you want to restore a previously saved sesssion to
    * the running viewer instance.
@@ -1549,7 +1549,8 @@ public abstract class AAStructureBindingModel
   public void restoreSession(String absolutePath)
   {
     String prefix = getViewerType().toString();
-    try {
+    try
+    {
 
       StructureCommandI cmd = commandGenerator.restoreSession(absolutePath);
       if (cmd != null)
@@ -2006,4 +2007,27 @@ public abstract class AAStructureBindingModel
   {
     return 0;
   }
+
+  /**
+   * list the ligands available for display/hiding in the current view
+   * 
+   * @return HETATM CODE:Molecule name
+   */
+  public Map<String, String> getHetatmNames()
+  {
+    return Collections.EMPTY_MAP;
+  }
+
+  /**
+   * Generates and executes a command to show the given hetatm types as CPK
+   * 
+   * @param toShow
+   *          - one or more of strings from getHetatmNames
+   */
+  public void showHetatms(List<String> toShow)
+  {
+    executeCommands(commandGenerator.showHetatms(toShow), false,
+            "Adjusting hetatm visibility");
+  }
+
 }