import java.util.*;
import org.apache.log4j.*;
+import org.biojava.dasobert.dasregistry.Das1Source;
/**
* Stores and retrieves Jalview Application Properties Lists and fields within
public static final String DAS_LOCAL_SOURCE = "DAS_LOCAL_SOURCE";
+ public static final String DAS_REGISTRY_URL = "DAS_REGISTRY_URL";
+
+ public static final String DAS_ACTIVE_SOURCE = "DAS_ACTIVE_SOURCE";
+
/**
* Initialises the Jalview Application Log
*/
return (groovyJarsArePresent > 0);
}
+ /**
+ * generate Das1Sources from the local das source list
+ * @return Vector of Das1Sources
+ */
+ public static Vector getLocalDasSources()
+ {
+ Vector localSources = new Vector();
+ String local = jalview.bin.Cache.getProperty("DAS_LOCAL_SOURCE");
+ if (local != null)
+ {
+ StringTokenizer st = new StringTokenizer(local, "\t");
+ while (st.hasMoreTokens())
+ {
+ String token = st.nextToken();
+ int bar = token.indexOf("|");
+ Das1Source source = new Das1Source();
+ source.setUrl(token.substring(bar + 1));
+ if (source.getUrl().startsWith("sequence:"))
+ {
+ source.setUrl(source.getUrl().substring(9));
+ // this source also serves sequences as well as features
+ source.setCapabilities(new String[] { "sequence", "features"});
+ } else {
+ // default is that all user added sources serve features
+ source.setCapabilities(new String[] { "features"});
+ }
+
+ source.setNickname(token.substring(0, bar));
+
+ localSources.addElement(source);
+ }
+ }
+ return localSources;
+ }
+
}