# Class GenericConsole

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

All Implemented Interfaces:
  `JmolAppConsoleInterface, JmolCallbackListener`

Direct Known Subclasses:
  `AppletConsole, JmolConsole`

public abstract class GenericConsole extends Object implements JmolAppConsoleInterface, JmolCallbackListener

## Field Summary

Fields
Modifier and Type
Field
Description
`protected JmolAbstractButton`
`clearInButton`
`protected JmolAbstractButton`
`clearOutButton`
`protected String`
`defaultMessage`
`protected JmolAbstractButton`
`editButton`
`protected JmolAbstractButton`
`historyButton`
`protected GenericConsoleTextArea`
`input`
`protected JmolAbstractButton`
`label1`
`protected static Map<String,String>`
`labels`
`protected JmolAbstractButton`
`loadButton`
`protected Map<String,Object>`
`menuMap`
`int`
`nTab`
`protected GenericConsoleTextArea`
`output`
`String`
`pageUpBuffer`
`protected JmolAbstractButton`
`runButton`
`protected JmolAbstractButton`
`stateButton`
`Viewer`
`vwr`

## Constructor Summary

Constructors
Constructor
Description
`GenericConsole()`

## Method Summary

Modifier and Type
Method
Description
`protected JmolAbstractButton`
`addButton(JmolAbstractButton b, String label)`
`protected void`
`clearContent(String text)`
`String`
`completeCommand(String thisCmd)`
`protected void`
`destroyConsole()`
`protected void`
`displayConsole()`
`abstract void`
`dispose()`
`protected void`
`doAction(Object source)`
`protected void`
`execute(String strCommand)`
`protected String`
`getCommandString()`
`static String`
`getLabel(String key)`
`protected JmolAbstractButton`
`getLabel1()`
`static String`
`getLabelWithoutMnemonic(String label)`
`abstract JmolScriptEditorInterface`
`getScriptEditor()`
`String`
`getText()`
`protected abstract boolean`
`isMenuItem(Object source)`
`protected abstract void`
`layoutWindow(String enabledButtons)`
`static void`
`map(Object button, String key, String label, Map<String,Object> menuMap)`
`protected abstract String`
`nextFileName(String stub, int nTab)`
`void`
`notifyCallback(CBK type, Object[] data)`
`boolean`
`notifyEnabled(CBK type)`
////////// JmolCallbackListener interface
`protected int`
`processKey(int kcode, int kid, boolean isControlDown)`
`protected void`
`recallCommand(boolean up, boolean findLastLikeThis)`
`void`
`sendConsoleEcho(String strEcho)`
`void`
`sendConsoleMessage(String strInfo)`
`static void`
`setAbstractButtonLabels(Map<String,Object> menuMap, Map<String,String> labels)`
`protected abstract JmolAbstractButton`
`setButton(String text)`
`void`
`setCallbackFunction(String callbackType, String callbackFunction)`
`protected void`
`setLabels()`
`protected abstract void`
`setTitle()`
`protected void`
`setupLabels(Map<String,String> labels)`
`protected void`
`setupLabels0(Map<String,String> labels)`
`protected void`
`setViewer(Viewer vwr)`
`abstract void`
`setVisible(boolean visible)`
`protected String`
`trimGUI(String cmd)`
`protected void`
`updateLabels()`
`void`
`zap()`

### Methods inherited from class Object

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

### Methods inherited from interface JmolAppConsoleInterface

`newJMenu, newJMenuItem, regainFocus, start`

## Field Details

### input

protected GenericConsoleTextArea input

### output

protected GenericConsoleTextArea output

### vwr

public Viewer vwr

### labels

protected static Map<String,String> labels

### menuMap

protected Map<String,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 String defaultMessage

### label1

protected JmolAbstractButton label1

### nTab

public int nTab

### pageUpBuffer

public String pageUpBuffer

## Constructor Details

### GenericConsole

public GenericConsole()

## Method Details

### setViewer

protected void setViewer(Viewer vwr)

### isMenuItem

protected abstract boolean isMenuItem(Object source)

### layoutWindow

protected abstract void layoutWindow(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(String text)

### addButton

protected JmolAbstractButton addButton(JmolAbstractButton b, String label)

### getLabel1

protected JmolAbstractButton getLabel1()

### setupLabels

protected void setupLabels(Map<String,String> labels)

### setupLabels0

protected void setupLabels0(Map<String,String> labels)

### setLabels

protected void setLabels()

### getLabel

public static String getLabel(String key)

### displayConsole

protected void displayConsole()

### updateLabels

protected void updateLabels()

### nextFileName

protected abstract String nextFileName(String stub, int nTab)

### completeCommand

public String completeCommand(String thisCmd)

### doAction

protected void doAction(Object source)

### execute

protected void execute(String strCommand)

### destroyConsole

protected void destroyConsole()

### setAbstractButtonLabels

public static void setAbstractButtonLabels(Map<String,Object> menuMap, Map<String,String> labels)

### getLabelWithoutMnemonic

public static String getLabelWithoutMnemonic(String label)

### map

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

### notifyEnabled

public boolean notifyEnabled(CBK type)
////////// JmolCallbackListener interface

Specified by:
  `notifyEnabled` in interface `JmolCallbackListener`

### notifyCallback

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

Specified by:
  `notifyCallback` in interface `JmolCallbackListener`

### getText

public String getText()

Specified by:
  `getText` in interface `JmolAppConsoleInterface`

### sendConsoleEcho

public void sendConsoleEcho(String strEcho)

Specified by:
  `sendConsoleEcho` in interface `JmolAppConsoleInterface`

### clearContent

protected void clearContent(String text)

### sendConsoleMessage

public void sendConsoleMessage(String strInfo)

Specified by:
  `sendConsoleMessage` in interface `JmolAppConsoleInterface`

### setCallbackFunction

public void setCallbackFunction(String callbackType, String callbackFunction)

Specified by:
  `setCallbackFunction` in interface `JmolCallbackListener`

### zap

public void zap()

Specified by:
  `zap` in interface `JmolAppConsoleInterface`

### recallCommand

protected void recallCommand(boolean up, boolean findLastLikeThis)

Parameters:
  `up` -
  `findLastLikeThis` -

### getCommandString

protected String getCommandString()

### trimGUI

protected String trimGUI(String cmd)

### processKey

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

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