scijava-common icon indicating copy to clipboard operation
scijava-common copied to clipboard

Set default value for primitive parameters based on bounds

Open bogovicj opened this issue 7 years ago • 3 comments

#@double(label="A double", min=2.5, max=12.5, persist=false ) my_double
#@int(label="An int", min=2, max=12, persist=false ) my_int

Set their initial values to zero, which is out of range.

Using objects instead:

#@Double(label="A Double object", min=2.5, max=5.5, persist=false ) my_Double
#@Integer(label="An Integer object", min=2, max=12, persist=false ) my_Integer

sets values to 2.5 and 2, respectively (the min of the range). I would expect the primitive parameters to have the same behavior.

bogovicj avatar Oct 27 '17 18:10 bogovicj

Also, even when entering an out-of-range value in the text field, the spinner arrows should do the right thing and set the value back to min or max (but this is a scijava-ui-swing issue).

imagejan avatar Oct 27 '17 20:10 imagejan

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/ops-specifying-default-integer-parameters/7612/4

imagesc-bot avatar Nov 04 '20 14:11 imagesc-bot

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/change-scijava-parameter-label-at-runtime/60574/6

imagesc-bot avatar Dec 04 '21 18:12 imagesc-bot