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 Object implements JmolAppConsoleInterface, JmolCallbackListener
-
-
Field Summary
Fields Modifier and Type Field Description protected JmolAbstractButtonclearInButtonprotected JmolAbstractButtonclearOutButtonprotected StringdefaultMessageprotected JmolAbstractButtoneditButtonprotected JmolAbstractButtonhistoryButtonprivate StringincompleteCmdprotected GenericTextAreainputprotected JmolAbstractButtonlabel1protected static Map<String,String>labelsprotected JmolAbstractButtonloadButtonprotected Map<String,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, String label)protected voidclearContent(String text)StringcompleteCommand(String thisCmd)protected voiddestroyConsole()protected voiddisplayConsole()abstract voiddispose()protected voiddoAction(Object source)protected voidexecute(String strCommand)static StringgetLabel(String key)protected JmolAbstractButtongetLabel1()static StringgetLabelWithoutMnemonic(String label)(package private) static chargetMnemonic(String label)abstract JmolScriptEditorInterfacegetScriptEditor()StringgetText()protected abstract booleanisMenuItem(Object source)protected abstract voidlayoutWindow(String enabledButtons)static voidmap(Object button, String key, String label, Map<String,Object> menuMap)protected abstract StringnextFileName(String stub, int nTab)voidnotifyCallback(CBK type, Object[] data)booleannotifyEnabled(CBK type)private voidoutputMsg(String message)protected intprocessKey(int kcode, int kid, boolean isControlDown)protected voidrecallCommand(boolean up)voidsendConsoleEcho(String strEcho)voidsendConsoleMessage(String strInfo)static voidsetAbstractButtonLabels(Map<String,Object> menuMap, Map<String,String> labels)protected abstract JmolAbstractButtonsetButton(String text)voidsetCallbackFunction(String callbackType, String callbackFunction)protected voidsetLabels()protected abstract voidsetTitle()protected voidsetupLabels(Map<String,String> labels)protected voidsetupLabels0(Map<String,String> labels)protected voidsetViewer(Viewer vwr)abstract voidsetVisible(boolean visible)private static String[]splitCommandLine(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
-
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
-
incompleteCmd
private String incompleteCmd
-
-
Method Detail
-
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:
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(String text)
-
addButton
protected JmolAbstractButton addButton(JmolAbstractButton b, String label)
-
getLabel1
protected JmolAbstractButton getLabel1()
-
setLabels
protected void setLabels()
-
displayConsole
protected void displayConsole()
-
updateLabels
protected void updateLabels()
-
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)
-
getMnemonic
static char getMnemonic(String label)
-
notifyEnabled
public boolean notifyEnabled(CBK type)
- Specified by:
notifyEnabledin interfaceJmolCallbackListener
-
notifyCallback
public void notifyCallback(CBK type, Object[] data)
- Specified by:
notifyCallbackin interfaceJmolCallbackListener
-
getText
public String getText()
- Specified by:
getTextin interfaceJmolAppConsoleInterface
-
sendConsoleEcho
public void sendConsoleEcho(String strEcho)
- Specified by:
sendConsoleEchoin interfaceJmolAppConsoleInterface
-
outputMsg
private void outputMsg(String message)
-
clearContent
protected void clearContent(String text)
-
sendConsoleMessage
public void sendConsoleMessage(String strInfo)
- Specified by:
sendConsoleMessagein interfaceJmolAppConsoleInterface
-
setCallbackFunction
public void setCallbackFunction(String callbackType, 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
-
-