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
*/
final AlignmentViewPanel ap;
- private final String featureType;
+ final String featureType;
/*
* the colour and filters to reset to on Cancel
{
if (minColour.isEnabled())
{
- showColourChooser(minColour, "label.select_colour_minimum_value");
+ String ttl = MessageManager.getString("label.select_colour_minimum_value");
+ showColourChooser(minColour, ttl);
}
}
});
{
if (maxColour.isEnabled())
{
- showColourChooser(maxColour, "label.select_colour_maximum_value");
+ String ttl = MessageManager.getString("label.select_colour_maximum_value");
+ showColourChooser(maxColour, ttl);
}
}
});
{
if (simpleColour.isSelected())
{
- showColourChooser(singleColour, "label.select_colour");
+ String ttl = MessageManager.formatMessage("label.select_colour_for", featureType);
+ showColourChooser(singleColour, ttl);
}
}
});
*
* @param colourPanel
* the panel whose background colour is being picked
- * @param key
- * message bundle key for the dialog title
+ * @param title
*/
- void showColourChooser(JPanel colourPanel, String key)
+ void showColourChooser(JPanel colourPanel, String title)
{
ColourChooserListener listener = new ColourChooserListener()
{
colourChanged(true);
}
};
- JalviewColourChooser.showColourChooser(this,
- MessageManager.getString(key), colourPanel.getBackground(),
- listener);
+ JalviewColourChooser.showColourChooser(this, title,
+ colourPanel.getBackground(), listener);
}
/**