JAL-3551 pull up Close Viewer dialog to base class
[jalview.git] / src / jalview / ext / rbvi / chimera / JalviewChimeraBinding.java
index 476a933..98cc1ff 100644 (file)
@@ -38,7 +38,6 @@ import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
 import ext.edu.ucsf.rbvi.strucviz2.StructureManager.ModelType;
 import jalview.api.AlignmentViewPanel;
 import jalview.api.structures.JalviewStructureDisplayI;
-import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SearchResultMatchI;
@@ -245,9 +244,10 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
    * Close down the Jalview viewer and listener, and (optionally) the associated
    * Chimera window.
    */
+  @Override
   public void closeViewer(boolean closeChimera)
   {
-    getSsm().removeStructureViewerListener(this, this.getStructureFiles());
+    super.closeViewer(closeChimera);
     if (closeChimera)
     {
       chimeraManager.exitChimera();
@@ -263,7 +263,6 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
     {
       chimeraMonitor.interrupt();
     }
-    releaseUIResources();
   }
 
   /**
@@ -339,7 +338,8 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
    * 
    * @return
    */
-  public boolean isChimeraRunning()
+  @Override
+  public boolean isViewerRunning()
   {
     return chimeraManager.isChimeraLaunched();
   }
@@ -545,37 +545,6 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
   }
 
   /**
-   * Ask Chimera to save its session to the given file. Returns true if
-   * successful, else false.
-   * 
-   * @param filepath
-   * @return
-   */
-  public boolean saveSession(String filepath)
-  {
-    if (isChimeraRunning())
-    {
-      /*
-       * Chimera:  https://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/save.html
-       * ChimeraX: https://www.cgl.ucsf.edu/chimerax/docs/user/commands/save.html
-       */
-      String command = getCommandGenerator().saveSession(filepath)
-              .getCommand();
-      List<String> reply = chimeraManager.sendChimeraCommand(command, true);
-      if (reply.contains("Session written"))
-      {
-        return true;
-      }
-      else
-      {
-        Cache.log
-                .error("Error saving Chimera session: " + reply.toString());
-      }
-    }
-    return false;
-  }
-
-  /**
    * Ask Chimera to open a session file. Returns true if successful, else false.
    * The filename must have a .py (Chimera) or .cxs (ChimeraX) extension for
    * this command to work.