StateCreator
Date: 2019-10-22

org.jmol.viewer

## Class StateCreator

- java.lang.Object
- - org.jmol.viewer.JmolStateCreator
  - - org.jmol.viewer.StateCreator

-     public class StateCreator
      extends JmolStateCreator

  StateCreator handles all aspects of working with the "state" as generally defined, including -- creating the state script -- general output, including logging -- handling undo/redo -- processing SYNC directives Called by reflection only; all state generation script here, for modularization in JavaScript

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static int` | `MAX_ACTION_UNDO`
    `private java.util.Map<java.lang.String,javajs.util.BS>` | `temp`
    `private java.util.Map<java.lang.String,javajs.util.BS>` | `temp2`
    `private java.util.Map<java.lang.String,javajs.util.BS>` | `temp3`
    `private boolean` | `undoWorking`
    `private Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StateCreator()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `addBs(javajs.util.SB sb, java.lang.String key, javajs.util.BS bs)`
    `private void` | `addFunctions(javajs.util.SB s, java.util.Map<java.lang.String,JmolScriptFunction> ht, java.lang.String selectedFunction, boolean isGeneric, boolean namesOnly)`
    `private static void` | `addTickInfo(javajs.util.SB sb, TickInfo tickInfo, boolean addFirst)`
    `private void` | `app(javajs.util.SB s, java.lang.String cmd)`
    `private void` | `appendLoadStates(javajs.util.SB cmds)`
    `private void` | `appendTickInfo(java.lang.String myType, javajs.util.SB sb, TickInfo t)`
    `private static java.lang.String` | `chop(java.lang.String s)`
    `private void` | `clearTemp()`
    `(package private) java.lang.String` | `getAllSettings(java.lang.String prefix)`
    `private java.lang.String` | `getAnimState(AnimationManager am, javajs.util.SB sfunc)`
    `(package private) java.lang.String` | `getAtomicPropertyState(int taintWhat, javajs.util.BS bsSelected)`
    `(package private) void` | `getAtomicPropertyStateBuffer(javajs.util.SB commands, int type, javajs.util.BS bs, java.lang.String label, float[] fData)`
    `java.lang.String` | `getAtomShapeState(AtomShape shape)`
    `private java.lang.String` | `getAxesState(Axes axes)`
    `private java.lang.String` | `getBondState(Sticks shape)`
    `private int` | `getCEState(ColorEncoder p, javajs.util.SB s)`
    `private java.lang.String` | `getColorState(ColorManager cm, javajs.util.SB sfunc)`
    `(package private) java.lang.String` | `getCommands(java.util.Map<java.lang.String,javajs.util.BS> htDefine, java.util.Map<java.lang.String,javajs.util.BS> htMore, java.lang.String selectCmd)`
    `private java.lang.String` | `getCommands2(java.util.Map<java.lang.String,javajs.util.BS> ht, javajs.util.SB s, java.lang.String setPrev, java.lang.String selectCmd)`
    `private java.lang.String` | `getDataState(javajs.util.SB sfunc)`
    `private java.lang.String` | `getDefaultLabelState(Labels l)`
    `private java.lang.String` | `getDefinedState(javajs.util.SB sfunc, boolean isAll)`
    `private java.lang.String` | `getFileState(javajs.util.SB sfunc)`
    `private java.lang.String` | `getFontLineShapeState(FontLineShape shape)`
    `private java.lang.String` | `getFontState(java.lang.String myType, Font font3d)`
    `(package private) java.lang.String` | `getFunctionCalls(java.lang.String f)`
    `void` | `getInlineData(javajs.util.SB loadScript, java.lang.String strModel, boolean isAppend, java.lang.String loadFilter)`
    `(package private) java.lang.String` | `getLightingState(boolean isAll)`
    `private java.lang.String` | `getMeasurementState(Measures shape)`
    `(package private) java.lang.String` | `getModelState(javajs.util.SB sfunc, boolean isAll, boolean withProteinStructure)`
    `private java.lang.String` | `getParameterState(GlobalSettings global, javajs.util.SB sfunc)` note that these are not user variables, only global jmol parameters
    `private java.lang.String` | `getSelectionState(SelectionManager sm, javajs.util.SB sfunc)`
    `private java.lang.String` | `getShapeState(Shape shape)`
    `private void` | `getShapeStatePriv(javajs.util.SB commands, boolean isAll, int iShape)`
    `(package private) java.lang.String` | `getSpinState(boolean isAll)`
    `(package private) java.lang.String` | `getStateScript(java.lang.String type, int width, int height)`
    `private java.lang.String` | `getTextState(Text t)`
    `private java.lang.String` | `getViewState(TransformManager tm, javajs.util.SB sfunc)`
    `private java.lang.String` | `getWindowState(javajs.util.SB sfunc, int width, int height)`
    `private void` | `getZshadeState(javajs.util.SB s, TransformManager tm, boolean isAll)`
    `private static boolean` | `isTainted(javajs.util.BS[] tainted, int atomIndex, int type)`
    `(package private) void` | `mouseScript(java.lang.String script)`
    `(package private) void` | `setViewer(Viewer vwr)`
    `(package private) void` | `syncScript(java.lang.String script, java.lang.String applet, int port)`
    `(package private) void` | `undoMoveAction(int action, int n)`
    `(package private) void` | `undoMoveActionClear(int taintedAtom, int type, boolean clearRedo)`

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

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

