refactored resolvetocodebase code and reused for resource location as well as showURL...
[jalview.git] / src / jalview / bin / Cache.java
index 09ebadd..68edf1b 100755 (executable)
@@ -106,7 +106,7 @@ import org.biojava.dasobert.dasregistry.Das1Source;
  * <li>SHOW_MEMUSAGE boolean show memory usage and warning indicator on desktop
  * (false)</li>
  * <li>VERSION_CHECK (true) check for the latest release version from
- * www.jalview.org</li>
+ * www.jalview.org (or the alias given by the www.jalview.org property)</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
@@ -132,8 +132,7 @@ import org.biojava.dasobert.dasregistry.Das1Source;
  * warning dialog box is displayed.</li>
  * <li>ANNOTATIONCOLOUR_MIN (orange) Shade used for minimum value of annotation when shading by annotation</li>
  * <li>ANNOTATIONCOLOUR_MAX (red) Shade used for maximum value of annotation when shading by annotation</li>
- * 
- * <li></li>
+ * <li>www.jalview.org (http://www.jalview.org) a property enabling all HTTP requests to be redirected to a mirror of http://www.jalview.org</li>
  * 
  * <li></li>
  * 
@@ -331,7 +330,7 @@ public class Cache
             System.setProperty("sun.net.client.defaultConnectTimeout",
                     "5000");
             java.net.URL url = new java.net.URL(
-                    "http://www.jalview.org/webstart/jalview.jnlp");
+                    Cache.getDefault("www.jalview.org", "http://www.jalview.org")+"/webstart/jalview.jnlp");
             BufferedReader in = new BufferedReader(new InputStreamReader(
                     url.openStream()));
             String line = null;
@@ -754,4 +753,15 @@ public class Cache
     }
     return (col==null) ? defcolour: col;
   }
+
+  /**
+   * store a colour as a Jalview user default property
+   * @param property
+   * @param colour     
+   */
+  public static void setColourProperty(String property, Color colour)
+  {
+    setProperty(property, jalview.util.Format
+          .getHexString(colour));
+  }
 }