X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureSettings.java;h=14e37af5955b05a1864dda50b0359dc2d66b37a6;hb=c184de2a81afe5ba6f8b7b68dde221c256e70195;hp=01a73109c9efa8f35343d68c9d13cc2d86c1e95e;hpb=00ec8073218a0788e62cc2aa22de9a1a14d81952;p=jalview.git diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 01a7310..14e37af 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -1336,32 +1336,25 @@ public class FeatureSettings extends JPanel /** * Answers a suitable tooltip to show on the colour cell of the table * - * @param gcol + * @param fcol * @return */ - public String getColorTooltip(FeatureColourI gcol) + public static String getColorTooltip(FeatureColourI fcol) { - if (gcol.isSimpleColour()) - { - return BASE_TOOLTIP; - } - StringBuilder tt = new StringBuilder(); - if (gcol.isAboveThreshold()) - { - tt.append("Thresholded (Above ").append(gcol.getThreshold()) - .append(")"); - } - else if (gcol.isBelowThreshold()) + if (fcol == null) { - tt.append("Thresholded (Below ").append(gcol.getThreshold()) - .append(")"); + return null; } - else if (gcol.isColourByLabel()) + if (fcol.isSimpleColour()) { - tt.insert(0, "Coloured by label text "); + return BASE_TOOLTIP; } - tt.append("; ").append(BASE_TOOLTIP); - return tt.toString(); + String description = fcol.getDescription(); + description = description.replaceAll("<", "<"); + description = description.replaceAll(">", ">"); + StringBuilder tt = new StringBuilder(description); + tt.append("
").append(BASE_TOOLTIP).append("
"); + return JvSwingUtils.wrapTooltip(true, tt.toString()); } public static void renderGraduatedColor(JLabel comp, FeatureColourI gcol,