import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JColorChooser;
-import javax.swing.JDialog;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
case COLOUR_COLUMN:
FeatureColourI colour = (FeatureColourI) table.getValueAt(row,
column);
- tip = getColorTooltip(colour);
+ tip = getColorTooltip(colour, true);
break;
case FILTER_COLUMN:
FeatureMatcherSet o = (FeatureMatcherSet) table.getValueAt(row,
}
/**
- * Position the tooltip at the bottom edge of, and half way across, the
+ * Position the tooltip near the bottom edge of, and half way across, the
* current cell
*/
@Override
int column = table.columnAtPoint(point);
int row = table.rowAtPoint(point);
Rectangle r = getCellRect(row, column, false);
- Point loc = new Point(r.x + r.width / 2, r.y + r.height);
+ Point loc = new Point(r.x + r.width / 2, r.y + r.height - 3);
return loc;
}
};
* Answers a suitable tooltip to show on the colour cell of the table
*
* @param fcol
+ * @param withHint
+ * if true include 'click to edit' and similar text
* @return
*/
- public static String getColorTooltip(FeatureColourI fcol)
+ public static String getColorTooltip(FeatureColourI fcol,
+ boolean withHint)
{
if (fcol == null)
{
}
if (fcol.isSimpleColour())
{
- return BASE_TOOLTIP;
+ return withHint ? BASE_TOOLTIP : null;
}
String description = fcol.getDescription();
description = description.replaceAll("<", "<");
description = description.replaceAll(">", ">");
StringBuilder tt = new StringBuilder(description);
- tt.append("<br>").append(BASE_TOOLTIP).append("</br>");
+ if (withHint)
+ {
+ tt.append("<br>").append(BASE_TOOLTIP).append("</br>");
+ }
return JvSwingUtils.wrapTooltip(true, tt.toString());
}