Module ij
Package ij.macro

# Class MacroRunner

java.lang.Object
ij.macro.MacroRunner

All Implemented Interfaces:
  `Runnable`

public class MacroRunner extends Object implements Runnable
This class runs macros in a separate thread.

## Constructor Summary

Constructors
Constructor
Description
`MacroRunner()`
Create a MacroRunner.
`MacroRunner(Program pgm, int address, String name)`
Runs a tokenized macro in a separate thread.
`MacroRunner(Program pgm, int address, String name, Editor editor)`
Runs a tokenized macro in debug mode if 'editor' is not null.
`MacroRunner(Program pgm, int address, String name, String argument)`
Runs a tokenized macro in a separate thread, passing a string argument.
`MacroRunner(File file)`
Interprets a macro file in a separate thread.
`MacroRunner(String macro)`
Create a new object that interprets macro source in a separate thread.
`MacroRunner(String macro, String argument)`
Interprets macro source in a separate thread, passing a string argument.

## Method Summary

Modifier and Type
Method
Description
`Thread`
`getThread()`
`void`
`run()`
Used to run the macro code in 'macro' on a separate thread.
`void`
`run(Program pgm, int address, String name)`
Runs a tokenized macro on the current thread.
`void`
`run(String macro)`
Runs the specified macro code.
`void`
`runShortcut(Program pgm, int address, String name)`
Runs tokenized macro on current thread if pgm.queueCommands is true.
`void`
`setEditor(Editor editor)`
Use the specified Editor to run the macro in debug mode.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MacroRunner

public MacroRunner()
Create a MacroRunner.

### MacroRunner

public MacroRunner(String macro)
Create a new object that interprets macro source in a separate thread.

### MacroRunner

public MacroRunner(String macro, String argument)
Interprets macro source in a separate thread, passing a string argument.

### MacroRunner

public MacroRunner(File file)
Interprets a macro file in a separate thread.

### MacroRunner

public MacroRunner(Program pgm, int address, String name)
Runs a tokenized macro in a separate thread.

### MacroRunner

public MacroRunner(Program pgm, int address, String name, String argument)
Runs a tokenized macro in a separate thread, passing a string argument.

### MacroRunner

public MacroRunner(Program pgm, int address, String name, Editor editor)
Runs a tokenized macro in debug mode if 'editor' is not null.

## Method Details

### run

public void run(String macro)
Runs the specified macro code.

### runShortcut

public void runShortcut(Program pgm, int address, String name)
Runs tokenized macro on current thread if pgm.queueCommands is true.

### run

public void run(Program pgm, int address, String name)
Runs a tokenized macro on the current thread.

### getThread

public Thread getThread()

### setEditor

public void setEditor(Editor editor)
Use the specified Editor to run the macro in debug mode.

### run

public void run()
Used to run the macro code in 'macro' on a separate thread.

Specified by:
  `run` in interface `Runnable`