From: Jim Procter Date: Mon, 23 Jan 2017 15:13:33 +0000 (+0000) Subject: Merge branch 'features/JAL-2040_JAL-2137_phyre2' into reviews/features/JAL-2136_phyre... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3877548f65e22f91bae557c3d9edb17d75fbf2c9;p=jalview.git Merge branch 'features/JAL-2040_JAL-2137_phyre2' into reviews/features/JAL-2136_phyre2_integration_withJims --- 3877548f65e22f91bae557c3d9edb17d75fbf2c9 diff --cc src/jalview/io/AnnotationFile.java index 82e71b5,eca27a7..2491464 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@@ -684,25 -689,45 +689,45 @@@ public class AnnotationFil } public boolean readAnnotationFile(AlignmentI al, ColumnSelection colSel, - String file, String protocol) + String file, DataSourceType sourceType) { + baseUri = ""; BufferedReader in = null; try { - if (protocol.equals(AppletFormatAdapter.FILE)) + if (sourceType == DataSourceType.FILE) { in = new BufferedReader(new FileReader(file)); + baseUri = new File(file).getParent(); + if (baseUri == null) + { + baseUri = ""; + } + else + { + baseUri += "/"; + } } - else if (protocol.equals(AppletFormatAdapter.URL)) + else if (sourceType == DataSourceType.URL) { URL url = new URL(file); in = new BufferedReader(new InputStreamReader(url.openStream())); + String bs = url.toExternalForm(); + baseUri = bs.substring(0, bs.indexOf(url.getHost()) + + url.getHost().length()); + baseUri += url.toURI().getPath(); + if (baseUri.lastIndexOf("/") > -1) + { + baseUri = baseUri.substring(0, baseUri.lastIndexOf("/")) + "/"; + } } - else if (protocol.equals(AppletFormatAdapter.PASTE)) + else if (sourceType == DataSourceType.PASTE) { in = new BufferedReader(new StringReader(file)); + // TODO - support mimencoded PDBs for a paste.. ? + baseUri = ""; } - else if (protocol.equals(AppletFormatAdapter.CLASSLOADER)) + else if (sourceType == DataSourceType.CLASSLOADER) { java.io.InputStream is = getClass().getResourceAsStream("/" + file); if (is != null) diff --cc src/jalview/structure/StructureSelectionManager.java index 066a6d1,c90b3c8..bda269c --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@@ -1376,15 -1355,9 +1376,19 @@@ public class StructureSelectionManage return seqmappings; } + public boolean isMappingForPhyre2Model() + { + return mappingForPhyre2Model; + } + + public void setMappingForPhyre2Model(boolean mappingForPhyre2Model) + { + this.mappingForPhyre2Model = mappingForPhyre2Model; + } + + public static StructureSelectionManager getStructureSelectionManager() + { + return instances.values().iterator().next(); + } }