JAL-2089 Merge branch releases/Release_2_10_Branch to master
[jalview.git] / src / jalview / ext / jmol / JalviewJmolBinding.java
index a1b6917..45e79b1 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
+ * Copyright (C) 2015 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -28,6 +28,7 @@ import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
 import jalview.io.AppletFormatAdapter;
+import jalview.io.StructureFile;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ResidueProperties;
 import jalview.structure.AtomSpec;
@@ -56,7 +57,6 @@ import org.jmol.api.JmolStatusListener;
 import org.jmol.api.JmolViewer;
 import org.jmol.c.CBK;
 import org.jmol.script.T;
-import org.jmol.viewer.JC;
 import org.jmol.viewer.Viewer;
 
 public abstract class JalviewJmolBinding extends AAStructureBindingModel
@@ -169,12 +169,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
 
   public void closeViewer()
   {
-    viewer.acm.setModeMouse(JC.MOUSE_NONE);
     // remove listeners for all structures in viewer
     getSsm().removeStructureViewerListener(this, this.getPdbFile());
-    // and shut down jmol
-    viewer.evalStringQuiet("zap");
-    viewer.setJmolStatusListener(null);
+    viewer.dispose();
     lastCommand = null;
     viewer = null;
     releaseUIResources();
@@ -452,12 +449,12 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
       }
       if (selectioncom.length() > 0)
       {
-        System.out.println("Select regions:\n" + selectioncom.toString());
+        // System.out.println("Select regions:\n" + selectioncom.toString());
         evalStateCommand("select *; cartoons off; backbone; select ("
                 + selectioncom.toString() + "); cartoons; ");
         // selcom.append("; ribbons; ");
         String cmdString = command.toString();
-        System.out.println("Superimpose command(s):\n" + cmdString);
+        // System.out.println("Superimpose command(s):\n" + cmdString);
 
         evalStateCommand(cmdString);
       }
@@ -468,7 +465,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
       {
         selectioncom.setLength(selectioncom.length() - 1);
       }
-      System.out.println("Select regions:\n" + selectioncom.toString());
+      // System.out.println("Select regions:\n" + selectioncom.toString());
       evalStateCommand("select *; cartoons off; backbone; select ("
               + selectioncom.toString() + "); cartoons; ");
       // evalStateCommand("select *; backbone; select "+selcom.toString()+"; cartoons; center "+selcom.toString());
@@ -1121,7 +1118,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
     {
       String fileName = modelfilenames[modelnum];
       boolean foundEntry = false;
-      MCview.PDBfile pdb = null;
+      StructureFile pdb = null;
       String pdbfile = null;
       // model was probably loaded inline - so check the pdb file hashcode
       if (loadedInline)
@@ -1144,7 +1141,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
           {
             pdb = getSsm().setMapping(getSequence()[pe], getChains()[pe],
                     pdbfile, AppletFormatAdapter.PASTE);
-            getPdbEntry(modelnum).setFile("INLINE" + pdb.id);
+            getPdbEntry(modelnum).setFile("INLINE" + pdb.getId());
             matches = true;
             foundEntry = true;
           }
@@ -1183,10 +1180,10 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
         if (matches)
         {
           // add an entry for every chain in the model
-          for (int i = 0; i < pdb.chains.size(); i++)
+          for (int i = 0; i < pdb.getChains().size(); i++)
           {
-            String chid = new String(pdb.id + ":"
-                    + pdb.chains.elementAt(i).id);
+            String chid = new String(pdb.getId() + ":"
+                    + pdb.getChains().elementAt(i).id);
             chainFile.put(chid, fileName);
             chainNames.addElement(chid);
           }