import jalview.commands.OrderCommand;
import jalview.datamodel.*;
import jalview.io.*;
+import jalview.schemes.GraduatedColor;
public class FeatureSettings extends JPanel
{
{
final Object typeMinMax = minmax.get(type);
final JCheckBoxMenuItem chb = new JCheckBoxMenuItem("Vary Height");
+ // this is broken at the moment
chb.setSelected(minmax.get(type) != null);
chb.addActionListener(new ActionListener()
{
});
men.add(chb);
+ if (typeMinMax != null && ((float[][]) typeMinMax)[0] != null)
+ {
+ // graduated colourschemes for those where minmax exists for the positional features
+ JMenuItem mxcol = new JMenuItem("Min Max Colour");
+ men.add(mxcol);
+ mxcol.addActionListener(new ActionListener()
+ {
+
+ public void actionPerformed(ActionEvent e)
+ {
+ new FeatureColourChooser(me, type);
+ }
+
+ });
+ }
}
men.show(table, x, y);
}
Object color, boolean isSelected, boolean hasFocus, int row,
int column)
{
- Color newColor = (Color) color;
- setBackground(newColor);
+ Color newColor;
+ color = fr.featureColours.get((String) table.getModel().getValueAt(
+ row, 0));
+ if (color instanceof GraduatedColor)
+ {
+ newColor = ((GraduatedColor) color).getMaxColor();
+ Color minCol = ((GraduatedColor) color).getMinColor();;
+ setBackground(newColor);
+ setToolTipText("RGB value: Max (" + newColor.getRed() + ", "
+ + newColor.getGreen() + ", " + newColor.getBlue()
+ + ")\nMin (" + minCol.getRed() + ", " + minCol.getGreen()
+ + ", " + minCol.getBlue() + ")");
+ }
+ else
+ {
+ newColor = (Color) color;
+ setBackground(newColor);
+ setToolTipText("RGB value: " + newColor.getRed() + ", "
+ + newColor.getGreen() + ", " + newColor.getBlue());
+ }
if (isSelected)
{
if (selectedBorder == null)
setBorder(unselectedBorder);
}
- setToolTipText("RGB value: " + newColor.getRed() + ", "
- + newColor.getGreen() + ", " + newColor.getBlue());
return this;
}
}