Merge branch 'Release_2_8_3_Branch' of https://source.jalview.org/git/jalview into...
[jalview.git] / src / jalview / gui / AnnotationColourChooser.java
index 699b560..c8dd889 100644 (file)
@@ -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,9 +63,6 @@ public class AnnotationColourChooser extends AnnotationRowFilter
 
   JButton defColours = new JButton();
 
-  JButton ok = new JButton();
-
-  JButton cancel = new JButton();
 
   JPanel jPanel1 = new JPanel();
 
@@ -387,15 +384,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<String> getThreshold()
@@ -422,10 +422,6 @@ public class AnnotationColourChooser extends AnnotationRowFilter
   @Override
   public void updateView()
   {
-    changeColour();
-  }
-  void changeColour()
-  {
     // Check if combobox is still adjusting
     if (adjusting)
     {