Merge branch 'develop' into trialMerge
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index e0a607b..74fd422 100755 (executable)
@@ -194,10 +194,9 @@ public class AppletFormatAdapter
     this.inFile = file;
     try
     {
-      if (fileFormat == FileFormat.PDB || fileFormat == FileFormat.MMCif)
+      if (FileFormat.PDB.equals(fileFormat)
+              || FileFormat.MMCif.equals(fileFormat))
       {
-        // 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
@@ -206,9 +205,7 @@ public class AppletFormatAdapter
         {
           StructureImportSettings.addSettings(annotFromStructure,
                   localSecondaryStruct, serviceSecondaryStruct);
-          alignFile = new JmolParser(annotFromStructure,
-                  localSecondaryStruct, serviceSecondaryStruct, inFile,
-                  sourceType);
+          alignFile = new JmolParser(inFile,                  sourceType);
         }
         else
         {
@@ -219,9 +216,8 @@ public class AppletFormatAdapter
                   localSecondaryStruct, serviceSecondaryStruct, inFile,
                   sourceType);
         }
-        ((StructureFile) alignFile)
-                .setDbRefType(fileFormat == FileFormat.PDB ? Type.PDB
-                        : Type.MMCIF);
+        ((StructureFile) alignFile).setDbRefType(FileFormat.PDB
+                .equals(fileFormat) ? Type.PDB : Type.MMCIF);
       }
       else
       {
@@ -276,7 +272,7 @@ public class AppletFormatAdapter
           ex.printStackTrace();
         }
       }
-      if (fileFormat == FileFormat.Html)
+      if (FileFormat.Html.equals(fileFormat))
       {
         throw new IOException(e.getMessage());
       }
@@ -301,7 +297,7 @@ public class AppletFormatAdapter
     DataSourceType type = source.dataSourceType;
     try
     {
-      if (format == FileFormat.PDB || format == FileFormat.MMCif)
+      if (FileFormat.PDB.equals(format) || FileFormat.MMCif.equals(format))
       {
         // TODO obtain config value from preference settings
         boolean isParseWithJMOL = false;
@@ -309,8 +305,7 @@ public class AppletFormatAdapter
         {
           StructureImportSettings.addSettings(annotFromStructure,
                   localSecondaryStruct, serviceSecondaryStruct);
-          alignFile = new JmolParser(annotFromStructure,
-                  localSecondaryStruct, serviceSecondaryStruct, source);
+          alignFile = new JmolParser(source);
         }
         else
         {
@@ -435,7 +430,7 @@ public class AppletFormatAdapter
   {
     try
     {
-      AlignmentFileI afile = format.getAlignmentFile();
+      AlignmentFileI afile = format.getAlignmentFile(alignment);
 
       afile.setNewlineString(newline);
       afile.setExportSettings(exportSettings);