X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColourChooser.java;h=19eed276b20619c30d314068cdd1c484d4541508;hb=53de002c38eb8a89092e2febe977b78640a127bb;hp=699b560471bb8a4fe8e72b0cd3826f5af81dc20c;hpb=ead72caff9aef9b7103dbb15907aeae777200832;p=jalview.git diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index 699b560..19eed27 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(); @@ -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_thereshold_setting")); } thresholdIsMin.setSelected(acg.thresholdIsMinMax); thresholdValue.setText("" + acg.getAnnotationThreshold()); @@ -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); @@ -387,15 +387,18 @@ public class AnnotationColourChooser extends AnnotationRowFilter public void valueChanged(boolean updateAllAnnotation) { - if (currentColours.isSelected() - && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient)) + if (slider.isEnabled()) { - updateView(); + if (currentColours.isSelected() + && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient)) + { + updateView(); + } + getCurrentAnnotation().threshold.value = slider.getValue() / 1000f; + propagateSeqAssociatedThreshold(updateAllAnnotation, + getCurrentAnnotation()); + ap.paintAlignment(false); } - getCurrentAnnotation().threshold.value = slider.getValue() / 1000f; - propagateSeqAssociatedThreshold(updateAllAnnotation, - getCurrentAnnotation()); - ap.paintAlignment(false); } public JComboBox getThreshold() @@ -422,10 +425,6 @@ public class AnnotationColourChooser extends AnnotationRowFilter @Override public void updateView() { - changeColour(); - } - void changeColour() - { // Check if combobox is still adjusting if (adjusting) { @@ -453,9 +452,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)