edu.princeton.swing.text
Class DefaultHighlightedDocument

java.lang.Object
  extended by edu.princeton.swing.text.HighlightedDocument
      extended by edu.princeton.swing.text.DefaultHighlightedDocument

public class DefaultHighlightedDocument
extends HighlightedDocument

DefaultHighlightedDocument is a simple subclass of HighlightedDocument.


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.princeton.swing.text.HighlightedDocument
HighlightedDocument.Position, HighlightedDocument.PositionTriplet, HighlightedDocument.UndoableEdit
 
Field Summary
static byte STYLE_PLAIN
          The only style in a DefaultHighlightedDocument.
 
Fields inherited from class edu.princeton.swing.text.HighlightedDocument
CHARACTER_ALLOWED, charCount, chars, charStyles, lineCount, lineOffsets, MAX_ALLOWED_CHARACTER, maxLineLength
 
Constructor Summary
DefaultHighlightedDocument()
          Constructs a DefaultHighlightedDocument.
DefaultHighlightedDocument(String text)
          Constructs a DefaultHighlightedDocument.
 
Method Summary
protected  void assignStyles()
          Updates the charStyles array based on chars, charCount, lineOffsets, and lineCount.
 int getStyleCount()
          Returns the number of distinct styles used by this type of document.
 int getTabSize()
          Returns the number of spaces to replace all tabs with.
 
Methods inherited from class edu.princeton.swing.text.HighlightedDocument
addTextListener, addUndoableEditListener, allowRender, coordinateToOffset, coordinateToOffset, createPosition, createPositionTriplet, filterString, freePosition, freePositionTriplet, getLength, getLineCount, getMaxLineLength, getPositionOffsets, getText, getText, getWordBounds, insertString, offsetToCoordinate, readLock, readUnlock, remove, removeTextListener, removeUndoableEditListener, replace, replace, setText, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_PLAIN

public static final byte STYLE_PLAIN
The only style in a DefaultHighlightedDocument.

See Also:
Constant Field Values
Constructor Detail

DefaultHighlightedDocument

public DefaultHighlightedDocument()
Constructs a DefaultHighlightedDocument.


DefaultHighlightedDocument

public DefaultHighlightedDocument(String text)
Constructs a DefaultHighlightedDocument.

Method Detail

getStyleCount

public int getStyleCount()
Returns the number of distinct styles used by this type of document. This must always return the same number.

Specified by:
getStyleCount in class HighlightedDocument
Returns:
The number of distinct styles used by this type of document.

getTabSize

public int getTabSize()
Returns the number of spaces to replace all tabs with.

Specified by:
getTabSize in class HighlightedDocument
Returns:
The number of spaces to replace all tabs with.

assignStyles

protected void assignStyles()
Updates the charStyles array based on chars, charCount, lineOffsets, and lineCount. The implementation should assume that a write lock will have been obtained by the caller of this function.

Specified by:
assignStyles in class HighlightedDocument