scijava-common
scijava-common copied to clipboard
Set default value for primitive parameters based on bounds
#@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.
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).
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
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