[ImageJ-devel] Design meeting notes

Curtis Rueden ctrueden at wisc.edu
Tue Oct 12 09:12:06 CDT 2010


Hi Dscho,

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?
>

Each parameter has its own callback method, invoked when that particular
parameter changes. So as Lee said, which method is called indicates which
parameter was changed. (Perhaps it would be better to call the attribute
something like "onChange" instead.)

Does that clarify it? Or is there a problem I'm not seeing?

-Curtis

On Mon, Oct 11, 2010 at 2:11 PM, Johannes Schindelin <
Johannes.Schindelin at gmx.de> wrote:

> Hi,
>
> 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?
>
> Ciao,
> Dscho
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20101012/e0e07b4e/attachment.html>


More information about the ImageJ-devel mailing list