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;
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 + "]" + "<br/>Mean:" + cr.getMean();
-
+ StringBuilder tooltipb = new StringBuilder();
+ tooltipb.append("Contact from ")
+ .append(clist.getPosition()).append(", [").append(ci.cStart).append(" - ").append(ci.cEnd).append("]").append("<br/>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);
}
/**
- * 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.
*