Jython Shell
The Jython Shell is an interactive command line interface to the McIDAS-V Jython
interpreter that allows the user to type in arbitrary Jython to evaluate. This feature
is brought up with the Tools->Formulas->Jython Shell menu item in the Main Display window.
The User Interface
Image 1: Jython Shell Window
The Jython shell consists of an output window on the top and an input field
on the bottom. The user enters Jython into the input field. When Enter or is
pressed the Jython is evaluated and any output is shown in the output window. Note that Enter will only evaluate the field if the field has not been expanded.
The icons shown with every Jython entry in the output window allow you to
select the particular Jython or re-evaluate it.
The entry window can be expanded with the to the right of the command line. When the entry field is expanded, you can enter more than one line of code to be processed at once. When the entry field isn't expanded, you are limited to evaluating one line of code at a time.
Pressing the "Up" arrow and "Down" arrow (also Ctrl+P, Ctrl+N) in the
entry field goes up and down through the history of commands.
After you have entered a command, the command will be listed above the Evaluate field. To the right of the command, there are two buttons. The button pastes the formula back into the Evaluate field. The button reevaluates the previously entered command without having to reenter it.
Right clicking in the entry field brings up a menu that allows you to:
- Add an entry from the history.
- Insert the identifier for a display control type when creating a display.
- Insert the text of a procedure call from any of the McIDAS-V Jython Library modules. Note: The shell utilities module has a number of useful
Jython shell related commands.
- Insert any of the defined McIDAS-V actions (e.g., Edit color table, Show
window, etc.)
Menus
All of the menu items in this tool are unique to the Jython Shell.
The File menu has these unique items:
- Export Commands - Allows you to take the commands that
have been entered and add them into the Jython Library to be used to
create a fixed procedure.
- Save History - Writes out the history of commands the
have been entered. When you restart McIDAS-V those commands will be in
your history.
- List History - Shows the history of commands in the
output window.
- List Variables - Shows all global Jython variables defined.
The Edit menu has these unique items:
- Clear All - Clears the history and anything in the output
window.
- Clear Output - Clears the output window.
- Auto-select Operands - Causes the
Jython shell to analyze every command entered to see if there are references
to variables that have not been set. It will bring up the Data Selection
dialog to allow you to choose the fields to use.