X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FFeatureColourChooser.java;h=d0834e610f3a691b211d6cb2f682858a803b7350;hb=refs%2Fheads%2Ffeatures%2FJAL-2094_colourInterface;hp=3c04ccdd18835bb336327f69155d0077864f49c2;hpb=0b1c761dfaa8242f122cf868e8897a06ec6eb727;p=jalview.git diff --git a/src/jalview/appletgui/FeatureColourChooser.java b/src/jalview/appletgui/FeatureColourChooser.java index 3c04ccd..d0834e6 100644 --- a/src/jalview/appletgui/FeatureColourChooser.java +++ b/src/jalview/appletgui/FeatureColourChooser.java @@ -23,7 +23,9 @@ package jalview.appletgui; import jalview.api.FeatureColourI; import jalview.datamodel.GraphLine; import jalview.schemes.AnnotationColourGradient; +import jalview.schemes.Colour; import jalview.schemes.FeatureColour; +import jalview.util.ColorUtils; import jalview.util.MessageManager; import java.awt.Checkbox; @@ -106,15 +108,16 @@ public class FeatureColourChooser extends Panel implements ActionListener, Color bl = Color.black; if (oldcs.isSimpleColour()) { - bl = oldcs.getColour(); + bl = ColorUtils.getColor(oldcs.getColour()); } // original colour becomes the maximum colour - cs = new FeatureColour(Color.white, bl, mm[0], mm[1]); + cs = new FeatureColour(new Colour(Color.white), new Colour(bl), + mm[0], mm[1]); } - minColour.setBackground(cs.getMinColour()); - maxColour.setBackground(cs.getMaxColour()); - minColour.setForeground(cs.getMinColour()); - maxColour.setForeground(cs.getMaxColour()); + minColour.setBackground(ColorUtils.getColor(cs.getMinColour())); + maxColour.setBackground(ColorUtils.getColor(cs.getMaxColour())); + minColour.setForeground(ColorUtils.getColor(cs.getMinColour())); + maxColour.setForeground(ColorUtils.getColor(cs.getMaxColour())); colourFromLabel.setState(cs.isColourByLabel()); adjusting = true; @@ -191,11 +194,11 @@ public class FeatureColourChooser extends Panel implements ActionListener, jPanel4.setBackground(Color.white); threshold.addItemListener(this); threshold.addItem(MessageManager - .getString("label.threshold_feature_no_thereshold")); + .getString("label.threshold_feature_no_threshold")); threshold.addItem(MessageManager - .getString("label.threshold_feature_above_thereshold")); + .getString("label.threshold_feature_above_threshold")); threshold.addItem(MessageManager - .getString("label.threshold_feature_below_thereshold")); + .getString("label.threshold_feature_below_threshold")); thresholdValue.addActionListener(this); slider.setBackground(Color.white); slider.setEnabled(false); @@ -313,9 +316,9 @@ public class FeatureColourChooser extends Panel implements ActionListener, // ap.paintAlignment(false); } - public void minColour_actionPerformed(Color newCol) + public void minColour_actionPerformed(Color c) { - if (newCol == null) + if (c == null) { UserDefinedColours udc = new UserDefinedColours(this, minColour.getBackground(), owner, @@ -323,8 +326,8 @@ public class FeatureColourChooser extends Panel implements ActionListener, } else { - minColour.setBackground(newCol); - minColour.setForeground(newCol); + minColour.setBackground(c); + minColour.setForeground(c); minColour.repaint(); changeColour(); } @@ -371,8 +374,9 @@ public class FeatureColourChooser extends Panel implements ActionListener, slider.setEnabled(true); thresholdValue.setEnabled(true); - FeatureColour acg = new FeatureColour(minColour.getBackground(), - maxColour.getBackground(), min, max); + FeatureColour acg = new FeatureColour(new Colour( + minColour.getBackground()), new Colour( + maxColour.getBackground()), min, max); acg.setColourByLabel(colourFromLabel.getState()); maxColour.setEnabled(!colourFromLabel.getState());