(JAL-975) formatting
authorjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 7 Nov 2011 13:08:45 +0000 (13:08 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 7 Nov 2011 13:09:09 +0000 (13:09 +0000)
src/jalview/ws/jws2/AAConsClient.java

index 054c9ab..a720593 100644 (file)
@@ -361,8 +361,9 @@ public class AAConsClient extends AlignCalcWorker
       Map<String, TreeSet<Score>> scoremap = scoremanager.asMap();
       int alWidth = alignViewport.getAlignment().getWidth();
       AlignmentI alignment;
-      int ann = (alignment=alignViewport.getAlignment()).getAlignmentAnnotation().length;
-      ArrayList<AlignmentAnnotation> ourAnnot=new ArrayList<AlignmentAnnotation>();
+      int ann = (alignment = alignViewport.getAlignment())
+              .getAlignmentAnnotation().length;
+      ArrayList<AlignmentAnnotation> ourAnnot = new ArrayList<AlignmentAnnotation>();
       for (String score : scoremap.keySet())
       {
         TreeSet<Score> scores = scoremap.get(score);
@@ -385,40 +386,57 @@ public class AAConsClient extends AlignCalcWorker
             // simple annotation row
             annotation = findOrCreate(scr.getMethod(), true, null, null);
             Annotation[] elm = new Annotation[alWidth];
-            if (alWidth==scr.getScores().size())
+            if (alWidth == scr.getScores().size())
             {
-            Iterator<Float> vals = scr.getScores().iterator();
-            float m=0f,x=0f;
-            for (int i = 0; vals.hasNext(); i++)
-            {
-              float val = vals.next().floatValue();
-              if (i==0) { m=val;x=val;} else { if (m>val) { m=val; }; if (x<val) { x=val;}}
-              elm[i] = new Annotation("",""+val,' ',val);
-            }
-            
-            annotation.annotations = elm;
-            annotation.belowAlignment = true;
-            if (x<0)
-            {
-              x=0;
-            }
-            x+=(x-m)*0.1;
-            annotation.graphMax=x;
-            annotation.graphMin=m;
-            annotation.validateRangeAndDisplay();
-            ourAnnot.add(annotation);
+              Iterator<Float> vals = scr.getScores().iterator();
+              float m = 0f, x = 0f;
+              for (int i = 0; vals.hasNext(); i++)
+              {
+                float val = vals.next().floatValue();
+                if (i == 0)
+                {
+                  m = val;
+                  x = val;
+                }
+                else
+                {
+                  if (m > val)
+                  {
+                    m = val;
+                  }
+                  ;
+                  if (x < val)
+                  {
+                    x = val;
+                  }
+                }
+                elm[i] = new Annotation("", "" + val, ' ', val);
+              }
+
+              annotation.annotations = elm;
+              annotation.belowAlignment = true;
+              if (x < 0)
+              {
+                x = 0;
+              }
+              x += (x - m) * 0.1;
+              annotation.graphMax = x;
+              annotation.graphMin = m;
+              annotation.validateRangeAndDisplay();
+              ourAnnot.add(annotation);
             }
           }
         }
       }
-      if (ourAnnot.size()>0)
+      if (ourAnnot.size() > 0)
       {
-        List<AlignmentAnnotation> our=ourAnnots;
+        List<AlignmentAnnotation> our = ourAnnots;
         ourAnnots = ourAnnot;
-        if (our!=null) {
-          if (our.size()>0)
+        if (our != null)
+        {
+          if (our.size() > 0)
           {
-            for (AlignmentAnnotation an:our)
+            for (AlignmentAnnotation an : our)
             {
               if (!ourAnnots.contains(an))
               {
@@ -430,14 +448,14 @@ public class AAConsClient extends AlignCalcWorker
           our.clear();
         }
       }
-      //if (ann != alignViewport.getAlignment().getAlignmentAnnotation().length)
+      // if (ann !=
+      // alignViewport.getAlignment().getAlignmentAnnotation().length)
       {
         ap.adjustAnnotationHeight();
       }
-     /* else
-      {
-        ap.paintAlignment(true);
-      }*/
+      /*
+       * else { ap.paintAlignment(true); }
+       */
     }
   }