X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColourChooser.java;h=f6352d7be728d628c9c636f1a5b6790a0fea7432;hb=d559b47886de6427219011e6e355320a0babd757;hp=3c6fd88f79386b5534cf2c0900c5e76924bfafa6;hpb=c03d2649512cdc491a46dda1d1370273241b5253;p=jalview.git diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index 3c6fd88..f6352d7 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -63,10 +63,6 @@ public class AnnotationColourChooser extends AnnotationRowFilter JButton defColours = new JButton(); - JButton ok = new JButton(); - - JButton cancel = new JButton(); - JPanel jPanel1 = new JPanel(); JPanel jPanel2 = new JPanel(); @@ -84,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()); } } } @@ -143,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()); @@ -212,7 +210,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - ok_actionPerformed(e); + ok_actionPerformed(); } }); cancel.setOpaque(false); @@ -222,7 +220,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - cancel_actionPerformed(e); + cancel_actionPerformed(); } }); defColours.setOpaque(false); @@ -235,7 +233,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent arg0) { - resetColours_actionPerformed(arg0); + resetColours_actionPerformed(); } }); @@ -244,7 +242,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - annotations_actionPerformed(e); + annotations_actionPerformed(); } }); getThreshold().addActionListener(new ActionListener() @@ -252,7 +250,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - threshold_actionPerformed(e); + threshold_actionPerformed(); } }); thresholdValue.addActionListener(new ActionListener() @@ -260,7 +258,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - thresholdValue_actionPerformed(e); + thresholdValue_actionPerformed(); } }); slider.setPaintLabels(false); @@ -280,7 +278,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent e) { - currentColours_actionPerformed(e); + currentColours_actionPerformed(); } }); thresholdIsMin.setBackground(Color.white); @@ -292,7 +290,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent actionEvent) { - thresholdIsMin_actionPerformed(actionEvent); + thresholdIsMin_actionPerformed(); } }); seqAssociated.setBackground(Color.white); @@ -305,7 +303,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent arg0) { - seqAssociated_actionPerformed(arg0, annotations, seqAssociated); + seqAssociated_actionPerformed(annotations); } }); @@ -334,7 +332,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter this.validate(); } - protected void resetColours_actionPerformed(ActionEvent arg0) + protected void resetColours_actionPerformed() { setDefaultMinMax(); updateView(); @@ -351,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); @@ -363,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); @@ -372,6 +372,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter updateView(); } + @Override public void reset() { av.setGlobalColourScheme(oldcs); @@ -380,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()) @@ -411,7 +413,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter this.threshold = threshold; } - public void currentColours_actionPerformed(ActionEvent e) + public void currentColours_actionPerformed() { if (currentColours.isSelected()) { @@ -452,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)