MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / addSlider

Method addSlider

ij/src/main/java/ij/gui/GenericDialog.java:951–964  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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) {

Callers 15

runMethod · 0.95
showDialogMethod · 0.95
showDialogMethod · 0.95
addFloatSliderMethod · 0.95
getColorMethod · 0.95
showDialogMethod · 0.95
showMainPanelMethod · 0.95
showMoreCurvesPanelMethod · 0.95
doDialogMethod · 0.45
rectToolOptionsMethod · 0.45
showDialogMethod · 0.45
arrowToolOptionsMethod · 0.45

Calls 15

digitsMethod · 0.95
isMacOSXMethod · 0.95
d2sMethod · 0.95
makeLabelMethod · 0.95
getInsetsMethod · 0.95
logMethod · 0.95
fixScrollbarMethod · 0.95
isWindowsMethod · 0.95
newTextFieldMethod · 0.95
recordingMethod · 0.95
saveLabelMethod · 0.95
addAdjustmentListenerMethod · 0.80

Tested by

no test coverage detected