Adds a slider (scroll bar) to the dialog box. Floating point values are used if (maxValue-minValue)<=5.0 and either defaultValue or minValue are non-integer. @param label the label @param minValue the minimum value of the slider @param maxValue the maximum value of the slider @param defaultValue
(String label, double minValue, double maxValue, double defaultValue)
| 949 | * @param defaultValue the initial value of the slider |
| 950 | */ |
| 951 | public void addSlider(String label, double minValue, double maxValue, double defaultValue) { |
| 952 | if (defaultValue<minValue) defaultValue=minValue; |
| 953 | if (defaultValue>maxValue) defaultValue=maxValue; |
| 954 | int digits = 0; |
| 955 | double scale = 1.0; |
| 956 | if ((maxValue-minValue)<=5.0 && (minValue!=(int)minValue||maxValue!=(int)maxValue||defaultValue!=(int)defaultValue)) { |
| 957 | scale = 50.0; |
| 958 | minValue *= scale; |
| 959 | maxValue *= scale; |
| 960 | defaultValue *= scale; |
| 961 | digits = 2; |
| 962 | } |
| 963 | addSlider( label, minValue, maxValue, defaultValue, scale, digits); |
| 964 | } |
| 965 | |
| 966 | @AstroImageJ(reason = "float slider, primarily for aperture radius") |
| 967 | public void addFloatSlider(String label, double minValue, double maxValue, double defaultValue, int digits, double stepSize) { |
no test coverage detected