|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectimagej.patcher.LegacyEnvironment
public class LegacyEnvironment
Encapsulates an ImageJ 1.x "instance".
This class is a partner to the LegacyClassLoader, intended to make
sure that the ImageJ 1.x contained in a given class loader is patched and can
be accessed conveniently.
| Constructor Summary | |
|---|---|
LegacyEnvironment(ClassLoader loader,
boolean headless)
Constructs a new legacy environment. |
|
| Method Summary | |
|---|---|
ClassLoader |
getClassLoader()
Gets the class loader containing the ImageJ 1.x classes used in this legacy environment. |
static LegacyEnvironment |
getPatchedImageJ1()
Launches a fully-patched, self-contained ImageJ 1.x. |
void |
main(String... args)
Runs ImageJ.main(args) in the legacy environment. |
void |
run(String command,
String options)
Runs IJ.run(command, options) in the legacy environment. |
void |
runMacro(String macro,
String arg)
Runs IJ.runMacro(macro, arg) in the legacy environment. |
Object |
runPlugIn(String className,
String arg)
Runs IJ.runPlugIn(className, arg) in the legacy environment. |
void |
setMacroOptions(String options)
Sets the macro options. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LegacyEnvironment(ClassLoader loader,
boolean headless)
throws ClassNotFoundException
loader - the ClassLoader to use for loading the (patched)
ImageJ 1.x classes; if null, a LegacyClassLoader
is constructed.headless - whether to patch in support for headless operation
(compatible only with "well-behaved" plugins, i.e. plugins that do
not use graphical components directly)
ClassNotFoundException| Method Detail |
|---|
public void setMacroOptions(String options)
Both run(String, String) and runMacro(String, String)
take an argument that is typically recorded by the macro recorder. For
runPlugIn(String, String), however, only the arg parameter
that is to be passed to the plugins run() or setup() method
can be specified. For those use cases where one wants to call a plugin
class directly, but still provide macro options, this method is the
solution.
options - the macro options to use for the next call to
runPlugIn(String, String)
public void run(String command,
String options)
IJ.run(command, options) in the legacy environment.
command - the command to runoptions - the options to pass to the command
public void runMacro(String macro,
String arg)
IJ.runMacro(macro, arg) in the legacy environment.
macro - the macro code to runarg - an optional argument (which can be retrieved in the macro code
via getArgument())
public Object runPlugIn(String className,
String arg)
IJ.runPlugIn(className, arg) in the legacy environment.
className - the plugin class to runarg - an optional argument (which get passed to the run() or
setup() method of the plugin)public void main(String... args)
ImageJ.main(args) in the legacy environment.
args - the arguments to pass to the main() methodpublic ClassLoader getClassLoader()
public static LegacyEnvironment getPatchedImageJ1()
throws ClassNotFoundException
ClassNotFoundException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||