private static final int MIN_HEIGHT = 400;
- private final static String BASE_TOOLTIP = "Click to edit, right-click for menu";
+ private final static String BASE_TOOLTIP = MessageManager.getString("label.click_to_edit");
final FeatureRenderer fr;
table = new JTable()
{
- static final String tt = "Click to edit, right-click for menu"; // todo i18n
-
@Override
public String getToolTipText(MouseEvent e)
{
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,
default:
break;
}
+
return tip;
}
tableHeader.setReorderingAllowed(false);
table.setFont(new Font("Verdana", Font.PLAIN, 12));
- // table.setDefaultRenderer(Color.class, new ColorRenderer());
- // table.setDefaultEditor(Color.class, new ColorEditor(this));
- //
table.setDefaultEditor(FeatureColour.class, new ColorEditor(this));
table.setDefaultRenderer(FeatureColour.class, new ColorRenderer());
data[dataIndex][FILTER_COLUMN] = featureFilter == null
? new FeatureMatcherSet()
: featureFilter;
- data[dataIndex][SHOW_COLUMN] = new Boolean(
+ data[dataIndex][SHOW_COLUMN] = Boolean.valueOf(
af.getViewport().getFeaturesDisplayed().isVisible(type));
dataIndex++;
displayableTypes.remove(type);
data[dataIndex][FILTER_COLUMN] = featureFilter == null
? new FeatureMatcherSet()
: featureFilter;
- data[dataIndex][SHOW_COLUMN] = new Boolean(true);
+ data[dataIndex][SHOW_COLUMN] = Boolean.valueOf(true);
dataIndex++;
displayableTypes.remove(type);
}
}
}
});
- help.setFont(JvSwingUtils.getLabelFont());
- help.setText(MessageManager.getString("action.help"));
- help.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- try
- {
- Help.showHelpWindow(HelpId.SequenceFeatureSettings);
- } catch (HelpSetException e1)
- {
- e1.printStackTrace();
- }
- }
- });
JButton cancel = new JButton(MessageManager.getString("action.cancel"));
cancel.setFont(JvSwingUtils.getLabelFont());
* 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());
}