Re: plugin writing with FIJI editor
Posted by dpoburko on Mar 24, 2011; 7:58pm
URL: http://imagej.273.s1.nabble.com/Re-plugin-writing-with-FIJI-editor-tp3685297.html
Hi All,
Please bare with me for a super newbie questio. I'm trying to
transition from macro writing to propper plugins, and I've started using
FIJI's script editor. I'm writing in Java as opposed to javascript or
some of the other options.
Here is my question. When I make a change to my code, save the
changes and "compile and run", is it normal that the compiler does not
taken the changes in the code into account. For example in the fallowing
code, if I change the starting value of "width" from 512 to say 510,
then save>compile and run, the change in the value is not reflected in
the dialog box. It seems like I have to restart Fiji for the change to
be recognized. I'm sure this isn't normal behaviour, so what am I missing?
Any help would be greatly appreciated.
Damon
public class Generic_Dialog_Example implements PlugIn {
static String title="Example";
static int width=512,height=512;
public void run(String arg) {
GenericDialog gd = new GenericDialog("New Image");
gd.addStringField("Title: ", title);
gd.addNumericField("Width: ", width, 0);
gd.addNumericField("Height: ", height, 0);
gd.showDialog();
if (gd.wasCanceled()) return;
title = gd.getNextString();
width = (int)gd.getNextNumber();
height = (int)gd.getNextNumber();
IJ.run("New...", "name="+title+" type='8-bit Unsigned' width="+width+" height="+height);
}
}