From: James Procter Date: Mon, 25 Sep 2023 16:40:54 +0000 (+0100) Subject: JAL-3858 report PAE range with sensible precision X-Git-Tag: Release_2_11_4_0~166 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9f4e46fd644ada321420a3b68750880a138dc797;p=jalview.git JAL-3858 report PAE range with sensible precision --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 8a957bc..ee4c327 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -68,6 +68,7 @@ import jalview.renderer.AwtRenderPanelI; import jalview.renderer.ContactGeometry; import jalview.schemes.ResidueProperties; import jalview.util.Comparison; +import jalview.util.Format; import jalview.util.MessageManager; import jalview.util.Platform; import jalview.viewmodel.ViewportListenerI; @@ -1311,9 +1312,11 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, ContactGeometry cgeom = new ContactGeometry(clist, ann.graphHeight); ContactGeometry.contactInterval ci = cgeom.mapFor(rowAndOffset); ContactRange cr = clist.getRangeFor(ci.cStart, ci.cEnd); - tooltip = "Contact from " + clist.getPosition() + ", [" + ci.cStart - + " - " + ci.cEnd + "]" + "
Mean:" + cr.getMean(); - + StringBuilder tooltipb = new StringBuilder(); + tooltipb.append("Contact from ") + .append(clist.getPosition()).append(", [").append(ci.cStart).append(" - ").append(ci.cEnd).append("]").append("
Mean:"); + Format.appendPercentage(tooltipb, (float)cr.getMean(),2); + tooltip = tooltipb.toString(); int col = ann.sequenceRef.findPosition(column); int[][] highlightPos; int[] mappedPos = clist.getMappedPositionsFor(ci.cStart, ci.cEnd); diff --git a/src/jalview/util/Format.java b/src/jalview/util/Format.java index ce7ab6d..df2c76c 100755 --- a/src/jalview/util/Format.java +++ b/src/jalview/util/Format.java @@ -940,7 +940,7 @@ public class Format } /** - * Bespoke method to format percentage float value to the specified number of + * Bespoke method to format a percentage (or any other) float value to the specified number of * decimal places. Avoids use of general-purpose format parsers as a * processing hotspot. *