GenericConsole
Date: 2019-10-22

org.jmol.console

## Class GenericConsole

- java.lang.Object
- - org.jmol.console.GenericConsole

- All Implemented Interfaces:
    JmolAppConsoleInterface, JmolCallbackListener
  Direct Known Subclasses:
    AppletConsole, JmolConsole

      public abstract class GenericConsole
      extends java.lang.Object
      implements JmolAppConsoleInterface, JmolCallbackListener

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected JmolAbstractButton` | `clearInButton`
    `protected JmolAbstractButton` | `clearOutButton`
    `protected java.lang.String` | `defaultMessage`
    `protected JmolAbstractButton` | `editButton`
    `protected JmolAbstractButton` | `historyButton`
    `private java.lang.String` | `incompleteCmd`
    `protected GenericTextArea` | `input`
    `protected JmolAbstractButton` | `label1`
    `protected static java.util.Map<java.lang.String,java.lang.String>` | `labels`
    `protected JmolAbstractButton` | `loadButton`
    `protected java.util.Map<java.lang.String,java.lang.Object>` | `menuMap`
    `int` | `nTab`
    `protected GenericTextArea` | `output`
    `protected JmolAbstractButton` | `runButton`
    `protected JmolAbstractButton` | `stateButton`
    `Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericConsole()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected JmolAbstractButton` | `addButton(JmolAbstractButton b, java.lang.String label)`
    `protected void` | `clearContent(java.lang.String text)`
    `java.lang.String` | `completeCommand(java.lang.String thisCmd)`
    `protected void` | `destroyConsole()`
    `protected void` | `displayConsole()`
    `abstract void` | `dispose()`
    `protected void` | `doAction(java.lang.Object source)`
    `protected void` | `execute(java.lang.String strCommand)`
    `static java.lang.String` | `getLabel(java.lang.String key)`
    `protected JmolAbstractButton` | `getLabel1()`
    `static java.lang.String` | `getLabelWithoutMnemonic(java.lang.String label)`
    `(package private) static char` | `getMnemonic(java.lang.String label)`
    `abstract JmolScriptEditorInterface` | `getScriptEditor()`
    `java.lang.String` | `getText()`
    `protected abstract boolean` | `isMenuItem(java.lang.Object source)`
    `protected abstract void` | `layoutWindow(java.lang.String enabledButtons)`
    `static void` | `map(java.lang.Object button, java.lang.String key, java.lang.String label, java.util.Map<java.lang.String,java.lang.Object> menuMap)`
    `protected abstract java.lang.String` | `nextFileName(java.lang.String stub, int nTab)`
    `void` | `notifyCallback(CBK type, java.lang.Object[] data)`
    `boolean` | `notifyEnabled(CBK type)`
    `private void` | `outputMsg(java.lang.String message)`
    `protected int` | `processKey(int kcode, int kid, boolean isControlDown)`
    `protected void` | `recallCommand(boolean up)`
    `void` | `sendConsoleEcho(java.lang.String strEcho)`
    `void` | `sendConsoleMessage(java.lang.String strInfo)`
    `static void` | `setAbstractButtonLabels(java.util.Map<java.lang.String,java.lang.Object> menuMap, java.util.Map<java.lang.String,java.lang.String> labels)`
    `protected abstract JmolAbstractButton` | `setButton(java.lang.String text)`
    `void` | `setCallbackFunction(java.lang.String callbackType, java.lang.String callbackFunction)`
    `protected void` | `setLabels()`
    `protected abstract void` | `setTitle()`
    `protected void` | `setupLabels(java.util.Map<java.lang.String,java.lang.String> labels)`
    `protected void` | `setupLabels0(java.util.Map<java.lang.String,java.lang.String> labels)`
    `protected void` | `setViewer(Viewer vwr)`
    `abstract void` | `setVisible(boolean visible)`
    `private static java.lang.String[]` | `splitCommandLine(java.lang.String cmd)` separate a command line into three sections: prefix....;cmd ........
    `protected void` | `updateLabels()`
    `void` | `zap()`

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

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

    - ### Methods inherited from interface org.jmol.api.JmolAppConsoleInterface

      `newJMenu, newJMenuItem, start`

- - ### Field Detail

    - #### input

          protected GenericTextArea input

    - #### output

          protected GenericTextArea output

    - #### vwr

          public Viewer vwr

    - #### labels

          protected static java.util.Map<java.lang.String,java.lang.String> labels

    - #### menuMap

          protected java.util.Map<java.lang.String,java.lang.Object> menuMap

    - #### editButton

          protected JmolAbstractButton editButton

    - #### runButton

          protected JmolAbstractButton runButton

    - #### historyButton

          protected JmolAbstractButton historyButton

    - #### stateButton

          protected JmolAbstractButton stateButton

    - #### clearOutButton

          protected JmolAbstractButton clearOutButton

    - #### clearInButton

          protected JmolAbstractButton clearInButton

    - #### loadButton

          protected JmolAbstractButton loadButton

    - #### defaultMessage

          protected java.lang.String defaultMessage

    - #### label1

          protected JmolAbstractButton label1

    - #### nTab

          public int nTab

    - #### incompleteCmd

          private java.lang.String incompleteCmd

  - ### Constructor Detail

    - #### GenericConsole

          public GenericConsole()

  - ### Method Detail

    - #### setViewer

          protected void setViewer(Viewer vwr)

    - #### isMenuItem

          protected abstract boolean isMenuItem(java.lang.Object source)

    - #### layoutWindow

          protected abstract void layoutWindow(java.lang.String enabledButtons)

    - #### setTitle

          protected abstract void setTitle()

    - #### setVisible

          public abstract void setVisible(boolean visible)

      Specified by:
        `setVisible` in interface `JmolAppConsoleInterface`

    - #### getScriptEditor

          public abstract JmolScriptEditorInterface getScriptEditor()

      Specified by:
        `getScriptEditor` in interface `JmolAppConsoleInterface`

    - #### dispose

          public abstract void dispose()

      Specified by:
        `dispose` in interface `JmolAppConsoleInterface`

    - #### setButton

          protected abstract JmolAbstractButton setButton(java.lang.String text)

    - #### addButton

          protected JmolAbstractButton addButton(JmolAbstractButton b,
                                                 java.lang.String label)

    - #### getLabel1

          protected JmolAbstractButton getLabel1()

    - #### setupLabels

          protected void setupLabels(java.util.Map<java.lang.String,java.lang.String> labels)

    - #### setupLabels0

          protected void setupLabels0(java.util.Map<java.lang.String,java.lang.String> labels)

    - #### setLabels

          protected void setLabels()

    - #### getLabel

          public static java.lang.String getLabel(java.lang.String key)

    - #### displayConsole

          protected void displayConsole()

    - #### updateLabels

          protected void updateLabels()

    - #### nextFileName

          protected abstract java.lang.String nextFileName(java.lang.String stub,
                                                           int nTab)

    - #### completeCommand

          public java.lang.String completeCommand(java.lang.String thisCmd)

    - #### doAction

          protected void doAction(java.lang.Object source)

    - #### execute

          protected void execute(java.lang.String strCommand)

    - #### destroyConsole

          protected void destroyConsole()

    - #### setAbstractButtonLabels

          public static void setAbstractButtonLabels(java.util.Map<java.lang.String,java.lang.Object> menuMap,
                                                     java.util.Map<java.lang.String,java.lang.String> labels)

    - #### getLabelWithoutMnemonic

          public static java.lang.String getLabelWithoutMnemonic(java.lang.String label)

    - #### getMnemonic

          static char getMnemonic(java.lang.String label)

    - #### map

          public static void map(java.lang.Object button,
                                 java.lang.String key,
                                 java.lang.String label,
                                 java.util.Map<java.lang.String,java.lang.Object> menuMap)

    - #### notifyEnabled

          public boolean notifyEnabled(CBK type)

      Specified by:
        `notifyEnabled` in interface `JmolCallbackListener`

    - #### notifyCallback

          public void notifyCallback(CBK type,
                                     java.lang.Object[] data)

      Specified by:
        `notifyCallback` in interface `JmolCallbackListener`

    - #### getText

          public java.lang.String getText()

      Specified by:
        `getText` in interface `JmolAppConsoleInterface`

    - #### sendConsoleEcho

          public void sendConsoleEcho(java.lang.String strEcho)

      Specified by:
        `sendConsoleEcho` in interface `JmolAppConsoleInterface`

    - #### outputMsg

          private void outputMsg(java.lang.String message)

    - #### clearContent

          protected void clearContent(java.lang.String text)

    - #### sendConsoleMessage

          public void sendConsoleMessage(java.lang.String strInfo)

      Specified by:
        `sendConsoleMessage` in interface `JmolAppConsoleInterface`

    - #### setCallbackFunction

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

      Specified by:
        `setCallbackFunction` in interface `JmolCallbackListener`

    - #### zap

          public void zap()

      Specified by:
        `zap` in interface `JmolAppConsoleInterface`

    - #### recallCommand

          protected void recallCommand(boolean up)

    - #### processKey

          protected int processKey(int kcode,
                                   int kid,
                                   boolean isControlDown)

      Parameters:
        `kcode` -
        `kid` -
        `isControlDown` -
      Returns:
        1 = consume; 2 = super.process; 3 = both

    - #### splitCommandLine

          private static java.lang.String[] splitCommandLine(java.lang.String cmd)

      separate a command line into three sections: prefix....;cmd ........ token where token can be a just-finished single or double quote or a string of characters
      Parameters:
        `cmd` -
      Returns:
        String[] {prefix, cmd..... token}