Merge branch 'test_paolo_JAL-1065' into Tcoffee_JAL-1065
[jalview.git] / src / jalview / bin / Cache.java
index ba1d0a8..069589e 100755 (executable)
@@ -133,6 +133,8 @@ import org.biojava.dasobert.dasregistry.Das1Source;
  * <li>ANNOTATIONCOLOUR_MAX (red) Shade used for maximum value of annotation when shading by annotation</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>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_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></li>
  * 
  * </ul>
@@ -802,4 +804,24 @@ public class Cache
     }
     return null;
   }
+
+  /**
+   * get and parse a property as an integer. send any parsing problems to System.err
+   * @param property
+   * @return null or Integer
+   */
+  public static Integer getIntegerProperty(String property)
+  {
+    String val=getProperty(property);
+    if (val!=null && (val=val.trim()).length()>0)
+    {
+      try {
+        return Integer.valueOf(val);
+      } catch (NumberFormatException x)
+      {
+        System.err.println("Invalid integer in property '"+property+"' (value was '"+val+"')");
+      }
+    }
+    return null;
+  }
 }