X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColourChooser.java;h=f6352d7be728d628c9c636f1a5b6790a0fea7432;hb=7c19c72efd3433b14f845c265747010d9dc596cc;hp=c8dd889c94d51df951d87fb573c2386edd46ce04;hpb=ad15cff29620f960119f80176f1fd443da9f6763;p=jalview.git diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index c8dd889..f6352d7 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -63,7 +63,6 @@ public class AnnotationColourChooser extends AnnotationRowFilter JButton defColours = new JButton(); - JPanel jPanel1 = new JPanel(); JPanel jPanel2 = new JPanel(); @@ -81,9 +80,9 @@ public class AnnotationColourChooser extends AnnotationRowFilter oldgroupColours = new Hashtable(); for (SequenceGroup sg : ap.av.getAlignment().getGroups()) { - if (sg.cs != null) + if (sg.getColourScheme() != null) { - oldgroupColours.put(sg, sg.cs); + oldgroupColours.put(sg, sg.getColourScheme()); } } } @@ -140,7 +139,9 @@ public class AnnotationColourChooser extends AnnotationRowFilter getThreshold().setSelectedIndex(2); break; default: - throw new Error(MessageManager.getString("error.implementation_error_dont_know_about_thereshold_setting")); + throw new Error( + MessageManager + .getString("error.implementation_error_dont_know_about_threshold_setting")); } thresholdIsMin.setSelected(acg.thresholdIsMinMax); thresholdValue.setText("" + acg.getAnnotationThreshold()); @@ -209,7 +210,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - ok_actionPerformed(e); + ok_actionPerformed(); } }); cancel.setOpaque(false); @@ -219,7 +220,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - cancel_actionPerformed(e); + cancel_actionPerformed(); } }); defColours.setOpaque(false); @@ -232,7 +233,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent arg0) { - resetColours_actionPerformed(arg0); + resetColours_actionPerformed(); } }); @@ -241,7 +242,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - annotations_actionPerformed(e); + annotations_actionPerformed(); } }); getThreshold().addActionListener(new ActionListener() @@ -249,7 +250,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - threshold_actionPerformed(e); + threshold_actionPerformed(); } }); thresholdValue.addActionListener(new ActionListener() @@ -257,7 +258,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - thresholdValue_actionPerformed(e); + thresholdValue_actionPerformed(); } }); slider.setPaintLabels(false); @@ -277,7 +278,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - currentColours_actionPerformed(e); + currentColours_actionPerformed(); } }); thresholdIsMin.setBackground(Color.white); @@ -289,7 +290,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent actionEvent) { - thresholdIsMin_actionPerformed(actionEvent); + thresholdIsMin_actionPerformed(); } }); seqAssociated.setBackground(Color.white); @@ -302,7 +303,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent arg0) { - seqAssociated_actionPerformed(arg0, annotations, seqAssociated); + seqAssociated_actionPerformed(annotations); } }); @@ -331,7 +332,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter this.validate(); } - protected void resetColours_actionPerformed(ActionEvent arg0) + protected void resetColours_actionPerformed() { setDefaultMinMax(); updateView(); @@ -348,7 +349,8 @@ public class AnnotationColourChooser extends AnnotationRowFilter public void minColour_actionPerformed() { Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_colour_minimum_value"), minColour.getBackground()); + MessageManager.getString("label.select_colour_minimum_value"), + minColour.getBackground()); if (col != null) { minColour.setBackground(col); @@ -360,7 +362,8 @@ public class AnnotationColourChooser extends AnnotationRowFilter public void maxColour_actionPerformed() { Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_colour_maximum_value"), maxColour.getBackground()); + MessageManager.getString("label.select_colour_maximum_value"), + maxColour.getBackground()); if (col != null) { maxColour.setBackground(col); @@ -369,6 +372,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter updateView(); } + @Override public void reset() { av.setGlobalColourScheme(oldcs); @@ -377,11 +381,12 @@ public class AnnotationColourChooser extends AnnotationRowFilter for (SequenceGroup sg : ap.av.getAlignment().getGroups()) { - sg.cs = oldgroupColours.get(sg); + sg.setColourScheme(oldgroupColours.get(sg)); } } } + @Override public void valueChanged(boolean updateAllAnnotation) { if (slider.isEnabled()) @@ -408,7 +413,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter this.threshold = threshold; } - public void currentColours_actionPerformed(ActionEvent e) + public void currentColours_actionPerformed() { if (currentColours.isSelected()) { @@ -449,9 +454,10 @@ public class AnnotationColourChooser extends AnnotationRowFilter && getCurrentAnnotation().threshold == null) { getCurrentAnnotation() - .setThreshold(new jalview.datamodel.GraphLine( - (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f, - "Threshold", Color.black)); + .setThreshold( + new jalview.datamodel.GraphLine( + (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f, + "Threshold", Color.black)); } if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD)