JAL-2089 patch broken merge to master for Release 2.10.0b1
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index 552f00e..9695891 100755 (executable)
@@ -278,11 +278,36 @@ public class AppletFormatAdapter
         alignFile = new JPredFile(inFile, type);
         ((JPredFile) alignFile).removeNonSequences();
       }
-      else if (format.equals("PDB") || format.equalsIgnoreCase("mmCIF"))
+      else if (format.equals("PDB"))
+      {
+        // TODO obtain config value from preference settings.
+        // Set value to 'true' to test PDB processing with Jmol: JAL-1213
+        boolean isParseWithJMOL = StructureImportSettings
+                .getDefaultPDBFileParser().equalsIgnoreCase(
+                        StructureImportSettings.StructureParser.JMOL_PARSER
+                                .toString());
+        if (isParseWithJMOL)
+        {
+          StructureImportSettings.addSettings(annotFromStructure,
+                  localSecondaryStruct, serviceSecondaryStruct);
+          alignFile = new jalview.ext.jmol.JmolParser(inFile, type);
+        }
+        else
+        {
+          StructureImportSettings.addSettings(annotFromStructure,
+                  localSecondaryStruct, serviceSecondaryStruct);
+          StructureImportSettings.setShowSeqFeatures(true);
+          alignFile = new MCview.PDBfile(annotFromStructure,
+                  localSecondaryStruct, serviceSecondaryStruct, inFile,
+                  type);
+        }
+        ((StructureFile) alignFile).setDbRefType(format);
+      }
+      else if (format.equalsIgnoreCase("mmCIF"))
       {
         StructureImportSettings.addSettings(annotFromStructure,
                 localSecondaryStruct, serviceSecondaryStruct);
-        alignFile = new JmolParser(inFile, type);
+        alignFile = new jalview.ext.jmol.JmolParser(inFile, type);
         ((StructureFile) alignFile).setDbRefType(format);
       }
       else if (format.equals("STH"))