Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.astro.louisville.edu/software/astroimagej/imagej/api/ij/macro/Interpreter.html
Дата изменения: Thu Dec 2 23:03:10 2010
Дата индексирования: Mon Oct 1 22:12:54 2012
Кодировка:

Поисковые слова: п п п п п п п
Interpreter (ImageJ API)

ij.macro
Class Interpreter

java.lang.Object
  extended by ij.macro.Interpreter
All Implemented Interfaces:
MacroConstants

public class Interpreter
extends java.lang.Object
implements MacroConstants

This is the recursive descent parser/interpreter for the ImageJ macro language.


Field Summary
static boolean batchMode
           
static int FAST_TRACE
           
static int NONE
           
static int RUN
           
static int RUN_TO_CARET
           
static int STEP
           
static int TRACE
           
 
Fields inherited from interface ij.macro.MacroConstants
ABS, ACOS, ARRAY, ARRAY_FUNC, ARRAY_FUNCTION, arrayFunctionIDs, arrayFunctions, ASIN, ATAN, ATAN2, AUTO_UPDATE, BEEP, BIT_DEPTH, CALCULATOR, CALIBRATE, CALL, CHANGE_VALUES, CHAR_CODE_AT, CLOSE, COS, D2S, DEBUG, DIALOG, DIV_EQUAL, DO, DO_COMMAND, DO_WAND, DRAW_LINE, DRAW_OVAL, DRAW_RECT, DRAW_STRING, DUMP, ELSE, ENDS_WITH, EOF, EQ, EVAL, EXEC, EXIT, EXP, EXT, FALSE, FILE, FILL, FILL_OVAL, FILL_RECT, FIT, FLOOD_FILL, FLOOR, FOR, FROM_CHAR_CODE, FUNCTION, functionIDs, functions, GET_ARGUMENT, GET_BOOLEAN, GET_BOUNDING_RECT, GET_BOUNDS, GET_COORDINATES, GET_COUNT, GET_CURSOR_LOC, GET_DATE_AND_TIME, GET_DIMENSIONS, GET_DIRECTORY, GET_FILE_LIST, GET_FONT_LIST, GET_HEIGHT, GET_HISTOGRAM, GET_ID, GET_IMAGE_INFO, GET_INFO, GET_LINE, GET_LIST, GET_LOCATION_AND_SIZE, GET_LUT, GET_METADATA, GET_MIN_AND_MAX, GET_NUMBER, GET_PIXEL, GET_PIXEL_SIZE, GET_PROFILE, GET_RAW_STATISTICS, GET_RESULT, GET_RESULT_LABEL, GET_SLICE_NUMBER, GET_STATISTICS, GET_STRING, GET_STRING_WIDTH, GET_THRESHOLD, GET_TIME, GET_TITLE, GET_VALUE, GET_VERSION, GET_VOXEL_SIZE, GET_WIDTH, GET_ZOOM, GT, GTE, IF, IJ_CALL, INDEX_OF, INVERT, IS, IS_ACTIVE, IS_KEY_DOWN, IS_NAN, IS_OPEN, keywordIDs, keywords, LAST_INDEX_OF, LENGTH_OF, LINE_TO, LIST, LOG, LOGICAL_AND, LOGICAL_OR, LT, LTE, MACRO, MAKE_LINE, MAKE_OVAL, MAKE_POINT, MAKE_POLYGON, MAKE_RECTANGLE, MAKE_SELECTION, MAKE_TEXT, MATCHES, MAX_OF, MIN_OF, MINUS_EQUAL, MINUS_MINUS, MOVE_TO, MUL_EQUAL, NaN, NEQ, NEW_ARRAY, NEW_IMAGE, NEW_MENU, NIMAGES, NOP, NRESULTS, NSLICES, NUMBER, NUMERIC_FUNCTION, numericFunctionIDs, numericFunctions, OPEN, OVERLAY, PARSE_FLOAT, PARSE_INT, PI, PLOT, PLUS_EQUAL, PLUS_PLUS, POW, PREDEFINED_FUNCTION, PRINT, PUT_PIXEL, RANDOM, RENAME, REPLACE, REQUIRES, RESET, RESET_MIN_MAX, RESET_THRESHOLD, RESTORE_PREVIOUS_TOOL, RESTORE_SETTINGS, RETURN, ROI_MANAGER, ROUND, RUN_MACRO, SAVE, SAVE_AS, SAVE_SETTINGS, SCREEN_HEIGHT, SCREEN_WIDTH, SELECT, SELECT_IMAGE, SELECTION_NAME, SELECTION_TYPE, SET_AUTO_THRESHOLD, SET_BACKGROUND, SET_BATCH_MODE, SET_COLOR, SET_FONT, SET_FOREGROUND, SET_JUSTIFICATION, SET_KEY_DOWN, SET_LINE_WIDTH, SET_LOCATION, SET_LUT, SET_METADATA, SET_MIN_MAX, SET_OPTION, SET_PASTE_MODE, SET_PIXEL, SET_RESULT, SET_RGB_WEIGHTS, SET_SELECTION_LOC, SET_SELECTION_NAME, SET_SLICE, SET_THRESHOLD, SET_TOOL, SET_VOXEL_SIZE, SET_Z_COORDINATE, SETUP_UNDO, SHIFT_LEFT, SHIFT_RIGHT, SHOW_MESSAGE, SHOW_MESSAGE_WITH_CANCEL, SHOW_PROGRESS, SHOW_STATUS, SHOW_TEXT, SIN, SNAPSHOT, SPLIT, SQRT, STACK, STARTS_WITH, STRING, STRING_CONSTANT, STRING_FUNCTION, stringFunctionIDs, stringFunctions, SUBSTRING, TAN, TO_BINARY, TO_HEX, TO_LOWER_CASE, TO_STRING, TO_UPPER_CASE, TOK_MASK, TOK_SHIFT, TOOL_ID, TRUE, UPDATE_DISPLAY, UPDATE_RESULTS, USER_FUNCTION, VAR, WAIT, WAIT_FOR_USER, WHILE, WORD, WRITE
 
