X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=b24304af8e1cebef630a7919ba7e2b03aca088b1;hb=2a5cbe264ec842c1a0f93e6bd78294607a94e686;hp=5692c496de7ac6712c2df13cd427609f8864be40;hpb=b737b8f38d46da69364256c646f779c47e578563;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 5692c49..b24304a 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -17,6 +17,9 @@ */ package jalview.bin; +import jalview.ws.dbsources.das.api.DasSourceRegistryI; +import jalview.ws.dbsources.das.datamodel.DasSourceRegistry; + import java.awt.Color; import java.io.*; import java.text.DateFormat; @@ -24,7 +27,6 @@ import java.text.SimpleDateFormat; import java.util.*; import org.apache.log4j.*; -import org.biojava.dasobert.dasregistry.Das1Source; /** * Stores and retrieves Jalview Application Properties Lists and fields within @@ -602,46 +604,6 @@ public class Cache } /** - * 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; - } - - /** * GA tracker object - actually JGoogleAnalyticsTracker null if tracking not * enabled. */ @@ -846,4 +808,18 @@ public class Cache } return null; } + + private static DasSourceRegistryI sourceRegistry=null; + /** + * initialise and .. + * @return instance of the das source registry + */ + public static DasSourceRegistryI getDasSourceRegistry() + { + if (sourceRegistry==null) + { + sourceRegistry = new DasSourceRegistry(); + } + return sourceRegistry; + } }