JAL-2465 bugfix and rerefactor renamed getPdbFile() method to getStructureFile()
[jalview.git] / src / jalview / ext / jmol / JmolParser.java
index 180da8f..d37975d 100644 (file)
@@ -24,6 +24,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
+import jalview.io.DataSourceType;
 import jalview.io.FileParse;
 import jalview.io.StructureFile;
 import jalview.schemes.ResidueProperties;
@@ -59,9 +60,10 @@ public class JmolParser extends StructureFile implements JmolStatusListener
 {
   Viewer viewer = null;
 
-  public JmolParser(String inFile, String type) throws IOException
+  public JmolParser(String inFile, DataSourceType sourceType)
+          throws IOException
   {
-    super(inFile, type);
+    super(inFile, sourceType);
   }
 
   public JmolParser(FileParse fp) throws IOException
@@ -184,6 +186,14 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       makeResidueList();
       makeCaBondList();
 
+      if (getId() == null)
+      {
+        // always use resource name, not the hardwired file
+        // Does the value of ID get used ? Behaviour needs to be
+        // documented and tested
+        setId(getDataName());
+      }
+
       for (PDBChain chain : getChains())
       {
         SequenceI chainseq = postProcessChain(chain);
@@ -470,7 +480,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener
    * Not implemented - returns null
    */
   @Override
-  public String print()
+  public String print(SequenceI[] seqs, boolean jvSuffix)
   {
     return null;
   }