Login  Register

Re: Java Compile Errors

Posted by David Webster on Feb 26, 2009; 6:28pm
URL: http://imagej.273.s1.nabble.com/Java-Compile-Errors-tp3693536p3693544.html

That works!!

On Thu, Feb 26, 2009 at 1:06 AM, Volker Bäcker
<[hidden email]>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello David,
> the problem is that there are no methods rename and imageCalculator in
> the class IJ. Remove
> "IJ.imageCalculator("Add create", "tim.bmp","test");"
> The next line in your code does this correctly.
> Replace "IJ.rename("test");" with "IJ.run("Rename...", "test");".
> Best regards,
> Volker Baecker
>
>
> David William Webster a écrit :
>  > I was just checking out the capability of converting a
> > Plugins/Macro/Record macro to a plugin, but get errors when I  use
> > File/Compile and Run. I am Java ignorant so I don't know what gives.
> >
> > My recorded macro is:
> >
> > run("Duplicate...", "title=tim-1.bmp");
> > rename("test");
> > run("Mean...", "radius=2");
> > imageCalculator("Add create", "tim.bmp","test");
> > //run("Image Calculator...", "image1=tim.bmp operation=Add image2=test
> > create");
> > selectWindow("test");
> >
> > The Java code is:
> > import ij.*;
> > import ij.process.*;
> > import ij.gui.*;
> > import java.awt.*;
> > import ij.plugin.*;
> >
> > public class test2plugin_ implements PlugIn {
> >
> >       public void run(String arg) {
> >               IJ.run("Duplicate...", "title=tim-1.bmp");
> >               IJ.rename("test");
> >               IJ.run("Mean...", "radius=2");
> >               IJ.imageCalculator("Add create", "tim.bmp","test");
> >               IJ.run("Image Calculator...", "image1=tim.bmp
> > operation=Add image2=test create");
> >               IJ.selectWindow("test");
> >       }
> >
> > }
> >
> > and the errors are:
> >
> > C:\Program Files\ImageJ\plugins\test2plugin_.java:11: cannot find symbol
> > symbol  : method rename(java.lang.String)
> > location: class ij.IJ
> >               IJ.rename("test");
> >                 ^
> > C:\Program Files\ImageJ\plugins\test2plugin_.java:13: cannot find symbol
> > symbol  : method imageCalculator
> > (java.lang.String,java.lang.String,java.lang.String)
> > location: class ij.IJ
> >               IJ.imageCalculator("Add create", "tim.bmp","test");
> >                 ^
> > 2 errors
> >
> > I just now took an automatic update for Java (1.6.0_10 [32 bit]), could
> > this be the problem? Sory for being so clueless.
> >
> > David Webster
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJpluixZKX7A/4oMERAmB6AJ43HUVJwFobi1dEvcVZDqBwbjt7EwCgu8+n
> OZAZGM64ysJANcjm92OhYaU=
> =ZD4m
> -----END PGP SIGNATURE-----
>
> --
> passerelle antivirus du campus CNRS de Montpellier
> --
>