From 2aabfea0fd0fc9e3b3e2c0c79f075e6f39907a3e Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 15 Aug 2011 15:21:56 +0100 Subject: [PATCH] JAL-750 - automaticScrolling=true by default. Refactored to use getDefaultParameter for parsing boolean applet parameters --- src/jalview/appletgui/AlignViewport.java | 78 +++++++++--------------------- 1 file changed, 22 insertions(+), 56 deletions(-) diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 264100e..ba989ff 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -217,43 +217,19 @@ public class AlignViewport implements SelectionSource, VamsasSource if (applet != null) { - String param = applet.getParameter("showFullId"); - if (param != null) - { - showJVSuffix = Boolean.valueOf(param).booleanValue(); - } + showJVSuffix = applet.getDefaultParameter("showFullId", showJVSuffix); - param = applet.getParameter("showAnnotation"); - if (param != null) - { - showAnnotation = Boolean.valueOf(param).booleanValue(); - } - - param = applet.getParameter("showConservation"); - if (param != null) - { - showConservation = Boolean.valueOf(param).booleanValue(); - } + showAnnotation = applet.getDefaultParameter("showAnnotation", showAnnotation); + + showConservation = applet.getDefaultParameter("showConservation", showConservation); + + showQuality = applet.getDefaultParameter("showQuality", showQuality); - param = applet.getParameter("showQuality"); - if (param != null) - { - showQuality = Boolean.valueOf(param).booleanValue(); - } + showConsensus = applet.getDefaultParameter("showConsensus", showConsensus); - param = applet.getParameter("showConsensus"); - if (param != null) - { - showConsensus = Boolean.valueOf(param).booleanValue(); - } + showUnconserved = applet.getDefaultParameter("showUnconserved", showUnconserved); - param = applet.getParameter("showUnconserved"); - if (param != null) - { - this.showUnconserved = Boolean.valueOf(param).booleanValue(); - } - - param = applet.getParameter("upperCase"); + String param = applet.getParameter("upperCase"); if (param != null) { if (param.equalsIgnoreCase("bold")) @@ -261,28 +237,18 @@ public class AlignViewport implements SelectionSource, VamsasSource upperCasebold = true; } } - param = applet.getParameter("sortByTree"); - if (param != null) - { - sortByTree = Boolean.valueOf(param).booleanValue(); - } - param = applet.getParameter("automaticScrolling"); - if (param!=null) { - followHighlight = Boolean.valueOf(param).booleanValue(); - followSelection = followHighlight; - } - if ((param=applet.getParameter("showSequenceLogo"))!=null) { - showSequenceLogo=Boolean.valueOf(param).booleanValue(); - } - if ((param=applet.getParameter("showGroupConsensus"))!=null) { - showGroupConsensus=Boolean.valueOf(param).booleanValue(); - } - if ((param=applet.getParameter("showGroupConservation"))!=null) { - showGroupConservation=Boolean.valueOf(param).booleanValue(); - } - if ((param=applet.getParameter("showConsensusHistogram"))!=null) { - showConsensusHistogram=Boolean.valueOf(param).booleanValue(); - } + sortByTree = applet.getDefaultParameter("sortByTree", sortByTree); + + followHighlight = applet.getDefaultParameter("automaticScrolling",followHighlight); + followSelection = followHighlight; + + showSequenceLogo = applet.getDefaultParameter("showSequenceLogo", showSequenceLogo); + + showGroupConsensus = applet.getDefaultParameter("showGroupConsensus", showGroupConsensus); + + showGroupConservation = applet.getDefaultParameter("showGroupConservation", showGroupConservation); + + showConsensusHistogram = applet.getDefaultParameter("showConsensusHistogram", showConsensusHistogram); } @@ -1569,7 +1535,7 @@ public class AlignViewport implements SelectionSource, VamsasSource } } - public boolean followHighlight = false; + public boolean followHighlight = true; public boolean getFollowHighlight() { -- 1.7.10.2