public class Runner extends Object
Constructor and Description |
---|
Runner(boolean silent)
Constructor relying on IJ1.
|
Runner(Context context)
Default constructor-based dependency injection
|
Modifier and Type | Method and Description |
---|---|
File |
getLastLoadedResource() |
String |
getStatus() |
void |
installIJ1Macro(String path) |
void |
installIJ1Macro(String path,
boolean singleTool) |
Boolean |
isSilent()
return
true if the LogService is not logging errors. |
static void |
main(String... args)
Debug method
|
void |
openLastLoadedResource() |
String |
readContents(String resourcePath) |
String |
readContents(URL url,
boolean setGlobalFlags) |
void |
runBARMacro(String path,
String arg)
Legacy method that supports IJ1 macros that do not use script parameters.
|
void |
runIJ1Macro(String path,
String arg)
Legacy method that supports IJ1 macros that do not use script parameters.
|
void |
runScript(InputStream in,
String filename)
Runs a script from an InputStream.
|
void |
runScript(InputStream in,
String filename,
Map<String,Object> inputMap)
Runs a script from a jar file.
|
void |
runScript(String path)
Runs a (JARified) BAR script.
|
void |
runScript(String path,
Map<String,Object> inputMap)
Runs a (JARified) BAR script.
|
void |
runScript(String dir,
String file)
Runs a (JARified) BAR script.
|
void |
runScript(String dir,
String file,
Map<String,Object> inputMap)
Runs a (JARified) BAR script.
|
boolean |
scriptLoaded()
Assesses if last script was loaded successfully
|
void |
setSilent(Boolean silent)
Should
LogService display errors? |
public Runner(Context context)
public Runner(boolean silent)
silent
- if errors should be ignored by the LogService
public void runScript(InputStream in, String filename)
in
- the InputStream
loading the script to be executedfilename
- the script filename (or at least its extension)public void runScript(String path)
path
- the path of the BAR script to be executed, e.g,
scripts/BAR/Data_Analysis/Distribution_Plotter.ijm
;public void runScript(String path, Map<String,Object> inputMap)
path
- the path of the BAR script to be executed, e.g,
/scripts/BAR/Data_Analysis/Distribution_Plotter.ijm
;inputMap
- see ScriptService.run(String, Reader, boolean, Map)
public void runScript(String dir, String file, Map<String,Object> inputMap)
dir
- the script directory, i.e., the subdirectory in the BAR jar
relative to scripts/BAR/
file
- the script filename (or at least its extension)inputMap
- see ScriptService.run(String, Reader, boolean, Map)
public void runScript(String dir, String file)
dir
- the script directory, i.e., the subdirectory in the BAR jar
relative to scripts/BAR/
file
- the script filenamepublic void runScript(InputStream in, String filename, Map<String,Object> inputMap)
in
- the InputStream
loading the script to be executedfilename
- the script filename (or at least its extension)inputMap
- see ScriptService.run(String, Reader, boolean, Map)
public void runBARMacro(String path, String arg)
Macro_Runner.runMacroFromJar(String, String)
.path
- the path to the IJ1 macro in the BAR jar file relative to
scripts/
arg
- the argument string to be retrieved through the IJ1 built-in
macro function getArgument()
public void runIJ1Macro(String path, String arg)
Macro_Runner.runMacroFromJar(String, String)
.path
- the path to the IJ1 macro in the BAR jar filearg
- the argument string to be retrieved through the IJ1 built-in
macro function getArgument()
public void installIJ1Macro(String path)
public void installIJ1Macro(String path, boolean singleTool)
public Boolean isSilent()
true
if the LogService
is not logging errors. Note
that passing invalid parameters to scripts may still trigger Console
warnings.public void setSilent(Boolean silent)
LogService
display errors?silent
- if true
errors are ignored silently. Note that passing
invalid parameters to scripts may still trigger Console
warnings.public boolean scriptLoaded()
true
if the last run script could not be loaded otherwise
false
public String getStatus()
cancelled
, done
,
exception
, loaded
, io error
, or in the
case of IJ1 macros loaded through legacy mechanisms the String
value returned by the
Macro_Runner.runMacro(String, String)
public void openLastLoadedResource()
public File getLastLoadedResource()
Copyright © 2014–2017 Fiji. All rights reserved.