ucar.unidata.idv.ui
Class JythonShell

java.lang.Object
  extended by ucar.unidata.ui.InteractiveShell
      extended by ucar.unidata.idv.ui.JythonShell
All Implemented Interfaces:
EventListener, HyperlinkListener

public class JythonShell
extends InteractiveShell

This class provides an interactive shell for running JYthon

Version:
$Revision: 1.50 $Date: 2007/08/21 12:15:45 $
Author:
IDV development team

Field Summary
static String PROP_JYTHON_SHELL_HISTORY
          property that holds the history
 
Fields inherited from class ucar.unidata.ui.InteractiveShell
commandArea, commandFld, contents, editorPane, frame, history, historyIdx, sb
 
Constructor Summary
JythonShell(IntegratedDataViewer theIdv)
          ctor
 
Method Summary
 void clear()
          Clear everything, gui and make new interp
protected  JMenuBar doMakeMenuBar()
          Make menu bar
 void eval(String jython)
          eval
 void exportHistory()
          Take all of the commands and write them to the library
protected  String formatCode(String code)
          Format code to output
 boolean getAutoSelect()
          Get the AutoSelect property.
protected  List getDataMenuItems()
          _more_
protected  List getDisplayMenuItems()
          get menu items
protected  void handleKeyPress(KeyEvent e, JTextComponent cmdFld)
          handle event
protected  void handleRightMouseClick(JTextComponent commandFld, MouseEvent e)
          handle event
 void insertAction(String action)
          Add the idv action
 void listHistory()
          print the history
 void listVars()
          List the variables in the interpreter
protected  void makeFrame()
          This gets called by the base class to make the frame.
 void printType(Data d)
          print type
 void saveHistory()
          write the hostory
 void setAutoSelect(boolean value)
          Set the AutoSelect property.
 void showHelp()
          show help
 void showProcedurePopup(JTextComponent cmdFld)
          popup menu
 
Methods inherited from class ucar.unidata.ui.InteractiveShell
clearOutput, close, doMakeContents, endBufferingOutput, eval, flipField, getHref, hyperlinkUpdate, init, insert, insertText, output, setText, show, showNormalCursor, showWaitCursor, startBufferingOutput, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_JYTHON_SHELL_HISTORY

public static final String PROP_JYTHON_SHELL_HISTORY
property that holds the history

See Also:
Constant Field Values
Constructor Detail

JythonShell

public JythonShell(IntegratedDataViewer theIdv)
ctor

Parameters:
theIdv - idv
Method Detail

listHistory

public void listHistory()
print the history


saveHistory

public void saveHistory()
write the hostory


makeFrame

protected void makeFrame()
This gets called by the base class to make the frame. If you don't want this to popup then make this method a noop You can access the GUI contents with the member contents

Overrides:
makeFrame in class InteractiveShell

showProcedurePopup

public void showProcedurePopup(JTextComponent cmdFld)
popup menu

Parameters:
cmdFld - field

listVars

public void listVars()
List the variables in the interpreter


insertAction

public void insertAction(String action)
Add the idv action

Parameters:
action - action

handleKeyPress

protected void handleKeyPress(KeyEvent e,
                              JTextComponent cmdFld)
handle event

Overrides:
handleKeyPress in class InteractiveShell
Parameters:
e - event
cmdFld - field

showHelp

public void showHelp()
show help


exportHistory

public void exportHistory()
Take all of the commands and write them to the library


clear

public void clear()
Clear everything, gui and make new interp

Overrides:
clear in class InteractiveShell

doMakeMenuBar

protected JMenuBar doMakeMenuBar()
Make menu bar

Overrides:
doMakeMenuBar in class InteractiveShell
Returns:
menu bar

getDisplayMenuItems

protected List getDisplayMenuItems()
get menu items

Returns:
items

getDataMenuItems

protected List getDataMenuItems()
_more_

Returns:
_more_

handleRightMouseClick

protected void handleRightMouseClick(JTextComponent commandFld,
                                     MouseEvent e)
handle event

Overrides:
handleRightMouseClick in class InteractiveShell
Parameters:
commandFld - field
e - event

formatCode

protected String formatCode(String code)
Format code to output

Overrides:
formatCode in class InteractiveShell
Parameters:
code - code
Returns:
formatted code

eval

public void eval(String jython)
eval

Overrides:
eval in class InteractiveShell
Parameters:
jython - jython

printType

public void printType(Data d)
print type

Parameters:
d - data

setAutoSelect

public void setAutoSelect(boolean value)
Set the AutoSelect property.

Parameters:
value - The new value for AutoSelect

getAutoSelect

public boolean getAutoSelect()
Get the AutoSelect property.

Returns:
The AutoSelect