import java.util.*;
import org.apache.log4j.*;
+import org.biojava.dasobert.dasregistry.Das1Source;
+
+import com.boxysystems.jgoogleanalytics.FocusPoint;
+import com.boxysystems.jgoogleanalytics.JGoogleAnalyticsTracker;
/**
* Stores and retrieves Jalview Application Properties Lists and fields within
* (false) </li>
* <li>SHOW_NPFEATS_TOOLTIP (true) show non-positional features in the Sequence ID tooltip</li>
* <li>SHOW_DBREFS_TOOLTIP (true) show Database Cross References in the Sequence ID tooltip</li>
+ * <li>SHOW_UNCONSERVED (false) only render unconserved residues - conserved displayed as '.'</li>
+ * <li>SORT_BY_TREE (false) sort the current alignment view according to the order of a newly displayed tree</li>
+ *
* <li> </li>
*
* </ul>
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;
+ }
+
+ public static JGoogleAnalyticsTracker tracker=null;
+
+ public static void initGoogleTracker()
+ {
+ if (tracker==null)
+ {
+ String vrs="No Version Accessible";
+ try {
+ //Google analytics tracking code for Library Finder
+ tracker = new JGoogleAnalyticsTracker("Jalview Desktop",
+ (vrs=jalview.bin.Cache.getProperty("VERSION")+"_"+jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")),
+ "UA-9060947-1");
+ tracker.trackAsynchronously(new FocusPoint("Application Started."));
+ } catch (RuntimeException e)
+ {
+ if (log!=null) {
+ log.debug("Caught runtime exception in googletracker init:",e);
+ }
+ // quietly return.
+ }
+ catch (Exception e)
+ {
+ // unexpected error
+ if (log!=null)
+ {
+ log.warn("Failed to initialise GoogleTracker for Jalview Desktop with version "+vrs,e);
+ } else {
+ log.warn("Failed to initialise GoogleTracker for Jalview Desktop with version "+vrs,e);
+ }
+ }
+ }
+ }
}