ScriptManager
Date: 2019-10-22

org.jmol.script

## Class ScriptManager

- java.lang.Object
- - org.jmol.script.ScriptManager

- All Implemented Interfaces:
    JmolScriptManager

      public class ScriptManager
      extends java.lang.Object
      implements JmolScriptManager

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private JmolThread` | `commandWatcherThread`
    `private ScriptEval` | `eval`
    `private JmolScriptEvaluator` | `evalTemp`
    `private boolean` | `isScriptQueued`
    `private static int` | `prevCovalentVersion`
    `private java.lang.Thread[]` | `queueThreads`
    `private int` | `scriptIndex`
    `javajs.util.Lst<javajs.util.Lst<java.lang.Object>>` | `scriptQueue`
    `private boolean[]` | `scriptQueueRunning`
    `private boolean` | `useCommandWatcherThread`
    `private Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScriptManager()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javajs.util.BS` | `addHydrogensInline(javajs.util.BS bsAtoms, javajs.util.Lst<Atom> vConnections, javajs.util.P3[] pts)`
    `private java.lang.Object` | `addScr(java.lang.String returnType, java.lang.String strScript, java.lang.String statusList, boolean isQuiet)`
    `java.lang.String` | `addScript(java.lang.String strScript, boolean isQuiet)`
    `boolean` | `checkHalt(java.lang.String str, boolean isInsert)`
    `private boolean` | `checkResume(java.lang.String str)`
    `private java.lang.String` | `checkScriptExecution(java.lang.String strScript, boolean isInsert)`
    `private boolean` | `checkStepping(java.lang.String str)`
    `void` | `clear(boolean isAll)`
    `void` | `clearCommandWatcherThread()`
    `void` | `clearQueue()`
    `java.lang.String` | `evalFile(java.lang.String strFilename)`
    `java.lang.String` | `evalStringQuietSync(java.lang.String strScript, boolean isQuiet, boolean allowSyncScript)`
    `java.lang.Object` | `evalStringWaitStatusQueued(java.lang.String returnType, java.lang.String strScript, java.lang.String statusList, boolean isQuiet, boolean isQueued)`
    `private void` | `flushQueue(java.lang.String command)`
    `javajs.util.BS` | `getAtomBitSetEval(JmolScriptEvaluator eval, java.lang.Object atomExpression)`
    `private java.lang.String` | `getDragDropFileTypeName(java.lang.String fileName)`
    `javajs.util.Lst<java.lang.Object>` | `getScriptItem(boolean watching, boolean isByCommandWatcher)`
    `javajs.util.Lst<javajs.util.Lst<java.lang.Object>>` | `getScriptQueue()`
    `private java.lang.String` | `getZipDirectoryAsString(java.lang.String fileName)`
    `(package private) void` | `interruptQueueThreads()`
    `boolean` | `isQueueProcessing()`
    `boolean` | `isScriptQueued()`
    `private ScriptEval` | `newScriptEvaluator()`
    `void` | `openFileAsync(java.lang.String fileName, int flags)` From file dropping.
    `void` | `queueThreadFinished(int pt)`
    `void` | `runScriptNow()`
    `java.lang.Object` | `scriptCheckRet(java.lang.String strScript, boolean returnContext)`
    `static void` | `setStateScriptVersion(Viewer vwr, java.lang.String version)`
    `JmolScriptEvaluator` | `setViewer(Viewer vwr)`
    `void` | `startCommandWatcher(boolean isStart)`
    `private void` | `startScriptQueue(boolean startedByCommandWatcher)`
    `void` | `waitForQueue()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### vwr

          private Viewer vwr

    - #### eval

          private ScriptEval eval

    - #### evalTemp

          private JmolScriptEvaluator evalTemp

    - #### queueThreads

          private java.lang.Thread[] queueThreads

    - #### scriptQueueRunning

          private boolean[] scriptQueueRunning

    - #### commandWatcherThread

          private JmolThread commandWatcherThread

    - #### scriptQueue

          public javajs.util.Lst<javajs.util.Lst<java.lang.Object>> scriptQueue

    - #### useCommandWatcherThread

          private boolean useCommandWatcherThread

    - #### scriptIndex

          private int scriptIndex

    - #### isScriptQueued

          private boolean isScriptQueued

    - #### prevCovalentVersion

          private static int prevCovalentVersion

  - ### Constructor Detail

    - #### ScriptManager

          public ScriptManager()

  - ### Method Detail

    - #### getScriptQueue

          public javajs.util.Lst<javajs.util.Lst<java.lang.Object>> getScriptQueue()

      Specified by:
        `getScriptQueue` in interface `JmolScriptManager`

    - #### isScriptQueued

          public boolean isScriptQueued()

      Specified by:
        `isScriptQueued` in interface `JmolScriptManager`

    - #### setViewer

          public JmolScriptEvaluator setViewer(Viewer vwr)

      Specified by:
        `setViewer` in interface `JmolScriptManager`

    - #### newScriptEvaluator

          private ScriptEval newScriptEvaluator()

    - #### clear

          public void clear(boolean isAll)

      Specified by:
        `clear` in interface `JmolScriptManager`

    - #### addScript

          public java.lang.String addScript(java.lang.String strScript,
                                            boolean isQuiet)

      Specified by:
        `addScript` in interface `JmolScriptManager`

    - #### addScr

          private java.lang.Object addScr(java.lang.String returnType,
                                          java.lang.String strScript,
                                          java.lang.String statusList,
                                          boolean isQuiet)

    - #### clearQueue

          public void clearQueue()

      Specified by:
        `clearQueue` in interface `JmolScriptManager`

    - #### waitForQueue

          public void waitForQueue()

      Specified by:
        `waitForQueue` in interface `JmolScriptManager`

    - #### isQueueProcessing

          public boolean isQueueProcessing()

      Specified by:
        `isQueueProcessing` in interface `JmolScriptManager`

    - #### flushQueue

          private void flushQueue(java.lang.String command)

    - #### startScriptQueue

          private void startScriptQueue(boolean startedByCommandWatcher)

    - #### getScriptItem

          public javajs.util.Lst<java.lang.Object> getScriptItem(boolean watching,
                                                                 boolean isByCommandWatcher)

      Specified by:
        `getScriptItem` in interface `JmolScriptManager`

    - #### startCommandWatcher

          public void startCommandWatcher(boolean isStart)

      Specified by:
        `startCommandWatcher` in interface `JmolScriptManager`

    - #### interruptQueueThreads

          void interruptQueueThreads()

    - #### clearCommandWatcherThread

          public void clearCommandWatcherThread()

    - #### queueThreadFinished

          public void queueThreadFinished(int pt)

      Specified by:
        `queueThreadFinished` in interface `JmolScriptManager`

    - #### runScriptNow

          public void runScriptNow()

    - #### evalFile

          public java.lang.String evalFile(java.lang.String strFilename)

      Specified by:
        `evalFile` in interface `JmolScriptManager`

    - #### evalStringWaitStatusQueued

          public java.lang.Object evalStringWaitStatusQueued(java.lang.String returnType,
                                                             java.lang.String strScript,
                                                             java.lang.String statusList,
                                                             boolean isQuiet,
                                                             boolean isQueued)

      Specified by:
        `evalStringWaitStatusQueued` in interface `JmolScriptManager`

    - #### checkScriptExecution

          private java.lang.String checkScriptExecution(java.lang.String strScript,
                                                        boolean isInsert)

    - #### checkResume

          private boolean checkResume(java.lang.String str)

    - #### checkStepping

          private boolean checkStepping(java.lang.String str)

    - #### evalStringQuietSync

          public java.lang.String evalStringQuietSync(java.lang.String strScript,
                                                      boolean isQuiet,
                                                      boolean allowSyncScript)

      Specified by:
        `evalStringQuietSync` in interface `JmolScriptManager`

    - #### checkHalt

          public boolean checkHalt(java.lang.String str,
                                   boolean isInsert)

      Specified by:
        `checkHalt` in interface `JmolScriptManager`

    - #### getAtomBitSetEval

          public javajs.util.BS getAtomBitSetEval(JmolScriptEvaluator eval,
                                                  java.lang.Object atomExpression)

      Specified by:
        `getAtomBitSetEval` in interface `JmolScriptManager`

    - #### scriptCheckRet

          public java.lang.Object scriptCheckRet(java.lang.String strScript,
                                                 boolean returnContext)

      Specified by:
        `scriptCheckRet` in interface `JmolScriptManager`

    - #### openFileAsync

          public void openFileAsync(java.lang.String fileName,
                                    int flags)

      From file dropping.
      Specified by:
        `openFileAsync` in interface `JmolScriptManager`
      Parameters:
        `fileName` -
        `flags` - 1=pdbCartoons, 2=no scripting, 4=append, 8=noAutoPlay

    - #### getDragDropFileTypeName

          private java.lang.String getDragDropFileTypeName(java.lang.String fileName)

    - #### getZipDirectoryAsString

          private java.lang.String getZipDirectoryAsString(java.lang.String fileName)

    - #### setStateScriptVersion

          public static void setStateScriptVersion(Viewer vwr,
                                                   java.lang.String version)

    - #### addHydrogensInline

          public javajs.util.BS addHydrogensInline(javajs.util.BS bsAtoms,
                                                   javajs.util.Lst<Atom> vConnections,
                                                   javajs.util.P3[] pts)
                                            throws java.lang.Exception

      Specified by:
        `addHydrogensInline` in interface `JmolScriptManager`
      Throws:
        `java.lang.Exception`