import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceI;
+import jalview.gui.JalviewColourChooser.ColourChooserListener;
import jalview.renderer.AnnotationRenderer;
import jalview.renderer.AwtRenderPanelI;
+import jalview.schemes.FeatureColour;
import jalview.schemes.ResidueProperties;
import jalview.util.Comparison;
import jalview.util.MessageManager;
import java.util.List;
import javax.swing.JColorChooser;
+import javax.swing.JDialog;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
}
else if (action.equals(COLOUR))
{
- Color col = JColorChooser.showDialog(this,
- MessageManager.getString("label.select_foreground_colour"),
- Color.black);
-
- for (int index : av.getColumnSelection().getSelected())
+ final Annotation[] fAnot = anot;
+ String title = MessageManager
+ .getString("label.select_foreground_colour");
+ ColourChooserListener listener = new ColourChooserListener()
{
- if (!av.getAlignment().getHiddenColumns().isVisible(index))
- {
- continue;
- }
-
- if (anot[index] == null)
+ @Override
+ public void colourSelected(Color c)
{
- anot[index] = new Annotation("", "", ' ', 0);
- }
-
- anot[index].colour = col;
- }
+ HiddenColumns hiddenColumns = av.getAlignment().getHiddenColumns();
+ for (int index : av.getColumnSelection().getSelected())
+ {
+ if (hiddenColumns.isVisible(index))
+ {
+ if (fAnot[index] == null)
+ {
+ fAnot[index] = new Annotation("", "", ' ', 0);
+ }
+ fAnot[index].colour = c;
+ }
+ }};
+ };
+ JalviewColourChooser.showColourChooser(this,
+ title, Color.black, listener);
}
else
// HELIX, SHEET or STEM