X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=1abb1711df86e47d18ffdbd1dbc8dd27a4e7fdcc;hb=ca160187a050f6d4e50158cd5b51f75c83a7179e;hp=3750d9de3f82d1f30a39e1cd4145dda57a07c854;hpb=c932f0e85a8852824cdd8ce790af68682732c85c;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 3750d9d..1abb171 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -141,6 +141,10 @@ import jalview.ws.sifts.SiftsSettings; *
  • WRAP_ALIGNMENT
  • *
  • EPS_RENDERING (Prompt each time|Lineart|Text) default for EPS rendering * style check
  • + *
  • BITMAP_SCALE - scale factor for PNG export - default 0.0 - native + * resolution
  • + *
  • BITMAP_HEIGHT - height bound for PNG export or 0 for unbound
  • + *
  • BITMAP_WIDTH - width bound for PNG export or 0 for unbound
  • *
  • SORT_ALIGNMENT (No sort|Id|Pairwise Identity)
  • *
  • SEQUENCE_LINKS list of name|URL pairs for opening a url with * $SEQUENCE_ID$
  • @@ -585,7 +589,7 @@ public class Cache { if (!Jalview.quiet()) { - jalview.bin.Console.outPrintln( + jalview.bin.Console.errPrintln( "Non-fatal exception when checking version at " + remoteBuildPropertiesUrl + ":"); jalview.bin.Console.printStackTrace(ex); @@ -638,8 +642,8 @@ public class Cache url = Cache.class.getResource(resourcePath).toString(); } catch (Exception ex) { - jalview.bin.Console.errPrintln("Failed to resolve resource " + resourcePath - + ": " + ex.getMessage()); + jalview.bin.Console.errPrintln("Failed to resolve resource " + + resourcePath + ": " + ex.getMessage()); } } else @@ -788,7 +792,26 @@ public class Cache } catch (NumberFormatException e) { if (!Jalview.quiet()) - jalview.bin.Console.outPrintln("Error parsing int property '" + jalview.bin.Console.errPrintln("Error parsing int property '" + + property + "' with value '" + string + "'"); + } + } + + return def; + } + + public static float getDefault(String property, float def) + { + String string = getProperty(property); + if (string != null) + { + try + { + def = Float.parseFloat(string); + } catch (NumberFormatException e) + { + if (!Jalview.quiet()) + jalview.bin.Console.errPrintln("Error parsing float property '" + property + "' with value '" + string + "'"); } } @@ -839,7 +862,7 @@ public class Cache } catch (Exception ex) { if (!Jalview.quiet()) - jalview.bin.Console.outPrintln( + jalview.bin.Console.errPrintln( "Error setting property: " + key + " " + obj + "\n" + ex); } return oldValue; @@ -871,7 +894,7 @@ public class Cache } catch (Exception ex) { if (!Jalview.quiet()) - jalview.bin.Console.outPrintln("Error saving properties: " + ex); + jalview.bin.Console.errPrintln("Error saving properties: " + ex); } } } @@ -1061,8 +1084,9 @@ public class Cache return date_format.parse(val); } catch (Exception ex) { - jalview.bin.Console.errPrintln("Invalid or corrupt date in property '" - + propertyName + "' : value was '" + val + "'"); + jalview.bin.Console + .errPrintln("Invalid or corrupt date in property '" + + propertyName + "' : value was '" + val + "'"); } } return null; @@ -1085,8 +1109,8 @@ public class Cache return Integer.valueOf(val); } catch (NumberFormatException x) { - jalview.bin.Console.errPrintln("Invalid integer in property '" + property - + "' (value was '" + val + "')"); + jalview.bin.Console.errPrintln("Invalid integer in property '" + + property + "' (value was '" + val + "')"); } } return null; @@ -1657,8 +1681,9 @@ public class Cache return null; if (!file.exists()) { - jalview.bin.Console.errPrintln("Could not load bootstrap preferences file '" - + filename + "'"); + jalview.bin.Console + .errPrintln("Could not load bootstrap preferences file '" + + filename + "'"); return null; } @@ -1674,8 +1699,9 @@ public class Cache } } catch (FileNotFoundException e) { - jalview.bin.Console.errPrintln("Could not find bootstrap preferences file '" - + file.getAbsolutePath() + "'"); + jalview.bin.Console + .errPrintln("Could not find bootstrap preferences file '" + + file.getAbsolutePath() + "'"); } catch (IOException e) { jalview.bin.Console.errPrintln(