Hi,
On Fri, 10 Feb 2006, Vincenzo Della Mea wrote:
> I just found a somewhat old message to which I'm interested, by Johannes
> Schindelin:
>
> > - call-java-functions-from-macros: in the same complex setup mentioned
> > above, sometimes it is overkill to run a plugin to set local variables.
> > Instead, this patch provides the macro function "runJava", which can
> > call public static methods returning a String with an arbitrary number
> > of String parameters. Example:
> >
> > org.anism.SomeClass contains the method
> >
> > public static String getName(String id);
> >
> > the macro can now call that method:
> >
> > theName = runJava("org.anism.SomeClass","getName","0023");
>
> Has this patch been approved and put in the ImageJ distribution?
No. Wayne said he did not like the way the arguments are passed, and would
have preferred something like
theName = runJava("org.anism.SomeClass", "title=getName value=23");
Alas, the class files do not store the names of the arguments. So there is
no way to change to that behaviour.
Note that ImageJA contains this patch.
> By the way, I would be interested in obtaining some result from plugins, that
> could be used into macros.
I made another patch for that, where you could set local variables from a
plugin (if called from a macro, of course). I don't know about its
status...
Ciao,
Dscho