Package ffx.ui
Class ModelingShell
java.lang.Object
ffx.utilities.Console
ffx.ui.ModelingShell
- All Implemented Interfaces:
AlgorithmListener
,groovy.lang.GroovyObject
,ComponentListener
,FocusListener
,EventListener
,CaretListener
,HyperlinkListener
The ModelingShell is used to script Multiscale Modeling Routines via the Groovy scripting
language. Functionality available through the modeling shell includes the Force Field X API, Java
API and Groovy extensions.
- Author:
- Michael J. Schnieders
-
Field Summary
Fields inherited from class ffx.utilities.Console
ICON_PATH, NODE_ICON_PATH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
after()
afterboolean
algorithmUpdate
(MolecularAssembly active) After a successful step or interval of an algorithm, this method of the listener will be called.If at exit time, a script is running, the user is given an option to interrupt it firstboolean
void
before()
beforevoid
void
clearContext
(EventObject evt) void
void
clearOutput
(EventObject evt) energy()
energyvoid
void
fileNewWindow
(EventObject evt) void
md
(int nStep, double timeStep, double printInterval, double saveInterval, double temperature, boolean initVelocities, File dyn) mdvoid
run()
Configure the Swing GUI for the shell.groovy.lang.Script
runFFXScript
(File file, List<String> argList) runFFXScript - Execute a FFX script.groovy.lang.Script
runFFXScript
(Class<? extends groovy.lang.Script> script, List<String> argList) runFFXScript - Execute a compiled FFX script.groovy.lang.Script
runNonGroovyScript
(File file, List<String> argList) runPythonScript - Execute a Python script.void
selectvoid
setArgList
(List<String> argList) setArgListvoid
void
showAbout
(EventObject evt) time()
timetoString()
void
Methods inherited from class ffx.utilities.Console
addClasspathDir, addClasspathDir, addClasspathJar, addClasspathJar, addToHistory, appendOutput, appendOutput, appendOutput, appendOutput, appendOutput, appendOutputLines, appendOutputNl, appendStacktrace, autoClearOutput, beep, bindResults, captureStdErr, captureStdOut, caretUpdate, closeOutputPrintWriter, comment, comment, compileAsJava, compileAsJava, compileFinishNormal, compileScript, compileScript, compileScript, componentHidden, componentMoved, componentResized, componentShown, copy, copy, createOutputPrintWriter, cut, cut, detachedOutput, doInterrupt, doInterrupt, doRun, dot, exit, exit, exitDesktop, exitDesktop, exitDesktop, fileNewFile, fileNewFile, fileOpen, fileOpen, fileSave, fileSave, fileSaveAs, fileSaveAs, find, find, findNext, findNext, findPrevious, findPrevious, finishException, finishNormal, finishNormal, focusGained, focusLost, fullStackTraces, getAfterExecution, getAutoClearOutput, getAutoClearOutputAction, getBaseConfig, getBeforeExecution, getBlank, getCaptureStdErr, getCaptureStdOut, getColNum, getCommandStyle, getConfig, getConsoleControllers, getConsoleId, getConsolePreferences, getCopyFromComponent, getCurrentClasspathDir, getCurrentClasspathJarDir, getCurrentFileChooserDir, getCursorPos, getDEFAULT_SCRIPT_NAME_START, getDetachedOutput, getDetachedOutputAction, getDirty, getFrame, getFrameConsoleDelegates, getFullStackTraces, getFullStackTracesAction, getGroovyFileFilter, getHideOutputWindowAction1, getHideOutputWindowAction2, getHideOutputWindowAction3, getHideOutputWindowAction4, getHistory, getHistoryIndex, getHyperlinkStyle, getInputArea, getInputAreaContentHash, getInputEditor, getInterruptAction, getLastResult, getLoopMode, getLoopModeAction, getMaxHistory, getMaxOutputChars, getMetaClass, getNextHistoryAction, getOrientationVertical, getOrientationVerticalAction, getOrigDividerSize, getOutputArea, getOutputPrintWriter, getOutputStyle, getOutputWindow, getPendingRecord, getPrevHistoryAction, getPromptStyle, getResultStyle, getRootElement, getRowNum, getRowNumAndColNum, getRunThread, getSaveAction, getSaveOnRun, getSaveOnRunAction, getScriptFile, getScriptNameCounter, getScriptRunning, getScrollArea, getSelectPreviousWordAction, getSelectWordAction, getShell, getShowOutputWindowAction, getShowScriptInOutput, getShowScriptInOutputAction, getShowToolbar, getShowToolbarAction, getSmartHighlighter, getSplitPane, getStackOverFlowError, getStacktraceStyle, getStatusLabel, getSwing, getSystemErrorInterceptor, getSystemOutInterceptor, getTextSelectionEnd, getTextSelectionStart, getThreadInterrupt, getThreadInterruptAction, getToolbar, getUseScriptClassLoaderForScriptExecution, getVisualizeScriptResults, getVisualizeScriptResultsAction, hideAndClearOutputWindow, hideAndClearOutputWindow, hideOutputWindow, hideOutputWindow, historyNext, historyNext, historyPrev, historyPrev, hyperlinkUpdate, insertString, insertString, inspectAst, inspectAst, inspectCst, inspectCst, inspectLast, inspectLast, inspectTokens, inspectTokens, inspectVariables, inspectVariables, installInterceptor, invokeTextAction, invokeTextAction, isAutoClearOutput, isCaptureStdErr, isCaptureStdOut, isDetachedOutput, isDirty, isFullStackTraces, isLoopMode, isOrientationVertical, isSaveOnRun, isScriptRunning, isShowScriptInOutput, isShowToolbar, isSmartHighlighter, isStackOverFlowError, isThreadInterrupt, isUseScriptClassLoaderForScriptExecution, isVisualizeScriptResults, largerFont, largerFont, listClasspath, listClasspath, loadMaxOutputChars, loadScriptFile, loopMode, loopMode, main, mark, newScript, notifySystemErr, notifySystemOut, orientationVertical, paste, paste, preferences, preferences, print, print, redo, redo, replace, replace, run, run, runJava, runJava, runScript, runScript, runScript, runSelectedJava, runSelectedJava, runSelectedScript, runSelectedScript, runSelectedScript, saveOnRun, saveOnRun, selectAll, selectAll, selectBlock, selectBlock, selectFilename, selectFilename, setAfterExecution, setAutoClearOutput, setAutoClearOutputAction, setBaseConfig, setBeforeExecution, setBlank, setCaptureStdErr, setCaptureStdOut, setColNum, setCommandStyle, setConfig, setConsoleControllers, setConsolePreferences, setCopyFromComponent, setCurrentClasspathDir, setCurrentClasspathJarDir, setCurrentFileChooserDir, setCursorPos, setDetachedOutput, setDetachedOutputAction, setDirty, setFrame, setFrameConsoleDelegates, setFullStackTraces, setFullStackTracesAction, setGroovyFileFilter, setHideOutputWindowAction1, setHideOutputWindowAction2, setHideOutputWindowAction3, setHideOutputWindowAction4, setHistory, setHistoryIndex, setHyperlinkStyle, setInputArea, setInputAreaContentHash, setInputEditor, setInterruptAction, setLoopMode, setLoopModeAction, setMaxHistory, setMaxOutputChars, setMetaClass, setNextHistoryAction, setOrientationVertical, setOrientationVerticalAction, setOrigDividerSize, setOutputArea, setOutputPreferences, setOutputPrintWriter, setOutputStyle, setOutputWindow, setPendingRecord, setPrevHistoryAction, setPromptStyle, setResultStyle, setRootElement, setRowNum, setRowNumAndColNum, setRowNumAndColNum, setRunThread, setSaveAction, setSaveOnRun, setSaveOnRunAction, setScriptFile, setScriptNameCounter, setScriptRunning, setScrollArea, setSelectPreviousWordAction, setSelectWordAction, setShell, setShowOutputWindowAction, setShowScriptInOutput, setShowScriptInOutputAction, setShowToolbar, setShowToolbarAction, setSmartHighlighter, setSplitPane, setStackOverFlowError, setStacktraceStyle, setStatusLabel, setSwing, setSystemErrorInterceptor, setSystemOutInterceptor, setTextSelectionEnd, setTextSelectionStart, setThreadInterrupt, setThreadInterruptAction, setToolbar, setUseScriptClassLoaderForScriptExecution, setVariable, setVisualizeScriptResults, setVisualizeScriptResultsAction, showCompilingMessage, showExecutingMessage, showMessage, showOutputWindow, showOutputWindow, showScriptInOutput, showToolbar, smallerFont, smallerFont, smartHighlighter, smartHighlighter, threadInterruption, undo, undo, visualizeScriptResults
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface groovy.lang.GroovyObject
getProperty, invokeMethod, setProperty
-
Constructor Details
-
ModelingShell
Constructor for ModelingShell.- Parameters:
mainPanel
- a reference to the MainPanel.
-
-
Method Details
-
after
public void after()after -
algorithmUpdate
After a successful step or interval of an algorithm, this method of the listener will be called.- Specified by:
algorithmUpdate
in interfaceAlgorithmListener
- Parameters:
active
- The system the algorithm is operating on.- Returns:
- A return of
true
indicates the algorithm continues.
-
askToInterruptScript
If at exit time, a script is running, the user is given an option to interrupt it first- Overrides:
askToInterruptScript
in classffx.utilities.Console
-
askToSaveFile
public boolean askToSaveFile()Return false if user elects to cancel.
- Overrides:
askToSaveFile
in classffx.utilities.Console
-
before
public void before()before -
clearContext
public void clearContext()- Overrides:
clearContext
in classffx.utilities.Console
-
clearContext
- Overrides:
clearContext
in classffx.utilities.Console
-
clearOutput
public void clearOutput()Print out the Force Field X promo.
- Overrides:
clearOutput
in classffx.utilities.Console
-
clearOutput
- Overrides:
clearOutput
in classffx.utilities.Console
-
energy
energy- Returns:
- a
ForceFieldEnergy
object.
-
fileNewWindow
public void fileNewWindow()- Overrides:
fileNewWindow
in classffx.utilities.Console
-
fileNewWindow
- Overrides:
fileNewWindow
in classffx.utilities.Console
-
getUIAlgorithmUtils
-
getUIPotentialsUtils
-
md
public void md(int nStep, double timeStep, double printInterval, double saveInterval, double temperature, boolean initVelocities, File dyn) md- Parameters:
nStep
- The number of MD steps.timeStep
- a double.printInterval
- a double.saveInterval
- a double.temperature
- a double.initVelocities
- a boolean.dyn
- aFile
object.
-
run
public void run()Configure the Swing GUI for the shell.- Overrides:
run
in classffx.utilities.Console
-
select
select- Parameters:
node
- aMSNode
object.
-
setArgList
setArgList- Parameters:
argList
- aList
object.
-
showAbout
public void showAbout()- Overrides:
showAbout
in classffx.utilities.Console
-
showAbout
- Overrides:
showAbout
in classffx.utilities.Console
-
time
time- Returns:
- a
Double
object.
-
toString
-
updateTitle
public void updateTitle()- Overrides:
updateTitle
in classffx.utilities.Console
-
runFFXScript
runFFXScript - Execute a FFX script.- Parameters:
file
- aFile
object.argList
- List of String inputs to the script.- Returns:
- Returns a reference to the executed script.
-
runNonGroovyScript
runPythonScript - Execute a Python script.- Parameters:
file
- aFile
object.argList
- List of String inputs to the script.- Returns:
- Returns a reference to the executed script.
-
runFFXScript
public groovy.lang.Script runFFXScript(Class<? extends groovy.lang.Script> script, List<String> argList) runFFXScript - Execute a compiled FFX script.- Parameters:
script
- a compiled FFX script.argList
- List of String inputs to the script.- Returns:
- Returns a reference to the executed script.
-