/**
* 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("<br>").append(BASE_TOOLTIP).append("</br>");
+ return JvSwingUtils.wrapTooltip(true, tt.toString());
}
public static void renderGraduatedColor(JLabel comp, FeatureColourI gcol,