Merge branch 'develop' into trialMerge
[jalview.git] / src / jalview / analysis / Conservation.java
index 0af5d20..ff38c08 100755 (executable)
@@ -30,6 +30,7 @@ import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
 import jalview.schemes.ResidueProperties;
 import jalview.util.Comparison;
+import jalview.util.Format;
 
 import java.awt.Color;
 import java.util.List;
@@ -54,6 +55,8 @@ public class Conservation
 
   private static final int GAP_INDEX = -1;
 
+  private static final Format FORMAT_3DP = new Format("%2.5f");
+
   SequenceI[] sequences;
 
   int start;
@@ -695,7 +698,7 @@ public class Conservation
 
       max = Math.max(max, bigtot);
 
-      quality.addElement(new Double(bigtot));
+      quality.addElement(Double.valueOf(bigtot));
     }
 
     double newmax = -Double.MAX_VALUE;
@@ -707,7 +710,7 @@ public class Conservation
       tmp = ((max - tmp) * (size - cons2GapCounts[j])) / size;
 
       // System.out.println(tmp+ " " + j);
-      quality.setElementAt(new Double(tmp), j);
+      quality.setElementAt(Double.valueOf(tmp), j);
 
       if (tmp > newmax)
       {
@@ -808,7 +811,8 @@ public class Conservation
         value = quality.elementAt(i).floatValue();
         float vprop = value - qmin;
         vprop /= qmax;
-        quality2.annotations[i] = new Annotation(" ", String.valueOf(value),
+        String description = FORMAT_3DP.form(value);
+        quality2.annotations[i] = new Annotation(" ", description,
                 ' ', value, new Color(minR + (maxR * vprop),
                         minG + (maxG * vprop), minB + (maxB * vprop)));
       }