StatusManager
Date: 2019-10-22

org.jmol.viewer

## Class StatusManager

- java.lang.Object
- - org.jmol.viewer.StatusManager

-     public class StatusManager
      extends java.lang.Object

  The StatusManager class handles all details of status reporting, including: 1) saving the message in a queue that replaces the "callback" mechanism, 2) sending messages off to the console, and 3) delivering messages back to the main Jmol.java class in app or applet to handle differences in capabilities, including true callbacks. atomPicked fileLoaded fileLoadError frameChanged measureCompleted measurePending measurePicked newOrientation scriptEcho scriptError scriptMessage scriptStarted scriptStatus scriptTerminated userAction vwrRefreshed Bob Hanson hansonr@stolaf.edu 2/2006

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `allowStatusReporting`
    `private java.util.Map<java.lang.String,JmolAudioPlayer>` | `audios`
    `JmolCallbackListener` | `cbl`
    `private boolean` | `drivingSync`
    `private java.util.Map<java.lang.String,GenericImageDialog>` | `imageMap`
    `private java.lang.String` | `imageType`
    `private boolean` | `isSynced`
    `private java.util.Map<CBK,java.lang.String>` | `jmolScriptCallbacks`
    `(package private) JmolStatusListener` | `jsl`
    `private static int` | `MAXIMUM_QUEUE_LENGTH`
    `java.util.Map<java.lang.String,javajs.util.Lst<javajs.util.Lst<java.lang.Object>>>` | `messageQueue`
    `private int` | `minSyncRepeatMs`
    `private int` | `qualityJPG`
    `private int` | `qualityPNG`
    `java.lang.String` | `statusList`
    `private int` | `statusPtr`
    `(package private) boolean` | `stereoSync`
    `static int` | `SYNC_DISABLE`
    `static int` | `SYNC_DRIVER`
    `static int` | `SYNC_ENABLE`
    `static int` | `SYNC_OFF`
    `static int` | `SYNC_SLAVE`
    `static int` | `SYNC_STEREO`
    `private boolean` | `syncDisabled`
    `(package private) boolean` | `syncingMouse`
    `boolean` | `syncingScripts`
    `protected Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StatusManager(Viewer vwr)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearConsole()`
    `(package private) java.lang.String` | `createImage(java.lang.String fileNameOrError, java.lang.String type, java.lang.String text, byte[] bytes, int quality)` offer to let application do the image creation.
    `(package private) java.lang.String` | `dialogAsk(java.lang.String type, java.lang.String fileName, java.util.Map<java.lang.String,java.lang.Object> params)`
    `(package private) boolean` | `doSync()`
    `(package private) float[][]` | `functionXY(java.lang.String functionName, int nX, int nY)`
    `(package private) float[][][]` | `functionXYZ(java.lang.String functionName, int nX, int nY, int nZ)`
    `(package private) java.util.Map<java.lang.String,java.lang.Object>` | `getJspecViewProperties(java.lang.String myParam)`
    `(package private) java.util.Map<java.lang.String,java.lang.Object>` | `getRegistryInfo()`
    `(package private) javajs.util.Lst<javajs.util.Lst<javajs.util.Lst<java.lang.Object>>>` | `getStatusChanged(java.lang.String newStatusList)`
    `int` | `getSyncMode()`
    `(package private) boolean` | `haveHoverCallback()`
    `private java.lang.String` | `jmolScriptCallback(CBK callback)`
    `(package private) java.lang.String` | `jsEval(java.lang.String strEval)`
    `void` | `modifySend(int atomIndex, int modelIndex, int mode, java.lang.String msg)`
    `void` | `notifyAudioStatus(java.util.Map<java.lang.String,java.lang.Object> htParams)` called from JmolAudio
    `(package private) boolean` | `notifyEnabled(CBK type)`
    `(package private) void` | `notifyError(java.lang.String errType, java.lang.String errMsg, java.lang.String errMsgUntranslated)`
    `(package private) void` | `notifyMinimizationStatus(java.lang.String minStatus, java.lang.Integer minSteps, java.lang.Float minEnergy, java.lang.Float minEnergyDiff, java.lang.String ff)`
    `void` | `playAudio(java.util.Map<java.lang.String,java.lang.Object> htParams)`
    `(package private) void` | `processScript(java.lang.Object[] data)`
    `java.lang.Object` | `processService(java.util.Map<java.lang.String,java.lang.Object> info)` service is expected to return a value in the "ret" key
    `private boolean` | `recordStatus(java.lang.String statusName)`
    `void` | `registerAudio(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> htParams)`
    `int[]` | `resizeInnerPanel(int width, int height)`
    `void` | `resizeInnerPanelString(java.lang.String data)` called by file droppers
    `(package private) void` | `setCallbackFunction(java.lang.String callbackType, java.lang.String callbackFunction)`
    `(package private) void` | `setFileLoadStatus(java.lang.String fullPathName, java.lang.String fileName, java.lang.String modelName, java.lang.String errorMsg, int ptLoad, boolean doCallback, java.lang.Boolean isAsync)`
    `(package private) void` | `setScriptEcho(java.lang.String strEcho, boolean isScriptQueued)`
    `(package private) void` | `setScriptStatus(java.lang.String strStatus, java.lang.String statusMessage, int msWalltime, java.lang.String strErrorMessageUntranslated)`
    `(package private) void` | `setStatusAppletReady(java.lang.String htmlName, boolean isReady)`
    `(package private) void` | `setStatusAtomHovered(int iatom, java.lang.String strInfo)`
    `(package private) void` | `setStatusAtomMoved(javajs.util.BS bsMoved)`
    `(package private) void` | `setStatusAtomPicked(int atomIndex, java.lang.String strInfo, java.util.Map<java.lang.String,java.lang.Object> map)`
    `private void` | `setStatusChanged(java.lang.String statusName, int intInfo, java.lang.Object statusInfo, boolean isReplace)`
    `(package private) int` | `setStatusClicked(int x, int y, int action, int clickCount, int mode)`
    `(package private) boolean` | `setStatusDragDropped(int mode, int x, int y, java.lang.String fileName)`
    `(package private) void` | `setStatusFrameChanged(int fileNo, int modelNo, int firstNo, int lastNo, int currentFrame, float currentMorphModel, java.lang.String entryName)`
    `(package private) void` | `setStatusMeasuring(java.lang.String status, int intInfo, java.lang.String strMeasure, float value)`
    `(package private) void` | `setStatusObjectHovered(java.lang.String id, java.lang.String strInfo, javajs.util.T3 pt)`
    `(package private) void` | `setStatusResized(int width, int height)`
    `(package private) void` | `setSync(java.lang.String mouseCommand)`
    `(package private) void` | `setSyncDriver(int syncMode)`
    `(package private) void` | `showImage(java.lang.String title, java.lang.Object image)` called by Viewer.loadImageData to pop up a window with an image in it
    `(package private) void` | `showUrl(java.lang.String urlString)`
    `private void` | `stopAudio(java.lang.String id)`
    `java.lang.Object` | `syncSend(java.lang.String script, java.lang.Object appletNameOrProp, int port)`

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

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

