Package 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 Description protected JmolAbstractButtonclearInButtonprotected JmolAbstractButtonclearOutButtonprotected java.lang.StringdefaultMessageprotected JmolAbstractButtoneditButtonprotected JmolAbstractButtonhistoryButtonprivate java.lang.StringincompleteCmdprotected GenericTextAreainputprotected JmolAbstractButtonlabel1protected static java.util.Map<java.lang.String,java.lang.String>labelsprotected JmolAbstractButtonloadButtonprotected java.util.Map<java.lang.String,java.lang.Object>menuMapintnTabprotected GenericTextAreaoutputprotected JmolAbstractButtonrunButtonprotected JmolAbstractButtonstateButtonViewervwr
-
Constructor Summary
Constructors Constructor Description GenericConsole()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected JmolAbstractButtonaddButton(JmolAbstractButton b, java.lang.String label)protected voidclearContent(java.lang.String text)java.lang.StringcompleteCommand(java.lang.String thisCmd)protected voiddestroyConsole()protected voiddisplayConsole()abstract voiddispose()protected voiddoAction(java.lang.Object source)protected voidexecute(java.lang.String strCommand)static java.lang.StringgetLabel(java.lang.String key)protected JmolAbstractButtongetLabel1()static java.lang.StringgetLabelWithoutMnemonic(java.lang.String label)(package private) static chargetMnemonic(java.lang.String label)abstract JmolScriptEditorInterfacegetScriptEditor()java.lang.StringgetText()protected abstract booleanisMenuItem(java.lang.Object source)protected abstract voidlayoutWindow(java.lang.String enabledButtons)static voidmap(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.StringnextFileName(java.lang.String stub, int nTab)voidnotifyCallback(CBK type, java.lang.Object[] data)booleannotifyEnabled(CBK type)private voidoutputMsg(java.lang.String message)protected intprocessKey(int kcode, int kid, boolean isControlDown)protected voidrecallCommand(boolean up)voidsendConsoleEcho(java.lang.String strEcho)voidsendConsoleMessage(java.lang.String strInfo)static voidsetAbstractButtonLabels(java.util.Map<java.lang.String,java.lang.Object> menuMap, java.util.Map<java.lang.String,java.lang.String> labels)protected abstract JmolAbstractButtonsetButton(java.lang.String text)voidsetCallbackFunction(java.lang.String callbackType, java.lang.String callbackFunction)protected voidsetLabels()protected abstract voidsetTitle()protected voidsetupLabels(java.util.Map<java.lang.String,java.lang.String> labels)protected voidsetupLabels0(java.util.Map<java.lang.String,java.lang.String> labels)protected voidsetViewer(Viewer vwr)abstract voidsetVisible(boolean visible)private static java.lang.String[]splitCommandLine(java.lang.String cmd)separate a command line into three sections: prefix....;cmd ........protected voidupdateLabels()voidzap()-
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
-
-
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:
setVisiblein interfaceJmolAppConsoleInterface
-
getScriptEditor
public abstract JmolScriptEditorInterface getScriptEditor()
- Specified by:
getScriptEditorin interfaceJmolAppConsoleInterface
-
dispose
public abstract void dispose()
- Specified by:
disposein interfaceJmolAppConsoleInterface
-
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:
notifyEnabledin interfaceJmolCallbackListener
-
notifyCallback
public void notifyCallback(CBK type, java.lang.Object[] data)
- Specified by:
notifyCallbackin interfaceJmolCallbackListener
-
getText
public java.lang.String getText()
- Specified by:
getTextin interfaceJmolAppConsoleInterface
-
sendConsoleEcho
public void sendConsoleEcho(java.lang.String strEcho)
- Specified by:
sendConsoleEchoin interfaceJmolAppConsoleInterface
-
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:
sendConsoleMessagein interfaceJmolAppConsoleInterface
-
setCallbackFunction
public void setCallbackFunction(java.lang.String callbackType, java.lang.String callbackFunction)- Specified by:
setCallbackFunctionin interfaceJmolCallbackListener
-
zap
public void zap()
- Specified by:
zapin interfaceJmolAppConsoleInterface
-
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}
-
-