Re: Modifying the Macro Recorder
Posted by
dscho on
Jul 21, 2010; 8:35am
URL: http://imagej.273.s1.nabble.com/Modifying-the-Macro-Recorder-tp3687468p3687469.html
Hi,
On Tue, 20 Jul 2010, JonKaplan wrote:
> I am attempting to alter the Macro Recorder so that another plugin can
> be notified when the Recorder adds to its text.
>
> I tried to copy the source code and add an underscore (as outlined at
>
http://rsbweb.nih.gov/ij/docs/menus/plugins.html "Internal Plugins").
> The new Recorder_ plugin runs fine and looks identical but does not do
> any recording. I believe this stems from not knowing what calls the
> Recorder methods.
The problem is that your class will not be used, but the original one,
unless you put the .jar containing your class _in front of_ ij.jar in the
classpath.
But a much better way to do what you want to do is probably to register a
CommandListener:
http://rsb.info.nih.gov/ij/developer/api/ij/Executer.html#addCommandListener(ij.CommandListener)
This listener will be notified whenever an action occurred.
Ciao,
Johannes