X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationRowFilter.java;fp=src%2Fjalview%2Fgui%2FAnnotationRowFilter.java;h=a3ce528e96313ed8bbcbbc55614f3c6215e64d73;hb=e0aacff0a162fdf1beb71cd5965b6ff4f8c9de0d;hp=1035a6c72e6f44ded96ec678e74eed295a240967;hpb=627a783b3535fc5ac2a2b2354ee3f61006f6c37f;p=jalview.git diff --git a/src/jalview/gui/AnnotationRowFilter.java b/src/jalview/gui/AnnotationRowFilter.java index 1035a6c..a3ce528 100644 --- a/src/jalview/gui/AnnotationRowFilter.java +++ b/src/jalview/gui/AnnotationRowFilter.java @@ -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