Merge branch 'releases/Release_2_11_3_Branch'
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index 6385551..dc3cc1e 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,14 +885,7 @@ public abstract class AAStructureBindingModel
       {
         for (int s : cs.getSelected())
         {
-          if (hiddenCols == null)
-          {
-            matched.set(s);
-          }
-          else
-          {
-            matched.set(hiddenCols.visibleToAbsoluteColumn(s));
-          }
+          matched.set(s);
         }
       }
       else
@@ -1547,6 +1541,31 @@ public abstract class AAStructureBindingModel
   }
 
   /**
+   * Use restoreSession when you want to restore a previously saved sesssion to
+   * the running viewer instance.
+   * 
+   * @param absolutePath
+   */
+  public void restoreSession(String absolutePath)
+  {
+    String prefix = getViewerType().toString();
+    try
+    {
+
+      StructureCommandI cmd = commandGenerator.restoreSession(absolutePath);
+      if (cmd != null)
+      {
+        executeCommand(cmd, false);
+      }
+    } catch (Throwable e)
+    {
+      Console.error(String.format("Error restoring %s session: %s", prefix,
+              e.toString()));
+    }
+
+  }
+
+  /**
    * Saves the structure viewer session to the given file
    * 
    * @param f
@@ -1988,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");
+  }
+
 }