JAL-1761 pattern for structure viewer construction from project file
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index 8aa1895..870a761 100644 (file)
@@ -1697,6 +1697,25 @@ public abstract class AAStructureBindingModel
   }
 
   /**
+   * Ask the structure viewer to open a session file. Returns true if
+   * successful, else false (or not supported).
+   * 
+   * @param filepath
+   * @return
+   */
+  public boolean openSession(String filepath)
+  {
+    StructureCommandI cmd = getCommandGenerator().openSession(filepath);
+    if (cmd == null)
+    {
+      return false;
+    }
+    executeCommand(cmd, true);
+    // todo: test for failure - how?
+    return true;
+  }
+
+  /**
    * Scans visible features in mapped positions of the CDS/peptide complement, and
    * adds any found to the map of attribute values/structure positions
    *