JAL-2089 patch broken merge to master for Release 2.10.0b1
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index fb414f4..9695891 100755 (executable)
@@ -26,6 +26,8 @@ import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentView;
+import jalview.datamodel.PDBEntry.Type;
+import jalview.ext.jmol.JmolParser;
 import jalview.structure.StructureImportSettings;
 import jalview.util.MessageManager;
 
@@ -280,15 +282,15 @@ 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.StructureParser.JMOL_PARSER
+                                .toString());
         if (isParseWithJMOL)
         {
           StructureImportSettings.addSettings(annotFromStructure,
                   localSecondaryStruct, serviceSecondaryStruct);
-          alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
-                  localSecondaryStruct, serviceSecondaryStruct, inFile,
-                  type);
+          alignFile = new jalview.ext.jmol.JmolParser(inFile, type);
         }
         else
         {
@@ -299,13 +301,14 @@ public class AppletFormatAdapter
                   localSecondaryStruct, serviceSecondaryStruct, inFile,
                   type);
         }
+        ((StructureFile) alignFile).setDbRefType(format);
       }
-      else if (format.equals("mmCIF"))
+      else if (format.equalsIgnoreCase("mmCIF"))
       {
         StructureImportSettings.addSettings(annotFromStructure,
                 localSecondaryStruct, serviceSecondaryStruct);
-        alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
-                localSecondaryStruct, serviceSecondaryStruct, inFile, type);
+        alignFile = new jalview.ext.jmol.JmolParser(inFile, type);
+        ((StructureFile) alignFile).setDbRefType(format);
       }
       else if (format.equals("STH"))
       {
@@ -438,8 +441,7 @@ public class AppletFormatAdapter
         {
           StructureImportSettings.addSettings(annotFromStructure,
                   localSecondaryStruct, serviceSecondaryStruct);
-          alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
-                  localSecondaryStruct, serviceSecondaryStruct, source);
+          alignFile = new JmolParser(source);
         }
         else
         {
@@ -447,13 +449,14 @@ public class AppletFormatAdapter
           alignFile = new MCview.PDBfile(annotFromStructure,
                   localSecondaryStruct, serviceSecondaryStruct, source);
         }
+        ((StructureFile) alignFile).setDbRefType(Type.PDB);
       }
-      else if (format.equals("mmCIF"))
+      else if (format.equalsIgnoreCase("mmCIF"))
       {
         StructureImportSettings.addSettings(annotFromStructure,
                 localSecondaryStruct, serviceSecondaryStruct);
-        alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
-                localSecondaryStruct, serviceSecondaryStruct, source);
+        alignFile = new JmolParser(source);
+        ((StructureFile) alignFile).setDbRefType(Type.MMCIF);
       }
       else if (format.equals("STH"))
       {