- - ### Field Detail

    - #### vwr

          private Viewer vwr

    - #### temp

          private java.util.Map<java.lang.String,javajs.util.BS> temp

    - #### temp2

          private java.util.Map<java.lang.String,javajs.util.BS> temp2

    - #### temp3

          private java.util.Map<java.lang.String,javajs.util.BS> temp3

    - #### undoWorking

          private boolean undoWorking

    - #### MAX_ACTION_UNDO

          private static final int MAX_ACTION_UNDO

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StateCreator

          public StateCreator()

  - ### Method Detail

    - #### setViewer

          void setViewer(Viewer vwr)

      Specified by:
        `setViewer` in class `JmolStateCreator`

    - #### getStateScript

          java.lang.String getStateScript(java.lang.String type,
                                          int width,
                                          int height)

      Specified by:
        `getStateScript` in class `JmolStateCreator`

    - #### getDataState

          private java.lang.String getDataState(javajs.util.SB sfunc)

    - #### getDefinedState

          private java.lang.String getDefinedState(javajs.util.SB sfunc,
                                                   boolean isAll)

    - #### getModelState

          java.lang.String getModelState(javajs.util.SB sfunc,
                                         boolean isAll,
                                         boolean withProteinStructure)

      Specified by:
        `getModelState` in class `JmolStateCreator`

    - #### getWindowState

          private java.lang.String getWindowState(javajs.util.SB sfunc,
                                                  int width,
                                                  int height)

    - #### getLightingState

          java.lang.String getLightingState(boolean isAll)

      Specified by:
        `getLightingState` in class `JmolStateCreator`

    - #### getFileState

          private java.lang.String getFileState(javajs.util.SB sfunc)

    - #### appendLoadStates

          private void appendLoadStates(javajs.util.SB cmds)

    - #### getInlineData

          public void getInlineData(javajs.util.SB loadScript,
                                    java.lang.String strModel,
                                    boolean isAppend,
                                    java.lang.String loadFilter)

      Specified by:
        `getInlineData` in class `JmolStateCreator`

    - #### getColorState

          private java.lang.String getColorState(ColorManager cm,
                                                 javajs.util.SB sfunc)

    - #### getCEState

          private int getCEState(ColorEncoder p,
                                 javajs.util.SB s)

    - #### getAnimState

          private java.lang.String getAnimState(AnimationManager am,
                                                javajs.util.SB sfunc)

    - #### getParameterState

          private java.lang.String getParameterState(GlobalSettings global,
                                                     javajs.util.SB sfunc)

      note that these are not user variables, only global jmol parameters
      Parameters:
        `global` -
        `sfunc` -
      Returns:
        String

    - #### getDefaultLabelState

          private java.lang.String getDefaultLabelState(Labels l)

    - #### getSelectionState

          private java.lang.String getSelectionState(SelectionManager sm,
                                                     javajs.util.SB sfunc)

    - #### getViewState

          private java.lang.String getViewState(TransformManager tm,
                                                javajs.util.SB sfunc)

    - #### getZshadeState

          private void getZshadeState(javajs.util.SB s,
                                      TransformManager tm,
                                      boolean isAll)

    - #### getSpinState

          java.lang.String getSpinState(boolean isAll)

      Specified by:
        `getSpinState` in class `JmolStateCreator`
      Parameters:
        `isAll` -
      Returns:
        spin state

    - #### getCommands

          java.lang.String getCommands(java.util.Map<java.lang.String,javajs.util.BS> htDefine,
                                       java.util.Map<java.lang.String,javajs.util.BS> htMore,
                                       java.lang.String selectCmd)

      Specified by:
        `getCommands` in class `JmolStateCreator`

    - #### getCommands2

          private java.lang.String getCommands2(java.util.Map<java.lang.String,javajs.util.BS> ht,
                                                javajs.util.SB s,
                                                java.lang.String setPrev,
                                                java.lang.String selectCmd)

    - #### app

          private void app(javajs.util.SB s,
                           java.lang.String cmd)

    - #### addBs

          private void addBs(javajs.util.SB sb,
                             java.lang.String key,
                             javajs.util.BS bs)

    - #### getFontState

          private java.lang.String getFontState(java.lang.String myType,
                                                Font font3d)

    - #### appendTickInfo

          private void appendTickInfo(java.lang.String myType,
                                      javajs.util.SB sb,
                                      TickInfo t)

    - #### addTickInfo

          private static void addTickInfo(javajs.util.SB sb,
                                          TickInfo tickInfo,
                                          boolean addFirst)

    - #### getMeasurementState

          private java.lang.String getMeasurementState(Measures shape)

    - #### getShapeStatePriv

          private void getShapeStatePriv(javajs.util.SB commands,
                                         boolean isAll,
                                         int iShape)

    - #### getBondState

          private java.lang.String getBondState(Sticks shape)

    - #### clearTemp

          private void clearTemp()

    - #### getShapeState

          private java.lang.String getShapeState(Shape shape)

    - #### getFontLineShapeState

          private java.lang.String getFontLineShapeState(FontLineShape shape)

    - #### getAxesState

          private java.lang.String getAxesState(Axes axes)

    - #### getAtomShapeState

          public java.lang.String getAtomShapeState(AtomShape shape)

      Specified by:
        `getAtomShapeState` in class `JmolStateCreator`

    - #### getTextState

          private java.lang.String getTextState(Text t)

    - #### getAllSettings

          java.lang.String getAllSettings(java.lang.String prefix)

      Specified by:
        `getAllSettings` in class `JmolStateCreator`

    - #### chop

          private static java.lang.String chop(java.lang.String s)

    - #### getFunctionCalls

          java.lang.String getFunctionCalls(java.lang.String f)

      Specified by:
        `getFunctionCalls` in class `JmolStateCreator`

    - #### addFunctions

          private void addFunctions(javajs.util.SB s,
                                    java.util.Map<java.lang.String,JmolScriptFunction> ht,
                                    java.lang.String selectedFunction,
                                    boolean isGeneric,
                                    boolean namesOnly)

    - #### isTainted

          private static boolean isTainted(javajs.util.BS[] tainted,
                                           int atomIndex,
                                           int type)

    - #### getAtomicPropertyState

          java.lang.String getAtomicPropertyState(int taintWhat,
                                                  javajs.util.BS bsSelected)

      Specified by:
        `getAtomicPropertyState` in class `JmolStateCreator`

    - #### getAtomicPropertyStateBuffer

          void getAtomicPropertyStateBuffer(javajs.util.SB commands,
                                            int type,
                                            javajs.util.BS bs,
                                            java.lang.String label,
                                            float[] fData)

      Specified by:
        `getAtomicPropertyStateBuffer` in class `JmolStateCreator`

    - #### undoMoveAction

          void undoMoveAction(int action,
                              int n)

      Specified by:
        `undoMoveAction` in class `JmolStateCreator`

    - #### undoMoveActionClear

          void undoMoveActionClear(int taintedAtom,
                                   int type,
                                   boolean clearRedo)

      Specified by:
        `undoMoveActionClear` in class `JmolStateCreator`

    - #### syncScript

          void syncScript(java.lang.String script,
                          java.lang.String applet,
                          int port)

      Specified by:
        `syncScript` in class `JmolStateCreator`

    - #### mouseScript

          void mouseScript(java.lang.String script)

      Specified by:
        `mouseScript` in class `JmolStateCreator`