[ImageJ-devel] Design meeting notes

Johannes Schindelin Johannes.Schindelin at gmx.de
Mon Oct 11 14:11:21 CDT 2010


On Mon, 11 Oct 2010, Curtis Rueden wrote:

> > No. The time I spent on the plugin design since March, I have tried to 
> > come up with a sensible architecture to handle something like "Keep 
> > aspect ratio" feedback (without requiring the developer to provide a 
> > metric ton of methods to that end). So far, I haven't been successful 
> > (a single check method has the disadvantage that it cannot set the 
> > other number automatically).
> How about this:
>     @Parameter
>     public int width = 640;
>     @Parameter(label = "A double", digits = 3, columns = 5, units = "microns")
>     public int height = 480;
>     @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?


More information about the ImageJ-devel mailing list