From: jprocter Date: Fri, 23 Apr 2010 12:20:56 +0000 (+0000) Subject: default value boolean parameter getter X-Git-Tag: Release_2_5~53 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=86d8388406a8e90e7af3b2bc4fd1b796c6a673c4;p=jalview.git default value boolean parameter getter --- diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 7ae85dc..43f7f19 100755 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -707,7 +707,7 @@ public class JalviewLite extends Applet newAlignFrame.statusBar.setText("Successfully loaded file " + file); - + String treeFile = applet.getParameter("tree"); if (treeFile == null) { @@ -1194,4 +1194,24 @@ public class JalviewLite extends Applet { this.separator = separator; } + + /** + * get boolean value of applet parameter 'name' and return default if parameter is not set + * @param name name of paremeter + * @param def the value to return otherwise + * @return true or false + */ + public boolean getDefaultParameter(String name, boolean def) + { + String stn; + if ((stn=getParameter(name)) == null) + { + return def; + } + if (stn.toLowerCase().equals("true")) + { + return true; + } + return false; + } }