X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAppletFormatAdapter.java;h=55bb03db516eaea6fc82b00b16cd61739778ec2a;hb=ccc31f21ed36c2e43b5a1b450846284151c680bb;hp=65fd72faaa141889d093aa917d73a7b9819c6f07;hpb=4da7d6ec8ef5ff030c6d06d37a099da2d92d7246;p=jalview.git diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 65fd72f..55bb03d 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -26,7 +26,8 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.AlignmentView; -import jalview.structure.StructureViewSettings; +import jalview.datamodel.PDBEntry.Type; +import jalview.structure.StructureImportSettings; import jalview.util.MessageManager; import java.io.File; @@ -280,10 +281,13 @@ public class AppletFormatAdapter { // TODO obtain config value from preference settings. // Set value to 'true' to test PDB processing with Jmol: JAL-1213 - boolean isParseWithJMOL = false; + boolean isParseWithJMOL = StructureImportSettings + .getDefaultPDBFileParser().equalsIgnoreCase( + StructureImportSettings.StructureParser.JMOL_PARSER + .toString()); if (isParseWithJMOL) { - StructureViewSettings.addSettings(annotFromStructure, + StructureImportSettings.addSettings(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct); alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, inFile, @@ -291,18 +295,22 @@ public class AppletFormatAdapter } else { - StructureViewSettings.setShowSeqFeatures(true); + StructureImportSettings.addSettings(annotFromStructure, + localSecondaryStruct, serviceSecondaryStruct); + StructureImportSettings.setShowSeqFeatures(true); alignFile = new MCview.PDBfile(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, inFile, type); } + ((StructureFile) alignFile).setDbRefType(format); } - else if (format.equals("mmCIF")) + else if (format.equalsIgnoreCase("mmCIF")) { - StructureViewSettings.addSettings(annotFromStructure, + StructureImportSettings.addSettings(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct); alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, inFile, type); + ((StructureFile) alignFile).setDbRefType(format); } else if (format.equals("STH")) { @@ -330,7 +338,7 @@ public class AppletFormatAdapter } else if (format.equals(IdentifyFile.FeaturesFile)) { - alignFile = new FeaturesFile(inFile, type); + alignFile = new FeaturesFile(true, inFile, type); } return buildAlignmentFrom(alignFile); } catch (Exception e) @@ -433,24 +441,26 @@ public class AppletFormatAdapter boolean isParseWithJMOL = false; if (isParseWithJMOL) { - StructureViewSettings.addSettings(annotFromStructure, + StructureImportSettings.addSettings(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct); alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, source); } else { - StructureViewSettings.setShowSeqFeatures(true); + StructureImportSettings.setShowSeqFeatures(true); alignFile = new MCview.PDBfile(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, source); } + ((StructureFile) alignFile).setDbRefType(Type.PDB); } - else if (format.equals("mmCIF")) + else if (format.equalsIgnoreCase("mmCIF")) { - StructureViewSettings.addSettings(annotFromStructure, + StructureImportSettings.addSettings(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct); alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, source); + ((StructureFile) alignFile).setDbRefType(Type.MMCIF); } else if (format.equals("STH")) {