git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1554f4b
)
JAL-3125 avoid slider 'rounding' threshold field value
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Wed, 26 Sep 2018 11:05:01 +0000
(12:05 +0100)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Mon, 14 Jan 2019 14:02:55 +0000
(14:02 +0000)
src/jalview/gui/FeatureTypeSettings.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/FeatureTypeSettings.java
b/src/jalview/gui/FeatureTypeSettings.java
index
55bc519
..
43a9e6a
100644
(file)
--- a/
src/jalview/gui/FeatureTypeSettings.java
+++ b/
src/jalview/gui/FeatureTypeSettings.java
@@
-366,7
+366,8
@@
public class FeatureTypeSettings extends JalviewDialog
: BELOW_THRESHOLD_OPTION);
slider.setEnabled(true);
slider.setValue((int) (fc.getThreshold() * scaleFactor));
: BELOW_THRESHOLD_OPTION);
slider.setEnabled(true);
slider.setValue((int) (fc.getThreshold() * scaleFactor));
- thresholdValue.setText(String.valueOf(getRoundedSliderValue()));
+ float roundedSliderValue = getRoundedSliderValue();
+ thresholdValue.setText(String.valueOf(fc.getThreshold()));// roundedSliderValue));
thresholdValue.setEnabled(true);
thresholdIsMin.setEnabled(true);
}
thresholdValue.setEnabled(true);
thresholdIsMin.setEnabled(true);
}
@@
-1019,21
+1020,23
@@
public class FeatureTypeSettings extends JalviewDialog
{
try
{
{
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());
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
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
} catch (NumberFormatException ex)
{
thresholdValue.setBackground(Color.red); // not ok
- } finally
- {
adjusting = false;
}
}
adjusting = false;
}
}