X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=1abb1711df86e47d18ffdbd1dbc8dd27a4e7fdcc;hb=ca160187a050f6d4e50158cd5b51f75c83a7179e;hp=038a5a0dc6e2b8da579dd3cafc52dec5422a8a00;hpb=e93bc0a7b2def06392a2f6b0f563c1e07fb917a1;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 038a5a0..1abb171 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -141,7 +141,8 @@ 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 - native resolution
  • + *
  • 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)
  • @@ -588,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); @@ -641,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 @@ -791,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 + "'"); } } @@ -842,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; @@ -874,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); } } } @@ -1064,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; @@ -1088,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; @@ -1632,7 +1653,6 @@ public class Cache private static final Collection bootstrapProperties = new ArrayList<>( Arrays.asList(JALVIEWLOGLEVEL, BOOTSTRAP_TEST)); - public static Properties bootstrapProperties(String filename) { Properties bootstrapProps = new Properties(); @@ -1661,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; } @@ -1678,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(