X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureSettings.java;h=f5580b91fbe8229201da2ae63a12b639467a84c6;hb=d2e7e2612a39826b30cf92889441ce99b36e7a40;hp=db93724bd332f22bed87db6c18a160fcc66ea5d9;hpb=79912985d2d21c7d456bbd2281ed84fdfe2e99e7;p=jalview.git diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index db93724..f5580b9 100755 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -34,6 +34,7 @@ import jalview.analysis.AlignmentSorter; import jalview.commands.OrderCommand; import jalview.datamodel.*; import jalview.io.*; +import jalview.schemes.GraduatedColor; public class FeatureSettings extends JPanel { @@ -202,6 +203,7 @@ 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() { @@ -221,6 +223,21 @@ public class FeatureSettings extends JPanel }); 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); } @@ -1227,8 +1244,26 @@ public class FeatureSettings extends JPanel 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) @@ -1248,8 +1283,6 @@ public class FeatureSettings extends JPanel setBorder(unselectedBorder); } - setToolTipText("RGB value: " + newColor.getRed() + ", " - + newColor.getGreen() + ", " + newColor.getBlue()); return this; } }