X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureTypeSettings.java;h=060d97648cdfb62875260db2c2335fdd4b23b6c4;hb=4c132b37c867a60959dae032addd78892d996345;hp=1ba24b5d1a5e0d8444354155aee03a5de8fe8f4d;hpb=7fb89dadbc3eac97602fc84e519014582abe4649;p=jalview.git diff --git a/src/jalview/gui/FeatureTypeSettings.java b/src/jalview/gui/FeatureTypeSettings.java index 1ba24b5..060d976 100644 --- a/src/jalview/gui/FeatureTypeSettings.java +++ b/src/jalview/gui/FeatureTypeSettings.java @@ -362,7 +362,7 @@ public class FeatureTypeSettings extends JalviewDialog : BELOW_THRESHOLD_OPTION); slider.setEnabled(true); slider.setValue((int) (fc.getThreshold() * scaleFactor)); - thresholdValue.setText(String.valueOf(getRoundedSliderValue())); + thresholdValue.setText(String.valueOf(fc.getThreshold())); thresholdValue.setEnabled(true); thresholdIsMin.setEnabled(true); } @@ -651,6 +651,7 @@ public class FeatureTypeSettings extends JalviewDialog { thresholdValue .setText(String.valueOf(slider.getValue() / scaleFactor)); + thresholdValue.setBackground(Color.white); // to reset red for invalid sliderValueChanged(); } } @@ -1033,21 +1034,23 @@ public class FeatureTypeSettings extends JalviewDialog { try { + /* + * set 'adjusting' flag while moving the slider, so it + * doesn't then in turn change the value (with rounding) + */ adjusting = true; float f = Float.parseFloat(thresholdValue.getText()); + f = Float.max(f, this.min); + f = Float.min(f, this.max); + thresholdValue.setText(String.valueOf(f)); slider.setValue((int) (f * scaleFactor)); threshline.value = f; thresholdValue.setBackground(Color.white); // ok - - /* - * force repaint of any Overview window or structure - */ - ap.paintAlignment(true, true); + adjusting = false; + colourChanged(true); } catch (NumberFormatException ex) { thresholdValue.setBackground(Color.red); // not ok - } finally - { adjusting = false; } }