- - ### Field Detail

    - #### vwr

          protected Viewer vwr

    - #### jsl

          JmolStatusListener jsl

    - #### cbl

          public JmolCallbackListener cbl

    - #### statusList

          public java.lang.String statusList

    - #### allowStatusReporting

          public boolean allowStatusReporting

    - #### messageQueue

          public java.util.Map<java.lang.String,javajs.util.Lst<javajs.util.Lst<java.lang.Object>>> messageQueue

    - #### statusPtr

          private int statusPtr

    - #### MAXIMUM_QUEUE_LENGTH

          private static int MAXIMUM_QUEUE_LENGTH

    - #### jmolScriptCallbacks

          private java.util.Map<CBK,java.lang.String> jmolScriptCallbacks

    - #### imageMap

          private java.util.Map<java.lang.String,GenericImageDialog> imageMap

    - #### minSyncRepeatMs

          private int minSyncRepeatMs

    - #### syncingScripts

          public boolean syncingScripts

    - #### syncingMouse

          boolean syncingMouse

    - #### drivingSync

          private boolean drivingSync

    - #### isSynced

          private boolean isSynced

    - #### syncDisabled

          private boolean syncDisabled

    - #### stereoSync

          boolean stereoSync

    - #### SYNC_OFF

          public static final int SYNC_OFF

      See Also:
        Constant Field Values

    - #### SYNC_DRIVER

          public static final int SYNC_DRIVER

      See Also:
        Constant Field Values

    - #### SYNC_SLAVE

          public static final int SYNC_SLAVE

      See Also:
        Constant Field Values

    - #### SYNC_DISABLE

          public static final int SYNC_DISABLE

      See Also:
        Constant Field Values

    - #### SYNC_ENABLE

          public static final int SYNC_ENABLE

      See Also:
        Constant Field Values

    - #### SYNC_STEREO

          public static final int SYNC_STEREO

      See Also:
        Constant Field Values

    - #### qualityJPG

          private int qualityJPG

    - #### qualityPNG

          private int qualityPNG

    - #### imageType

          private java.lang.String imageType

    - #### audios

          private java.util.Map<java.lang.String,JmolAudioPlayer> audios

  - ### Constructor Detail

    - #### StatusManager

          StatusManager(Viewer vwr)

  - ### Method Detail

    - #### recordStatus

          private boolean recordStatus(java.lang.String statusName)

    - #### setStatusChanged

          private void setStatusChanged(java.lang.String statusName,
                                        int intInfo,
                                        java.lang.Object statusInfo,
                                        boolean isReplace)

    - #### getStatusChanged

          javajs.util.Lst<javajs.util.Lst<javajs.util.Lst<java.lang.Object>>> getStatusChanged(java.lang.String newStatusList)

    - #### jmolScriptCallback

          private java.lang.String jmolScriptCallback(CBK callback)

    - #### setCallbackFunction

          void setCallbackFunction(java.lang.String callbackType,
                                   java.lang.String callbackFunction)

    - #### notifyEnabled

          boolean notifyEnabled(CBK type)

    - #### setStatusAppletReady

          void setStatusAppletReady(java.lang.String htmlName,
                                    boolean isReady)

    - #### setStatusAtomMoved

          void setStatusAtomMoved(javajs.util.BS bsMoved)

    - #### setStatusAtomPicked

          void setStatusAtomPicked(int atomIndex,
                                   java.lang.String strInfo,
                                   java.util.Map<java.lang.String,java.lang.Object> map)

      Parameters:
        `atomIndex` - -2 for draw, -3 for bond
        `strInfo` -
        `map` -

    - #### setStatusClicked

          int setStatusClicked(int x,
                               int y,
                               int action,
                               int clickCount,
                               int mode)

    - #### setStatusResized

          void setStatusResized(int width,
                                int height)

    - #### haveHoverCallback

          boolean haveHoverCallback()

    - #### setStatusAtomHovered

          void setStatusAtomHovered(int iatom,
                                    java.lang.String strInfo)

    - #### setStatusObjectHovered

          void setStatusObjectHovered(java.lang.String id,
                                      java.lang.String strInfo,
                                      javajs.util.T3 pt)

    - #### showImage

          void showImage(java.lang.String title,
                         java.lang.Object image)

      called by Viewer.loadImageData to pop up a window with an image in it
      Parameters:
        `title` -
        `image` - or Boolean.TRUE for "close all" or Boolean.FALSE for "close"

    - #### setFileLoadStatus

          void setFileLoadStatus(java.lang.String fullPathName,
                                 java.lang.String fileName,
                                 java.lang.String modelName,
                                 java.lang.String errorMsg,
                                 int ptLoad,
                                 boolean doCallback,
                                 java.lang.Boolean isAsync)

    - #### setStatusFrameChanged

          void setStatusFrameChanged(int fileNo,
                                     int modelNo,
                                     int firstNo,
                                     int lastNo,
                                     int currentFrame,
                                     float currentMorphModel,
                                     java.lang.String entryName)

    - #### setStatusDragDropped

          boolean setStatusDragDropped(int mode,
                                       int x,
                                       int y,
                                       java.lang.String fileName)

    - #### setScriptEcho

          void setScriptEcho(java.lang.String strEcho,
                             boolean isScriptQueued)

    - #### setStatusMeasuring

          void setStatusMeasuring(java.lang.String status,
                                  int intInfo,
                                  java.lang.String strMeasure,
                                  float value)

    - #### notifyError

          void notifyError(java.lang.String errType,
                           java.lang.String errMsg,
                           java.lang.String errMsgUntranslated)

    - #### notifyMinimizationStatus

          void notifyMinimizationStatus(java.lang.String minStatus,
                                        java.lang.Integer minSteps,
                                        java.lang.Float minEnergy,
                                        java.lang.Float minEnergyDiff,
                                        java.lang.String ff)

    - #### setScriptStatus

          void setScriptStatus(java.lang.String strStatus,
                               java.lang.String statusMessage,
                               int msWalltime,
                               java.lang.String strErrorMessageUntranslated)

    - #### processScript

          void processScript(java.lang.Object[] data)

    - #### doSync

          boolean doSync()

    - #### setSync

          void setSync(java.lang.String mouseCommand)

    - #### setSyncDriver

          void setSyncDriver(int syncMode)

    - #### syncSend

          public java.lang.Object syncSend(java.lang.String script,
                                           java.lang.Object appletNameOrProp,
                                           int port)

    - #### modifySend

          public void modifySend(int atomIndex,
                                 int modelIndex,
                                 int mode,
                                 java.lang.String msg)

    - #### processService

          public java.lang.Object processService(java.util.Map<java.lang.String,java.lang.Object> info)

      service is expected to return a value in the "ret" key
      Parameters:
        `info` - with key "service"
      Returns:
        info, for chaining

    - #### getSyncMode

          public int getSyncMode()

    - #### showUrl

          void showUrl(java.lang.String urlString)

    - #### clearConsole

          public void clearConsole()

    - #### functionXY

          float[][] functionXY(java.lang.String functionName,
                               int nX,
                               int nY)

    - #### functionXYZ

          float[][][] functionXYZ(java.lang.String functionName,
                                  int nX,
                                  int nY,
                                  int nZ)

    - #### jsEval

          java.lang.String jsEval(java.lang.String strEval)

      Parameters:
        `strEval` -
      Returns:
        in Java a String; in JavaScript window.eval()

    - #### createImage

          java.lang.String createImage(java.lang.String fileNameOrError,
                                       java.lang.String type,
                                       java.lang.String text,
                                       byte[] bytes,
                                       int quality)

      offer to let application do the image creation. if text_or_bytes == null, then this is an error report.
      Parameters:
        `fileNameOrError` -
        `type` -
        `text` -
        `bytes` -
        `quality` -
      Returns:
        null (canceled) or a message starting with OK or an error message

    - #### getRegistryInfo

          java.util.Map<java.lang.String,java.lang.Object> getRegistryInfo()

    - #### dialogAsk

          java.lang.String dialogAsk(java.lang.String type,
                                     java.lang.String fileName,
                                     java.util.Map<java.lang.String,java.lang.Object> params)

    - #### getJspecViewProperties

          java.util.Map<java.lang.String,java.lang.Object> getJspecViewProperties(java.lang.String myParam)

    - #### resizeInnerPanel

          public int[] resizeInnerPanel(int width,
                                        int height)

    - #### resizeInnerPanelString

          public void resizeInnerPanelString(java.lang.String data)

      called by file droppers
      Parameters:
        `data` -

    - #### registerAudio

          public void registerAudio(java.lang.String id,
                                    java.util.Map<java.lang.String,java.lang.Object> htParams)

    - #### stopAudio

          private void stopAudio(java.lang.String id)

    - #### playAudio

          public void playAudio(java.util.Map<java.lang.String,java.lang.Object> htParams)

    - #### notifyAudioStatus

          public void notifyAudioStatus(java.util.Map<java.lang.String,java.lang.Object> htParams)

      called from JmolAudio
      Parameters:
        `htParams` -