JAL-750 - automaticScrolling=true by default. Refactored to use getDefaultParameter...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 15 Aug 2011 14:21:56 +0000 (15:21 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 15 Aug 2011 14:21:56 +0000 (15:21 +0100)
src/jalview/appletgui/AlignViewport.java

index 264100e..ba989ff 100644 (file)
@@ -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()
   {