cdx.scorebot.util.swing
Class LogSyntaxDocumentFIFO

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.DefaultStyledDocument
          extended by cdx.scorebot.util.swing.MultiSyntaxDocument
              extended by cdx.scorebot.util.swing.LogSyntaxDocument
                  extended by cdx.scorebot.util.swing.LogSyntaxDocumentFIFO
All Implemented Interfaces:
TextFieldFIFO, java.io.Serializable, javax.swing.text.Document, javax.swing.text.StyledDocument

public class LogSyntaxDocumentFIFO
extends LogSyntaxDocument
implements TextFieldFIFO

A special DefaultStyledDocument which limits the number of lines which it displays. Only the addText(), clearText(), and setText() methods may be used to alter the text in this text area or line limiting may not function properly.

Author:
David Underhill
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class cdx.scorebot.util.swing.MultiSyntaxDocument
MultiSyntaxDocument.ATTR_TYPE
 
Nested classes/interfaces inherited from class javax.swing.text.DefaultStyledDocument
javax.swing.text.DefaultStyledDocument.AttributeUndoableEdit, javax.swing.text.DefaultStyledDocument.ElementBuffer, javax.swing.text.DefaultStyledDocument.ElementSpec, javax.swing.text.DefaultStyledDocument.SectionElement
 
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
 
Field Summary
 
Fields inherited from class cdx.scorebot.util.swing.LogSyntaxDocument
DEFAULT_BOLD, DEFAULT_ERROR, DEFAULT_EVENT, DEFAULT_TITLE
 
Fields inherited from class cdx.scorebot.util.swing.MultiSyntaxDocument
DEFAULT_COMMENT, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_KEYWORD, DEFAULT_NORMAL, DEFAULT_STRING
 
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
LogSyntaxDocumentFIFO()
          create a LogSyntaxDocumentFIFO which is limited to 10 lines
LogSyntaxDocumentFIFO(int numLines)
          create a LogSyntaxDocumentFIFO which is limited to the specified number of lines (no column length limit)
LogSyntaxDocumentFIFO(int numLines, int numColumns)
          create a LogSyntaxDocumentFIFO which is limited to the specified number of lines
 
Method Summary
 void addText(java.lang.String t)
          sets the text in this text area to the current text plus t (minus any truncated lines)
 void clearText()
          clears all text from this text area
 java.lang.String getText()
          gets the text in this text area
 void setText(java.lang.String t)
          sets the text in this text area to t (minus any truncated lines)
 
Methods inherited from class cdx.scorebot.util.swing.LogSyntaxDocument
getEndDelimiter, getStartDelimiter
 
Methods inherited from class cdx.scorebot.util.swing.MultiSyntaxDocument
addKeyword, addMatchingBrace, clearKeywords, getEscapeString, getFontName, getFontSize, getKeywordFormatting, getSingleLineDelimiter, insertString, isDelimiter, isQuoteDelimiter, processChangedLines, remove, removeKeyword, setAttributeColor, setAttributeColor, setAttributeFont, setAttributeFont, setAttributeStyle, setFontName, setFontSize, setTabs
 
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, replace, 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
 

Constructor Detail

LogSyntaxDocumentFIFO

public LogSyntaxDocumentFIFO()
create a LogSyntaxDocumentFIFO which is limited to 10 lines


LogSyntaxDocumentFIFO

public LogSyntaxDocumentFIFO(int numLines)
create a LogSyntaxDocumentFIFO which is limited to the specified number of lines (no column length limit)

Parameters:
numLines - maximum number of lines the document may contain (older lines are discarded)

LogSyntaxDocumentFIFO

public LogSyntaxDocumentFIFO(int numLines,
                             int numColumns)
create a LogSyntaxDocumentFIFO which is limited to the specified number of lines

Parameters:
numLines - maximum number of lines the document may contain (older lines are discarded)
numColumns - maximum number of columns any line may contain (longer lines are split up)
Method Detail

addText

public void addText(java.lang.String t)
sets the text in this text area to the current text plus t (minus any truncated lines)

Specified by:
addText in interface TextFieldFIFO
Parameters:
t - the text add to the text area

clearText

public void clearText()
clears all text from this text area

Specified by:
clearText in interface TextFieldFIFO

getText

public java.lang.String getText()
gets the text in this text area

Specified by:
getText in interface TextFieldFIFO
Returns:
the text in this text area

setText

public void setText(java.lang.String t)
sets the text in this text area to t (minus any truncated lines)

Specified by:
setText in interface TextFieldFIFO
Parameters:
t - the text to put in the text area