ImageJ Macro Recorder and Generic Dialog

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ImageJ Macro Recorder and Generic Dialog

jumpfunky
Hi,

I'm developing a plugin including a generic dialog with parameter labels
which contain spaces. If you use the macro recorder, it recognizes only
the word up to the first space. This could lead to problems if the first
word is the same in both labels, e.g.:
"Area Min. Enclosing Rectangle"
"Area Max. Enclosing Rectangle"

The recorder will only record run("my plugin", "area=x area=y") and the
value x / y doesn't have any effect.

Maybe a bug?

Cheers,
Thorsten

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ Macro Recorder and Generic Dialog

gankaku
Hi Thorsten,

I guess not a bug. If you put underscores between the words you record the
complete parameter.

Regards
Jan


2014-07-12 13:39 GMT+02:00 Thorsten Wagner <[hidden email]>:

> Hi,
>
> I'm developing a plugin including a generic dialog with parameter labels
> which contain spaces. If you use the macro recorder, it recognizes only
> the word up to the first space. This could lead to problems if the first
> word is the same in both labels, e.g.:
> "Area Min. Enclosing Rectangle"
> "Area Max. Enclosing Rectangle"
>
> The recorder will only record run("my plugin", "area=x area=y") and the
> value x / y doesn't have any effect.
>
> Maybe a bug?
>
> Cheers,
> Thorsten
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--

CEO: Dr. rer. nat. Jan Brocher
phone:  +49 (0)6234 917 03 39
mobile: +49 (0)176 705 746 81
e-mail: [hidden email]
info: [hidden email]
inquiries: [hidden email]
web: www.biovoxxel.de

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ Macro Recorder and Generic Dialog

jumpfunky
In reply to this post by jumpfunky
Hi Tiago, hi Jan,

thanks for your response. That helped a lot!

Cheers,
Thorsten

Am Samstag, den 12.07.2014, 09:15 -0400 schrieb Tiago Ferreira:

> Hi Thorsten,
>
> On Jul 12, 2014, at 07:39, Thorsten Wagner <[hidden email]> wrote:
> > The recorder will only record run("my plugin", "area=x area=y") and the
> > value x / y doesn't have any effect.
>
>
> You will have to use underscores to make them unique, e.g.:
>
>     "Area_Min Enclosing Rectangle"
>     "Area_Max Enclosing Rectangle"
>
> or perhaps:
>
>     int min=10, max=100;
>     GenericDialog gd = new GenericDialog("Unique Labels");
>     gd.addMessage("Settings for Enclosing Rectangle:");
>     gd.addNumericField("Min Area", min, 0);
>     gd.addNumericField("Max Area", max, 0);
>     gd.showDialog();
>
>
> from http://imagej.nih.gov/ij/developer/api/ij/gui/GenericDialog.html:
>
> To work with macros, the first word of each component label must be unique.
> If this is not the case, add underscores, which will be converted to spaces
> when the dialog is displayed. For example, change the checkbox labels
>
> "Show Quality" and "Show Residue" to "Show_Quality" and "Show_Residue".
>
>
> -tiago
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html