JAL-1919 set default structure file format to mmCIF, refactored some StructureImportS...
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index fb414f4..fca7263 100755 (executable)
@@ -280,8 +280,9 @@ public class AppletFormatAdapter
       {
         // TODO obtain config value from preference settings.
         // Set value to 'true' to test PDB processing with Jmol: JAL-1213
-        boolean isParseWithJMOL = !StructureImportSettings
-                .getCurrentDefaultFormat().equalsIgnoreCase("PDB");
+        boolean isParseWithJMOL = StructureImportSettings
+                .getDefaultPDBFileParser().equalsIgnoreCase(
+                        StructureImportSettings.JMOL_PARSER);
         if (isParseWithJMOL)
         {
           StructureImportSettings.addSettings(annotFromStructure,
@@ -299,6 +300,7 @@ public class AppletFormatAdapter
                   localSecondaryStruct, serviceSecondaryStruct, inFile,
                   type);
         }
+        ((StructureFile) alignFile).setDbRefType(format);
       }
       else if (format.equals("mmCIF"))
       {
@@ -306,6 +308,7 @@ public class AppletFormatAdapter
                 localSecondaryStruct, serviceSecondaryStruct);
         alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
                 localSecondaryStruct, serviceSecondaryStruct, inFile, type);
+        ((StructureFile) alignFile).setDbRefType(format);
       }
       else if (format.equals("STH"))
       {
@@ -447,6 +450,8 @@ public class AppletFormatAdapter
           alignFile = new MCview.PDBfile(annotFromStructure,
                   localSecondaryStruct, serviceSecondaryStruct, source);
         }
+        ((StructureFile) alignFile)
+                .setDbRefType(StructureImportSettings.PDB);
       }
       else if (format.equals("mmCIF"))
       {
@@ -454,6 +459,8 @@ public class AppletFormatAdapter
                 localSecondaryStruct, serviceSecondaryStruct);
         alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
                 localSecondaryStruct, serviceSecondaryStruct, source);
+        ((StructureFile) alignFile)
+                .setDbRefType(StructureImportSettings.MMCIF);
       }
       else if (format.equals("STH"))
       {