Merge branch 'develop' into bug/JAL-1803_JAL-2157
[jalview.git] / src / jalview / ext / jmol / JmolParser.java
index 7c3ff42..7836d24 100644 (file)
@@ -22,6 +22,7 @@ package jalview.ext.jmol;
 
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
+import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
 import jalview.io.FileParse;
 import jalview.io.StructureFile;
@@ -97,6 +98,18 @@ public class JmolParser extends StructureFile implements JmolStatusListener
      */
     if (jmolModel.ms.mc > 0)
     {
+      // ideally we do this
+      // try
+      // {
+      // setStructureFileType(jmolModel.evalString("show _fileType"));
+      // } catch (Exception q)
+      // {
+      // }
+      // ;
+      // instead, we distinguish .cif from non-.cif by filename
+      setStructureFileType(getDataName().toLowerCase().endsWith(".cif") ? PDBEntry.Type.MMCIF
+              .toString() : "PDB");
+
       transformJmolModelToJalview(jmolModel.ms);
     }
   }