trassare.com

com.trassare.calculator.ui
Class LimitInput

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by com.trassare.calculator.ui.LimitInput
All Implemented Interfaces:
Serializable, Document

public class LimitInput
extends PlainDocument

To further control keyboard input, this class is used to hi-jack certain key commands and replace them with their associated data.

Version:
27 October 2005
Author:
Samuel Trassare
See Also:
Serialized Form

Nested Class Summary
 
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
 
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
 
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
LimitInput(int inMaxLength)
          Explicit constructor for objects of LimitInput.
 
Method Summary
 void insertString(int offset, String str, AttributeSet a)
          Overridden from PlainDocument.
 
Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
 
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, 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, remove, removeDocumentListener, 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
 

Constructor Detail

LimitInput

public LimitInput(int inMaxLength)
Explicit constructor for objects of LimitInput.

Parameters:
inMaxLength - the maximum allowable characters in this field.
Method Detail

insertString

public final void insertString(int offset,
                               String str,
                               AttributeSet a)
                        throws BadLocationException
Overridden from PlainDocument. This is were character input gets replaced with data.

Specified by:
insertString in interface Document
Overrides:
insertString in class PlainDocument
Parameters:
offset - the zero-based index of where to insert new text
str - the text to be inserted
a - the attributes for the inserted content
Throws:
BadLocationException - I don't know what this is.

trassare.com