Constructor Summary
Interpreter()
           
 
Method Summary
static void abort()
          Aborts currently running macro.
static void abort(Interpreter interp)
          Absolete, replaced by abortMacro().
 void abortMacro()
          Aborts this macro.
static void addBatchModeImage(ImagePlus imp)
           
 boolean done()
           
static java.lang.String getAdditionalFunctions()
           
static ImagePlus getBatchModeImage(int id)
           
static int getBatchModeImageCount()
           
static int[] getBatchModeImageIDs()
           
static RoiManager getBatchModeRoiManager()
          Returns the batch mode RoiManager instance.
 Editor getEditor()
           
static Interpreter getInstance()
           
static ImagePlus getLastBatchModeImage()
           
 int getLineNumber()
           
 java.lang.String getStringVariable(java.lang.String name)
           
 double getVariable(java.lang.String name)
           
 java.lang.String[] getVariables()
           
static boolean isBatchMode()
           
static boolean isBatchModeRoiManager()
          Returns true if there is an internal batch mode RoiManager.
static void removeBatchModeImage(ImagePlus imp)
           
 void run(int location)
          Runs an existing macro starting at the specified program counter location.
 void run(Program pgm)
          Interprets the specified tokenized macro file starting at location 0.
 void run(java.lang.String macro)
          Interprets the specified string.
 java.lang.String run(java.lang.String macro, java.lang.String arg)
          Runs the specified macro, passing it a string argument and returning a string value.
 void runMacro(Program pgm, int macroLoc, java.lang.String macroName)
          Interprets the specified tokenized macro starting at the specified location.
 void saveGlobals(Program pgm)
          Saves global variables.
static void setAdditionalFunctions(java.lang.String functions)
          The specified string, if not null, is added to strings passed to the run() method.
 void setDebugMode(int mode)
           
 void setEditor(Editor ed)
           
 void setVariable(java.lang.String name, double value)
           
 TextWindow updateDebugWindow(java.lang.String[] variables, TextWindow debugWindow)
           
 boolean wasError()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
See Also:
Constant Field Values

STEP

public static final int STEP
See Also:
Constant Field Values

TRACE

public static final int TRACE
See Also:
Constant Field Values

FAST_TRACE

public static final int FAST_TRACE
See Also:
Constant Field Values

RUN

public static final int RUN
See Also:
Constant Field Values

RUN_TO_CARET

public static final int RUN_TO_CARET
See Also:
Constant Field Values

batchMode

public static boolean batchMode
Constructor Detail

Interpreter

public Interpreter()
Method Detail

run

public void run(java.lang.String macro)
Interprets the specified string.


run

public java.lang.String run(java.lang.String macro,
                            java.lang.String arg)
Runs the specified macro, passing it a string argument and returning a string value.


run

public void run(Program pgm)
Interprets the specified tokenized macro file starting at location 0.


run

public void run(int location)
Runs an existing macro starting at the specified program counter location.


runMacro

public void runMacro(Program pgm,
                     int macroLoc,
                     java.lang.String macroName)
Interprets the specified tokenized macro starting at the specified location.


saveGlobals

public void saveGlobals(Program pgm)
Saves global variables.


updateDebugWindow

public TextWindow updateDebugWindow(java.lang.String[] variables,
                                    TextWindow debugWindow)

abort

public static void abort()
Aborts currently running macro.


abort

public static void abort(Interpreter interp)
Absolete, replaced by abortMacro().


abortMacro

public void abortMacro()
Aborts this macro.


getInstance

public static Interpreter getInstance()

isBatchMode

public static boolean isBatchMode()

addBatchModeImage

public static void addBatchModeImage(ImagePlus imp)

removeBatchModeImage

public static void removeBatchModeImage(ImagePlus imp)

getBatchModeImageIDs

public static int[] getBatchModeImageIDs()

getBatchModeImageCount

public static int getBatchModeImageCount()

getBatchModeImage

public static ImagePlus getBatchModeImage(int id)

getLastBatchModeImage

public static ImagePlus getLastBatchModeImage()

setAdditionalFunctions

public static void setAdditionalFunctions(java.lang.String functions)
The specified string, if not null, is added to strings passed to the run() method.


getAdditionalFunctions

public static java.lang.String getAdditionalFunctions()

getBatchModeRoiManager

public static RoiManager getBatchModeRoiManager()
Returns the batch mode RoiManager instance.


isBatchModeRoiManager

public static boolean isBatchModeRoiManager()
Returns true if there is an internal batch mode RoiManager.


setEditor

public void setEditor(Editor ed)

setDebugMode

public void setDebugMode(int mode)

getLineNumber

public int getLineNumber()

getVariables

public java.lang.String[] getVariables()

done

public boolean done()

getEditor

public Editor getEditor()

wasError

public boolean wasError()

setVariable

public void setVariable(java.lang.String name,
                        double value)

getVariable

public double getVariable(java.lang.String name)

getStringVariable

public java.lang.String getStringVariable(java.lang.String name)