|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
visad.util.TextEditor
visad.util.CodeEditor
visad.python.JPythonEditor
public class JPythonEditor
An editor for writing and executing JPython code in Java runtime.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JScrollPane |
|---|
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected RunJPython |
python
wrapper for PythonInterpreter object |
protected boolean |
runSeparate
flag indicating whether to launch scripts in a separate process |
protected boolean |
warnBeforeSave
flag indicating whether to warn before auto-saving |
| Fields inherited from class visad.util.CodeEditor |
|---|
lineNumbers, numDigits, numLines |
| Fields inherited from class visad.util.TextEditor |
|---|
changed, currentFile, DEBUG, MONO, text, undo |
| Fields inherited from class javax.swing.JScrollPane |
|---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JPythonEditor()
constructs a JPythonEditor |
|
JPythonEditor(String filename)
constructs a JPythonEditor containing text from the given filename |
|
| Method Summary | |
|---|---|
void |
compile()
compiles the JPython script to a Java class |
protected JFileChooser |
doMakeFileChooser()
Create and initialize the the file chooser |
void |
exec(String line)
executes a line of JPython code |
void |
execfile(String filename)
executes the document as JPython source code |
String |
getText()
returns a string containing the text of the document |
void |
run()
executes the JPython script |
static String[] |
runCommand(String cmd)
runs the given command in a separate process |
void |
setRunItem(JMenuItem run)
sets the run menu item |
void |
setRunSeparateProcess(boolean separate)
sets whether editor should run scripts in a separate process |
void |
setText(String text)
sets the text of the document to the current string |
void |
setWarnBeforeSave(boolean warn)
sets whether editor should warn user before auto-saving |
| Methods inherited from class visad.util.CodeEditor |
|---|
highlightLine, redo, undo, undoableEditHappened, updateLineNumbers |
| Methods inherited from class visad.util.TextEditor |
|---|
addUndoableEditListener, canRedo, canUndo, copy, cut, getFile, getFileChooser, getFilename, getRedoName, getTextComponent, getUndoName, hasChanged, insertText, newFile, openDialog, openFile, openFile, paste, removeUndoableEditListener, saveDialog, saveFile, saveFile, saveFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected RunJPython python
protected boolean warnBeforeSave
protected boolean runSeparate
| Constructor Detail |
|---|
public JPythonEditor()
throws VisADException
VisADException
public JPythonEditor(String filename)
throws VisADException
VisADException| Method Detail |
|---|
public static String[] runCommand(String cmd)
throws IOException,
VisADException
IOException
VisADExceptionprotected JFileChooser doMakeFileChooser()
doMakeFileChooser in class TextEditor
public void exec(String line)
throws VisADException
exec in class CodeEditorVisADException
public void execfile(String filename)
throws VisADException
VisADExceptionpublic String getText()
getText in class TextEditorpublic void setText(String text)
setText in class TextEditorpublic void setWarnBeforeSave(boolean warn)
public void setRunSeparateProcess(boolean separate)
public void setRunItem(JMenuItem run)
public void run()
run in class CodeEditor
public void compile()
throws VisADException
compile in class CodeEditorVisADException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||