+ g.drawString(MessageManager
+ .getString("label.no_features_added_to_this_alignment"), 10, 20);
+ g.drawString(MessageManager
+ .getString("label.features_can_be_added_from_searches_1"), 10,
+ 40);
+ g.drawString(MessageManager
+ .getString("label.features_can_be_added_from_searches_2"), 10,
+ 60);
+ }
+
+ protected void popupSort(final MyCheckbox check,
+ final Map<String, float[][]> minmax, int x, int y)
+ {
+ final String type = check.type;
+ final FeatureColourI typeCol = fr.getFeatureStyle(type);
+ PopupMenu men = new PopupMenu(MessageManager.formatMessage(
+ "label.settings_for_type", new String[] { type }));
+ java.awt.MenuItem scr = new MenuItem(
+ MessageManager.getString("label.sort_by_score"));
+ men.add(scr);
+ final FeatureSettings me = this;
+ scr.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ me.ap.alignFrame.avc.sortAlignmentByFeatureScore(Arrays
+ .asList(new String[] { type }));
+ }
+
+ });
+ MenuItem dens = new MenuItem(
+ MessageManager.getString("label.sort_by_density"));
+ dens.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ me.ap.alignFrame.avc.sortAlignmentByFeatureDensity(Arrays
+ .asList(new String[] { type }));
+ }
+
+ });
+ men.add(dens);
+
+ if (minmax != null)
+ {
+ final float[][] typeMinMax = minmax.get(type);
+ /*
+ * final java.awt.CheckboxMenuItem chb = new
+ * java.awt.CheckboxMenuItem("Vary Height"); // this is broken at the
+ * moment chb.setState(minmax.get(type) != null);
+ * chb.addActionListener(new ActionListener() {
+ *
+ * public void actionPerformed(ActionEvent e) {
+ * chb.setState(chb.getState()); if (chb.getState()) { minmax.put(type,
+ * null); } else { minmax.put(type, typeMinMax); } }
+ *
+ * }); men.add(chb);
+ */
+ if (typeMinMax != null && typeMinMax[0] != null)
+ {
+ // graduated colourschemes for those where minmax exists for the
+ // positional features
+ MenuItem mxcol = new MenuItem(
+ (typeCol.isSimpleColour()) ? "Graduated Colour"
+ : "Single Colour");
+ men.add(mxcol);
+ mxcol.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ if (typeCol.isSimpleColour())
+ {
+ new FeatureColourChooser(me, type);
+ // write back the current colour object to update the table
+ check.updateColor(fr.getFeatureStyle(type));
+ }
+ else
+ {
+ new UserDefinedColours(me, check.type, typeCol);
+ }
+ }
+
+ });
+ }
+ }
+
+ MenuItem selectContaining = new MenuItem(
+ MessageManager.getString("label.select_columns_containing"));
+ selectContaining.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ me.ap.alignFrame.avc.markColumnsContainingFeatures(false, false,
+ false, type);
+ }
+ });
+ men.add(selectContaining);
+
+ MenuItem selectNotContaining = new MenuItem(
+ MessageManager.getString("label.select_columns_not_containing"));
+ selectNotContaining.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ me.ap.alignFrame.avc.markColumnsContainingFeatures(true, false,
+ false, type);
+ }
+ });
+ men.add(selectNotContaining);
+
+ MenuItem hideContaining = new MenuItem(
+ MessageManager.getString("label.hide_columns_containing"));
+ hideContaining.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hideFeatureColumns(type, true);
+ }
+ });
+ men.add(hideContaining);
+
+ MenuItem hideNotContaining = new MenuItem(
+ MessageManager.getString("label.hide_columns_not_containing"));
+ hideNotContaining.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hideFeatureColumns(type, false);
+ }
+ });
+ men.add(hideNotContaining);
+
+ this.featurePanel.add(men);
+ men.show(this.featurePanel, x, y);