Re: Odd behavior from Threshold
Posted by dscho on Nov 19, 2011; 3:46am
URL: http://imagej.273.s1.nabble.com/Odd-behavior-from-Threshold-tp3682526p3682527.html
Hi Bob,
On Fri, 18 Nov 2011, Bob Loushin wrote:
> I am writing a plugin that needs to fit into the following workflow:
>
> User opens image.
> User runs plugin.
> The plugin opens the threshold window, and waits until the user has made an adjustment and hit "Apply".
> The plugin does the thresholding, then does other stuff, then ends.
> User saves image, opens new one, runs plugin again....
Relying on threads' names is inherently unsafe.
Better to iterate the components in the ThreadAdjuster and put a listener
to the Apply button. But even that is suboptimal design.
The best would be to have a NonBlockingGenericDialog whose button the user
should press instead of the Apply button. That'll be always safe and does
not require any hackery.
Ciao,
Johannes