if (evt.isPopupTrigger())
{
Object colour = table.getValueAt(selectedRow, COLOUR_COLUMN);
- popupSort(selectedRow, type, colour, fr.getMinMax(), evt.getX(),
- evt.getY());
+ showPopupMenu(selectedRow, type, colour, evt.getPoint());
}
else if (evt.getClickCount() == 2)
{
{
String type = (String) table.getValueAt(selectedRow, TYPE_COLUMN);
Object colour = table.getValueAt(selectedRow, COLOUR_COLUMN);
- popupSort(selectedRow, type, colour, fr.getMinMax(), evt.getX(),
- evt.getY());
+ showPopupMenu(selectedRow, type, colour, evt.getPoint());
}
}
});
inConstruction = false;
}
- protected void popupSort(final int rowSelected, final String type,
- final Object typeCol, final Map<String, float[][]> minmax, int x,
- int y)
+ /**
+ * Constructs and shows a popup menu of possible actions on the selected row and
+ * feature type
+ *
+ * @param rowSelected
+ * @param type
+ * @param typeCol
+ * @param pt
+ */
+ protected void showPopupMenu(final int rowSelected, final String type,
+ final Object typeCol, final Point pt)
{
final FeatureColourI featureColour = (FeatureColourI) typeCol;
.sortAlignmentByFeatureScore(Arrays.asList(new String[]
{ type }));
}
-
});
JMenuItem dens = new JMenuItem(
MessageManager.getString("label.sort_by_density"));
.sortAlignmentByFeatureDensity(Arrays.asList(new String[]
{ type }));
}
-
});
men.add(dens);
/*
* toggle variable to simple colour - show colour chooser
*/
- String title = MessageManager.getString("label.select_colour");
+ String title = MessageManager.formatMessage("label.select_colour_for", type);
ColourChooserListener listener = new ColourChooserListener()
{
@Override
JalviewColourChooser.showColourChooser(me, title, featureColour.getMaxColour(), listener);
}
}
- else {
+ else
+ {
if (e.getSource() instanceof FeatureTypeSettings)
{
/*
}
}
}
-
});
JMenuItem selCols = new JMenuItem(
men.add(clearCols);
men.add(hideCols);
men.add(hideOtherCols);
- men.show(table, x, y);
+ men.show(table, pt.x, pt.y);
}
@Override
/*
* simple colour chooser
*/
- String ttl = MessageManager.getString("label.select_colour");
+ String ttl = MessageManager.formatMessage("label.select_colour_for", type);
ColourChooserListener listener = new ColourChooserListener()
{
@Override