adds static declaration of AJAX-readable domains
[jalview.git] / src / jalview / bin / Cache.java
index fcc4f6d..6d23bd0 100755 (executable)
@@ -28,8 +28,6 @@ import jalview.schemes.UserColourScheme;
 import jalview.structure.StructureImportSettings;
 import jalview.urls.IdOrgSettings;
 import jalview.util.ColorUtils;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
-import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
 import jalview.ws.sifts.SiftsSettings;
 
 import java.awt.Color;
@@ -178,7 +176,7 @@ import org.apache.log4j.SimpleLayout;
  * <li>FIGURE_AUTOIDWIDTH (false) Expand the left hand column of an exported
  * alignment figure to accommodate even the longest sequence ID or annotation
  * label.</li>
- * <li>FIGURE_USERIDWIDTH Specifies the width to use for the left-hand column
+ * <li>FIGURE_FIXEDIDWIDTH Specifies the width to use for the left-hand column
  * when exporting an alignment as a figure (setting FIGURE_AUTOIDWIDTH to true
  * will override this).</li>
  * <li>STRUCT_FROM_PDB (false) derive secondary structure annotation from PDB
@@ -288,7 +286,8 @@ public class Cache
   /** Default file is ~/.jalview_properties */
   static String propertiesFile;
 
-  private static boolean propsAreReadOnly = false;
+  private static boolean propsAreReadOnly = /** @j2sNative true || */
+          false;
 
   public static void initLogger()
   {
@@ -399,7 +398,8 @@ public class Cache
     // LOAD THE AUTHORS FROM THE authors.props file
     try
     {
-      String authorDetails = "jar:"
+      String authorDetails = /** @j2sNative "xxx" || */
+              "jar:"
               .concat(Cache.class.getProtectionDomain().getCodeSource()
                       .getLocation().toString().concat("!/authors.props"));
 
@@ -421,7 +421,8 @@ public class Cache
     // VERSION MAY HAVE CHANGED SINCE LAST USING JALVIEW
     try
     {
-      String buildDetails = "jar:".concat(Cache.class.getProtectionDomain()
+      String buildDetails = /** @j2sNative "xxx" || */
+              "jar:".concat(Cache.class.getProtectionDomain()
               .getCodeSource().getLocation().toString()
               .concat("!/.build_properties"));
 
@@ -603,18 +604,13 @@ public class Cache
   }
 
   /**
-   * These methods are used when checking if the saved preference is different
-   * to the default setting
+   * Answers the value of the given property, or the supplied default value if
+   * the property is not set
    */
   public static String getDefault(String property, String def)
   {
-    String string = getProperty(property);
-    if (string != null)
-    {
-      return string;
-    }
-
-    return def;
+    String value = getProperty(property);
+    return value == null ? def : value;
   }
 
   /**
@@ -982,22 +978,6 @@ 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;
-  }
-
   /**
    * Set the specified value, or remove it if null or empty. Does not save the
    * properties file.
@@ -1072,4 +1052,19 @@ public class Cache
       }
     }
   }
+
+       /**
+        * Add a known domain that implements access-control-allow-origin:* bh 2018
+        * 
+        * @param defaultUniprotDomain
+        */
+       public static void addJ2SDirectDatabaseCall(String domain) 
+       {
+
+               /**
+                * @j2sNative
+                * 
+                *                      J2S.addDirectDatabaseCall(domain);
+                */
+       }
 }