Merge branch 'develop' of https://source.jalview.org/git/jalview into features/JAL...
[jalview.git] / src / jalview / gui / AnnotationRowFilter.java
index 1035a6c..a3ce528 100644 (file)
@@ -129,8 +129,13 @@ public abstract class AnnotationRowFilter extends JPanel
     });
   }
 
+  /**
+   * update the text field from the threshold slider. preserves state of
+   * 'adjusting' so safe to call in init.
+   */
   protected void setThresholdValueText()
   {
+    boolean oldadj = adjusting;
     adjusting = true;
     if (percentThreshold.isSelected())
     {
@@ -141,7 +146,7 @@ public abstract class AnnotationRowFilter extends JPanel
     {
       thresholdValue.setText((slider.getValue() / 1000f) + "");
     }
-    adjusting = false;
+    adjusting = oldadj;
   }
   protected void addSliderMouseListeners()
   {
@@ -291,7 +296,7 @@ public abstract class AnnotationRowFilter extends JPanel
     try
     {
       float f = Float.parseFloat(thresholdValue.getText());
-      if (percentThreshold.isEnabled())
+      if (percentThreshold.isSelected())
       {
         slider.setValue(slider.getMinimum()
                 + ((int) ((f / 100f) * (slider.getMaximum() - slider