scijava / scijava-common

A plugin framework and application container with built-in extensibility mechanism :electric_plug:
BSD 2-Clause "Simplified" License
87 stars 52 forks source link

Set default value for primitive parameters based on bounds #303

Open bogovicj opened 6 years ago

bogovicj commented 6 years ago
#@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.

imagejan commented 6 years ago

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

imagesc-bot commented 3 years ago

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 commented 2 years ago

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