/** * BeanShell03.bsh * IJ BAR: https://github.com/tferr/Scripts#scripts * ************************************************* * 3. Imports statements * ************************************************* */ // Importing classes from Java packages works exactly // as in Java, but in a more flexible way since import // statements can occur anywhere in a script: import java.lang.Math; print("Line 13: PI="+ Math.PI); // http://javadoc.imagej.net/Java7/index.html?java/lang/Math.html // Importing the class IJ in the ij package import ij.IJ; print("Line 17: We're running IJ" + IJ.getVersion()); //http://javadoc.imagej.net/ImageJ1/index.html?ij/IJ.html // As in Java, we can also specify the fully qualified // class name without an import declaration as long as // ImageJ is aware of it, i.e., the class is in our // CLASSPATH[1]. Here is an example: print("Line 23: We're running IJ" + ij.IJ.getVersion()); //http://javadoc.imagej.net/ImageJ1/index.html?ij/IJ.html // [1] https://en.wikipedia.org/wiki/Classpath_(Java) // To know more: http://www.beanshell.org/manual/