[ImageJ-devel] Design meeting notes

Lee Kamentsky leek at broadinstitute.org
Tue Oct 12 07:52:03 CDT 2010


  On 10/11/2010 3:11 PM, Johannes Schindelin wrote:
> Hi,
...
>>      @Parameter(label = "Keep aspect ratio", callback = aspectRatioChanged)
>>      public boolean keepAspectRatio = false;
>>
>> So that the developer defines their own callback methods for each
>> parameter to which they want to react? Easy for each dialog
>> implementation to attach listeners and callback by reflection, right?
> That was my first idea. But how would the user interface tell the callback
> without String or java.lang.reflect.Field ugliness which input was
> modified by the user (and by that, what field should be changed
> accordingly), and how would the callback tell that it changed something,
> and what?
>
I'd pick a signature that was pretty generic. The callback 
implementation strategy might be to reevaluate everything when anything 
changed. For the above, if there were aspect ratio and some other 
parameter, say, "intensity" with log and linear options, you'd redo the 
whole image, applying the new aspect ratio and the new intensity transform.

Hopefully, the plugin would get the context by specifying different 
callbacks for each parameter?

You could also put in some sort of validation mechanism - the callback 
can throw an exception to reject the proposed change...
> Ciao,
> Dscho
>





More information about the ImageJ-devel mailing list