Merge branch 'releases/Release_2_10_0_Branch'
[jalview.git] / src / jalview / ext / jmol / JmolParser.java
index 1800ef0..b2ba256 100644 (file)
@@ -124,12 +124,11 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       try
       {
         /*
-         * params -o (output to sysout) -i (no info logging, less verbose)
-         * -n (nodisplay) -x (exit when finished)
+         * params -o (output to sysout) -n (nodisplay) -x (exit when finished)
          * see http://wiki.jmol.org/index.php/Jmol_Application
          */
         viewer = (Viewer) JmolViewer.allocateViewer(null, null, null, null,
-                null, "-x -o -n -i", this);
+                null, "-x -o -n", this);
         // ensure the 'new' (DSSP) not 'old' (Ramachandran) SS method is used
         viewer.setBooleanProperty("defaultStructureDSSP", true);
       } catch (ClassCastException x)
@@ -151,7 +150,17 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       List<SequenceI> prot = new ArrayList<SequenceI>();
       PDBChain tmpchain;
       String pdbId = (String) ms.getInfo(0, "title");
-      setId(pdbId);
+
+      if (pdbId == null)
+      {
+        setId(safeName(getDataName()));
+        setPDBIdAvailable(false);
+      }
+      else
+      {
+        setId(pdbId);
+        setPDBIdAvailable(true);
+      }
       List<Atom> significantAtoms = convertSignificantAtoms(ms);
       for (Atom tmpatom : significantAtoms)
       {
@@ -166,7 +175,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener
           tmpchain.atoms.addElement(tmpatom);
         } catch (Exception e)
         {
-          tmpchain = new PDBChain(pdbId, tmpatom.chain);
+          tmpchain = new PDBChain(getId(), tmpatom.chain);
           getChains().add(tmpchain);
           tmpchain.atoms.addElement(tmpatom);
         }
@@ -177,10 +186,6 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       makeResidueList();
       makeCaBondList();
 
-      if (getId() == null)
-      {
-        setId(safeName(getDataName()));
-      }
       for (PDBChain chain : getChains())
       {
         SequenceI chainseq = postProcessChain(chain);