From 3ea56b3730e5115138af264f5b5408104ebd9c20 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Fri, 23 Sep 2016 16:22:06 +0100 Subject: [PATCH] JAL-2164 JAL-1919 fixed failed revert commit --- src/jalview/bin/Cache.java | 5 +++-- src/jalview/io/AppletFormatAdapter.java | 29 +++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 31dbeac..00c8b86 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -444,8 +444,9 @@ public class Cache .println("Jalview Version: " + codeVersion + codeInstallation); StructureImportSettings.setDefaultStructureFileFormat(jalview.bin.Cache - .getDefault( -"PDB_DOWNLOAD_FORMAT", PDB_DOWNLOAD_FORMAT)); + .getDefault("PDB_DOWNLOAD_FORMAT", PDB_DOWNLOAD_FORMAT)); + StructureImportSettings + .setDefaultPDBFileParser(DEFAULT_PDB_FILE_PARSER); // StructureImportSettings // .setDefaultPDBFileParser(jalview.bin.Cache.getDefault( // "DEFAULT_PDB_FILE_PARSER", DEFAULT_PDB_FILE_PARSER)); diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 552f00e..9695891 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -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")) -- 1.7.10.2