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:
ActionListener, WindowListener, 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 String ALL_BUTTONS
           
private  JPanel buttonPanel
           
protected  Map<String,AbstractButton> buttons
           
private  JButton checkButton
           
private  JButton clearButton
           
private  JButton closeButton
           
protected  AppConsole.ConsoleTextPane console
           
private  boolean dontsave
           
(package private)  AppConsole.ExecuteCommandThread execThread
           
private  JButton haltButton
           
private  JButton helpButton
           
(package private)  boolean isError
           
(package private)  JDialog jcd
           
private static int MAXUNDO
           
private  JButton redoButton
           
protected  JButton stepButton
           
private  JButton topButton
           
private  JButton undoButton
           
private  int undoPointer
           
private  boolean undoSaved
           
private  String[] undoStack
           
private  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, Container externalContainer, String enabledButtons)
          general entry point
 
Method Summary
 void actionPerformed(ActionEvent e)
           
protected  void clearContent(String text)
           
protected  String completeCommand(String thisCmd)
           
private  void enableButton(String name)
           
 void enterPressed()
           
protected  void execute(String strCommand)
           
(package private)  void executeCommand(String strCommand)
           
(package private)  void executeCommandAsThread(String strCommand)
           
 JmolAppConsoleInterface getAppConsole(JmolViewer viewer)
          don't delete! used by Viewer after it gets the class by name
 String getText()
           
private  void layoutWindow(String enabledButtons)
           
 void sendConsoleEcho(String strEcho)
           
 void sendConsoleMessage(String strStatus)
           
protected  JButton setButton(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 String ALL_BUTTONS
See Also:
Constant Field Values

jcd

JDialog jcd

console

protected AppConsole.ConsoleTextPane console

stepButton

protected JButton stepButton

buttons

protected Map<String,AbstractButton> buttons

varButton

private JButton varButton

haltButton

private JButton haltButton

closeButton

private JButton closeButton

clearButton

private JButton clearButton

helpButton

private JButton helpButton

undoButton

private JButton undoButton

redoButton

private JButton redoButton

checkButton

private JButton checkButton

topButton

private JButton topButton

buttonPanel

private JPanel buttonPanel

isError

boolean isError

execThread

AppConsole.ExecuteCommandThread execThread

MAXUNDO

private static int MAXUNDO

undoStack

private String[] undoStack

undoPointer

private int undoPointer

undoSaved

private boolean undoSaved

dontsave

private boolean dontsave
Constructor Detail

AppConsole

public AppConsole(JmolViewer viewer,
                  Container externalContainer,
                  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(String strEcho)
Specified by:
sendConsoleEcho in interface JmolAppConsoleInterface
Specified by:
sendConsoleEcho in class JmolConsole

sendConsoleMessage

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

setButton

protected JButton setButton(String label)
Overrides:
setButton in class JmolConsole

setupLabels

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

layoutWindow

private void layoutWindow(String enabledButtons)

enableButton

private void enableButton(String name)

setError

private void setError(boolean TF)

enterPressed

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

execute

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

executeCommandAsThread

void executeCommandAsThread(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(String strCommand)

clearContent

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

actionPerformed

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

completeCommand

protected String completeCommand(String thisCmd)
Overrides:
completeCommand in class JmolConsole

getText

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