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

public class ModelingShell extends ffx.utilities.Console implements AlgorithmListener
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

    Constructors
    Constructor
    Description
    Constructor for ModelingShell.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    after
    boolean
    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 first
    boolean
    void
    before
    void
     
    void
     
    void
    void
     
    energy
    void
     
    void
     
     
     
    void
    md(int nStep, double timeStep, double printInterval, double saveInterval, double temperature, boolean initVelocities, File dyn)
    md
    void
    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
    runPythonScript - Execute a Python script.
    void
    select(MSNode node)
    select
    void
    setArgList
    void
     
    void
     
    time
    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

      public ModelingShell(MainPanel mainPanel)
      Constructor for ModelingShell.
      Parameters:
      mainPanel - a reference to the MainPanel.
  • Method Details

    • after

      public void after()
      after
    • algorithmUpdate

      public boolean algorithmUpdate(MolecularAssembly active)
      After a successful step or interval of an algorithm, this method of the listener will be called.
      Specified by:
      algorithmUpdate in interface AlgorithmListener
      Parameters:
      active - The system the algorithm is operating on.
      Returns:
      A return of true indicates the algorithm continues.
    • askToInterruptScript

      public Object askToInterruptScript()
      If at exit time, a script is running, the user is given an option to interrupt it first

      Overrides:
      askToInterruptScript in class ffx.utilities.Console
    • askToSaveFile

      public boolean askToSaveFile()

      Return false if user elects to cancel.

      Overrides:
      askToSaveFile in class ffx.utilities.Console
    • before

      public void before()
      before
    • clearContext

      public void clearContext()
      Overrides:
      clearContext in class ffx.utilities.Console
    • clearContext

      public void clearContext(EventObject evt)
      Overrides:
      clearContext in class ffx.utilities.Console
    • clearOutput

      public void clearOutput()

      Print out the Force Field X promo.

      Overrides:
      clearOutput in class ffx.utilities.Console
    • clearOutput

      public void clearOutput(EventObject evt)
      Overrides:
      clearOutput in class ffx.utilities.Console
    • energy

      public ForceFieldEnergy energy()
      energy
      Returns:
      a ForceFieldEnergy object.
    • fileNewWindow

      public void fileNewWindow()
      Overrides:
      fileNewWindow in class ffx.utilities.Console
    • fileNewWindow

      public void fileNewWindow(EventObject evt)
      Overrides:
      fileNewWindow in class ffx.utilities.Console
    • getUIAlgorithmUtils

      public AlgorithmFunctions getUIAlgorithmUtils()
    • getUIPotentialsUtils

      public PotentialsFunctions 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 - a File object.
    • run

      public void run()
      Configure the Swing GUI for the shell.
      Overrides:
      run in class ffx.utilities.Console
    • select

      public void select(MSNode node)
      select
      Parameters:
      node - a MSNode object.
    • setArgList

      public void setArgList(List<String> argList)
      setArgList
      Parameters:
      argList - a List object.
    • showAbout

      public void showAbout()
      Overrides:
      showAbout in class ffx.utilities.Console
    • showAbout

      public void showAbout(EventObject evt)
      Overrides:
      showAbout in class ffx.utilities.Console
    • time

      public Double time()
      time
      Returns:
      a Double object.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • updateTitle

      public void updateTitle()
      Overrides:
      updateTitle in class ffx.utilities.Console
    • runFFXScript

      public groovy.lang.Script runFFXScript(File file, List<String> argList)
      runFFXScript - Execute a FFX script.
      Parameters:
      file - a File object.
      argList - List of String inputs to the script.
      Returns:
      Returns a reference to the executed script.
    • runNonGroovyScript

      public groovy.lang.Script runNonGroovyScript(File file, List<String> argList)
      runPythonScript - Execute a Python script.
      Parameters:
      file - a File 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.