org.openscience.jmol.app.jmolpanel
Class AppConsole.ConsoleDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.DefaultStyledDocument
          extended by org.openscience.jmol.app.jmolpanel.AppConsole.ConsoleDocument
All Implemented Interfaces:
Serializable, Document, StyledDocument
Enclosing class:
AppConsole

 class AppConsole.ConsoleDocument
extends DefaultStyledDocument


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement
 
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
 
Field Summary
(package private)  SimpleAttributeSet attEcho
           
(package private)  SimpleAttributeSet attError
           
(package private)  SimpleAttributeSet attPrompt
           
(package private)  SimpleAttributeSet attStatus
           
(package private)  SimpleAttributeSet attUserInput
           
private  AppConsole.ConsoleTextPane consoleTextPane
           
private  int offsetAfterPrompt
           
private  Position positionAfterPrompt
           
private  Position positionBeforePrompt
           
 
Fields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULT
 
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
AppConsole.ConsoleDocument()
           
 
Method Summary
(package private)  void appendNewline()
           
(package private)  void clearContent()
          Removes all content of the script window, and add a new prompt.
(package private)  void colorCommand(SimpleAttributeSet att)
           
(package private)  String getCommandString()
           
 void insertString(int offs, String str, AttributeSet a)
           
(package private)  boolean isAtEnd()
           
(package private)  void outputBeforePrompt(String str, SimpleAttributeSet attribute)
           
(package private)  void outputEcho(String strEcho)
           
(package private)  void outputError(String strError)
           
(package private)  void outputErrorForeground(String strError)
           
(package private)  void outputStatus(String strStatus)
           
 void remove(int offs, int len)
           
 void replace(int offs, int length, String str, AttributeSet attrs)
           
(package private)  void replaceCommand(String newCommand, boolean isError)
          Replaces current command on script.
(package private)  void setConsoleTextPane(AppConsole.ConsoleTextPane consoleTextPane)
           
(package private)  void setNoPrompt()
           
(package private)  void setOffsetPositions()
           
(package private)  void setPrompt()
           
 
Methods inherited from class javax.swing.text.DefaultStyledDocument
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged
 
Methods inherited from class javax.swing.text.AbstractDocument
addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeUndoableEditListener, render, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.text.Document
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeUndoableEditListener, render
 

Field Detail

consoleTextPane

private AppConsole.ConsoleTextPane consoleTextPane

attError

SimpleAttributeSet attError

attEcho

SimpleAttributeSet attEcho

attPrompt

SimpleAttributeSet attPrompt

attUserInput

SimpleAttributeSet attUserInput

attStatus

SimpleAttributeSet attStatus

positionBeforePrompt

private Position positionBeforePrompt

positionAfterPrompt

private Position positionAfterPrompt

offsetAfterPrompt

private int offsetAfterPrompt
Constructor Detail

AppConsole.ConsoleDocument

AppConsole.ConsoleDocument()
Method Detail

setConsoleTextPane

void setConsoleTextPane(AppConsole.ConsoleTextPane consoleTextPane)

isAtEnd

boolean isAtEnd()

clearContent

void clearContent()
Removes all content of the script window, and add a new prompt.


setPrompt

void setPrompt()

setOffsetPositions

void setOffsetPositions()

setNoPrompt

void setNoPrompt()

outputBeforePrompt

void outputBeforePrompt(String str,
                        SimpleAttributeSet attribute)

outputError

void outputError(String strError)

outputErrorForeground

void outputErrorForeground(String strError)

outputEcho

void outputEcho(String strEcho)

outputStatus

void outputStatus(String strStatus)

appendNewline

void appendNewline()

insertString

public void insertString(int offs,
                         String str,
                         AttributeSet a)
                  throws BadLocationException
Specified by:
insertString in interface Document
Overrides:
insertString in class AbstractDocument
Throws:
BadLocationException

getCommandString

String getCommandString()

remove

public void remove(int offs,
                   int len)
            throws BadLocationException
Specified by:
remove in interface Document
Overrides:
remove in class AbstractDocument
Throws:
BadLocationException

replace

public void replace(int offs,
                    int length,
                    String str,
                    AttributeSet attrs)
             throws BadLocationException
Overrides:
replace in class AbstractDocument
Throws:
BadLocationException

replaceCommand

void replaceCommand(String newCommand,
                    boolean isError)
              throws BadLocationException
Replaces current command on script.

Parameters:
newCommand - new command value
isError - true to set error color ends with #??
Throws:
BadLocationException

colorCommand

void colorCommand(SimpleAttributeSet att)