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 JmolAbstractButton
clearInButton
protected JmolAbstractButton
clearOutButton
protected String
defaultMessage
protected JmolAbstractButton
editButton
protected JmolAbstractButton
historyButton
private String
incompleteCmd
protected GenericTextArea
input
protected JmolAbstractButton
label1
protected static Map<String,String>
labels
protected JmolAbstractButton
loadButton
protected Map<String,Object>
menuMap
int
nTab
protected GenericTextArea
output
protected JmolAbstractButton
runButton
protected JmolAbstractButton
stateButton
Viewer
vwr
-
Constructor Summary
Constructors Constructor Description GenericConsole()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 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)
static String
getLabel(String key)
protected JmolAbstractButton
getLabel1()
static String
getLabelWithoutMnemonic(String label)
(package private) static char
getMnemonic(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)
private void
outputMsg(String message)
protected int
processKey(int kcode, int kid, boolean isControlDown)
protected void
recallCommand(boolean up)
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)
private static String[]
splitCommandLine(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
-
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:
setVisible
in interfaceJmolAppConsoleInterface
-
getScriptEditor
public abstract JmolScriptEditorInterface getScriptEditor()
- Specified by:
getScriptEditor
in interfaceJmolAppConsoleInterface
-
dispose
public abstract void dispose()
- Specified by:
dispose
in 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:
notifyEnabled
in interfaceJmolCallbackListener
-
notifyCallback
public void notifyCallback(CBK type, Object[] data)
- Specified by:
notifyCallback
in interfaceJmolCallbackListener
-
getText
public String getText()
- Specified by:
getText
in interfaceJmolAppConsoleInterface
-
sendConsoleEcho
public void sendConsoleEcho(String strEcho)
- Specified by:
sendConsoleEcho
in interfaceJmolAppConsoleInterface
-
outputMsg
private void outputMsg(String message)
-
clearContent
protected void clearContent(String text)
-
sendConsoleMessage
public void sendConsoleMessage(String strInfo)
- Specified by:
sendConsoleMessage
in interfaceJmolAppConsoleInterface
-
setCallbackFunction
public void setCallbackFunction(String callbackType, String callbackFunction)
- Specified by:
setCallbackFunction
in interfaceJmolCallbackListener
-
zap
public void zap()
- Specified by:
zap
in 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
-
-