Hi Dscho,<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">That was my first idea. But how would the user interface tell the callback<br>
without String or java.lang.reflect.Field ugliness which input was<br>
modified by the user (and by that, what field should be changed<br>
accordingly), and how would the callback tell that it changed something,<br>
and what?<br></blockquote>
<br>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.)<br>
<br>Does that clarify it? Or is there a problem I'm not seeing?<br><br>-Curtis<br><br><div class="gmail_quote">On Mon, Oct 11, 2010 at 2:11 PM, Johannes Schindelin <span dir="ltr"><<a href="mailto:Johannes.Schindelin@gmx.de">Johannes.Schindelin@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<div class="im"><br>
On Mon, 11 Oct 2010, Curtis Rueden wrote:<br>
<br>
> > No. The time I spent on the plugin design since March, I have tried to<br>
> > come up with a sensible architecture to handle something like "Keep<br>
> > aspect ratio" feedback (without requiring the developer to provide a<br>
> > metric ton of methods to that end). So far, I haven't been successful<br>
> > (a single check method has the disadvantage that it cannot set the<br>
> > other number automatically).<br>
><br>
> How about this:<br>
><br>
> @Parameter<br>
> public int width = 640;<br>
><br>
> @Parameter(label = "A double", digits = 3, columns = 5, units = "microns")<br>
> public int height = 480;<br>
><br>
> @Parameter(label = "Keep aspect ratio", callback = aspectRatioChanged)<br>
> public boolean keepAspectRatio = false;<br>
><br>
> So that the developer defines their own callback methods for each<br>
> parameter to which they want to react? Easy for each dialog<br>
> implementation to attach listeners and callback by reflection, right?<br>
<br>
</div>That was my first idea. But how would the user interface tell the callback<br>
without String or java.lang.reflect.Field ugliness which input was<br>
modified by the user (and by that, what field should be changed<br>
accordingly), and how would the callback tell that it changed something,<br>
and what?<br>
<br>
Ciao,<br>
Dscho<br>
<br>
</blockquote></div><br>