}
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)
return seqmappings;
}
+ public boolean isMappingForPhyre2Model()
+ {
+ return mappingForPhyre2Model;
+ }
+
+ public void setMappingForPhyre2Model(boolean mappingForPhyre2Model)
+ {
+ this.mappingForPhyre2Model = mappingForPhyre2Model;
+ }
+
+ public static StructureSelectionManager getStructureSelectionManager()
+ {
+ return instances.values().iterator().next();
+ }
}