org.openscience.jmol.app.jmolpanel
Class AppConsole

java.lang.Object
  extended by org.jmol.console.JmolConsole
      extended by org.openscience.jmol.app.jmolpanel.AppConsole
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.WindowListener, java.util.EventListener, JmolAppConsoleInterface, JmolCallbackListener, EnterListener

public class AppConsole
extends JmolConsole
implements JmolAppConsoleInterface, EnterListener


Nested Class Summary
(package private)  class AppConsole.ConsoleDocument
           
(package private)  class AppConsole.ConsoleTextPane
           
(package private)  class AppConsole.ExecuteCommandThread
           
 
Nested classes/interfaces inherited from class org.jmol.console.JmolConsole
JmolConsole.FileChecker
 
Field Summary
static java.lang.String ALL_BUTTONS
           
private  javax.swing.JPanel buttonPanel
           
protected  java.util.Map<java.lang.String,javax.swing.AbstractButton> buttons
           
private  javax.swing.JButton checkButton
           
private  javax.swing.JButton clearButton
           
private  javax.swing.JButton closeButton
           
protected  AppConsole.ConsoleTextPane console
           
private  boolean dontsave
           
(package private)  AppConsole.ExecuteCommandThread execThread
           
private  javax.swing.JButton haltButton
           
private  javax.swing.JButton helpButton
           
(package private)  boolean isError
           
(package private)  javax.swing.JDialog jcd
           
private static int MAXUNDO
           
private  javax.swing.JButton redoButton
           
protected  javax.swing.JButton stepButton
           
private  javax.swing.JButton topButton
           
private  javax.swing.JButton undoButton
           
private  int undoPointer
           
private  boolean undoSaved
           
private  java.lang.String[] undoStack
           
private  javax.swing.JButton varButton
           
 
Fields inherited from class org.jmol.console.JmolConsole
defaultMessage, editButton, externalContainer, historyButton, label1, labels, menuMap, nTab, runButton, scriptEditor, stateButton, viewer, viewerFrame
 
Constructor Summary
AppConsole()
           
AppConsole(JmolViewer viewer, java.awt.Container externalContainer, java.lang.String enabledButtons)
          general entry point
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected  void clearContent(java.lang.String text)
           
protected  java.lang.String completeCommand(java.lang.String thisCmd)
           
private  void enableButton(java.lang.String name)
           
 void enterPressed()
           
protected  void execute(java.lang.String strCommand)
           
(package private)  void executeCommand(java.lang.String strCommand)
           
(package private)  void executeCommandAsThread(java.lang.String strCommand)
           
 JmolAppConsoleInterface getAppConsole(JmolViewer viewer)
          don't delete! used by Viewer after it gets the class by name
 java.lang.String getText()
           
private  void layoutWindow(java.lang.String enabledButtons)
           
 void sendConsoleEcho(java.lang.String strEcho)
           
 void sendConsoleMessage(java.lang.String strStatus)
           
protected  javax.swing.JButton setButton(java.lang.String label)
           
private  void setError(boolean TF)
           
protected  void setupLabels()
           
private  void undoClear()
           
private  void undoRedo(boolean isRedo)
           
private  void undoSave(boolean incrementPtr)
           
private  boolean undoSetEnabled()
           
 void zap()
           
 
Methods inherited from class org.jmol.console.JmolConsole
addWindowListener, dispose, getLabel, getPane, getScriptEditor, getWindow, notifyCallback, notifyEnabled, setCallbackFunction, setEnabled, setTitle, setVisible, updateLabels, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
 
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
dispose, getScriptEditor, setVisible
 

Field Detail

ALL_BUTTONS

public static final java.lang.String ALL_BUTTONS
See Also:
Constant Field Values

jcd

javax.swing.JDialog jcd

console

protected AppConsole.ConsoleTextPane console

stepButton

protected javax.swing.JButton stepButton

buttons

protected java.util.Map<java.lang.String,javax.swing.AbstractButton> buttons

varButton

private javax.swing.JButton varButton

haltButton

private javax.swing.JButton haltButton

closeButton

private javax.swing.JButton closeButton

clearButton

private javax.swing.JButton clearButton

helpButton

private javax.swing.JButton helpButton

undoButton

private javax.swing.JButton undoButton

redoButton

private javax.swing.JButton redoButton

checkButton

private javax.swing.JButton checkButton

topButton

private javax.swing.JButton topButton

buttonPanel

private javax.swing.JPanel buttonPanel

isError

boolean isError

execThread

AppConsole.ExecuteCommandThread execThread

MAXUNDO

private static int MAXUNDO

undoStack

private java.lang.String[] undoStack

undoPointer

private int undoPointer

undoSaved

private boolean undoSaved

dontsave

private boolean dontsave
Constructor Detail

AppConsole

public AppConsole(JmolViewer viewer,
                  java.awt.Container externalContainer,
                  java.lang.String enabledButtons)
general entry point

Parameters:
viewer -
externalContainer - a JFrame or JPanel or JDialog
enabledButtons -

AppConsole

public AppConsole()
Method Detail

getAppConsole

public JmolAppConsoleInterface getAppConsole(JmolViewer viewer)
don't delete! used by Viewer after it gets the class by name

Specified by:
getAppConsole in interface JmolAppConsoleInterface
Parameters:
viewer -
Returns:
AppConsole or AppletConsole

sendConsoleEcho

public void sendConsoleEcho(java.lang.String strEcho)
Specified by:
sendConsoleEcho in interface JmolAppConsoleInterface
Specified by:
sendConsoleEcho in class JmolConsole

sendConsoleMessage

public void sendConsoleMessage(java.lang.String strStatus)
Specified by:
sendConsoleMessage in interface JmolAppConsoleInterface
Specified by:
sendConsoleMessage in class JmolConsole

setButton

protected javax.swing.JButton setButton(java.lang.String label)
Overrides:
setButton in class JmolConsole

setupLabels

protected void setupLabels()
Specified by:
setupLabels in class JmolConsole

layoutWindow

private void layoutWindow(java.lang.String enabledButtons)

enableButton

private void enableButton(java.lang.String name)

setError

private void setError(boolean TF)

enterPressed

public void enterPressed()
Specified by:
enterPressed in interface EnterListener

execute

protected void execute(java.lang.String strCommand)
Specified by:
execute in class JmolConsole

executeCommandAsThread

void executeCommandAsThread(java.lang.String strCommand)

zap

public void zap()
Specified by:
zap in interface JmolAppConsoleInterface

undoClear

private void undoClear()

undoSetEnabled

private boolean undoSetEnabled()

undoRedo

private void undoRedo(boolean isRedo)

undoSave

private void undoSave(boolean incrementPtr)

executeCommand

void executeCommand(java.lang.String strCommand)

clearContent

protected void clearContent(java.lang.String text)
Specified by:
clearContent in class JmolConsole

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class JmolConsole

completeCommand

protected java.lang.String completeCommand(java.lang.String thisCmd)
Overrides:
completeCommand in class JmolConsole

getText

public java.lang.String getText()
Specified by:
getText in interface JmolAppConsoleInterface
Specified by:
getText in class JmolConsole