com.ontimize.gui.field.document
Class IntegerDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
com.ontimize.gui.field.document.IntegerDocument
- All Implemented Interfaces:
- javax.swing.text.Document, java.io.Serializable
- Direct Known Subclasses:
- AdvancedIntegerDocument
- public class IntegerDocument
- extends javax.swing.text.PlainDocument
This document implements the model for managing integers in a JTextField
- Version:
- 1.0 01/04/2001
- See Also:
- Serialized Form
| Nested classes 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 |
| 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 |
| 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, 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 |
INTEGER
public static final int INTEGER
- See Also:
- Constant Field Values
SHORT
public static final int SHORT
- See Also:
- Constant Field Values
LONG
public static final int LONG
- See Also:
- Constant Field Values
BIGINTEGER
public static final int BIGINTEGER
- See Also:
- Constant Field Values
BIGDECIMAL
public static final int BIGDECIMAL
- See Also:
- Constant Field Values
lastNumberTypeUsed
protected int lastNumberTypeUsed
numberFormat
protected java.text.NumberFormat numberFormat
symbols
protected java.text.DecimalFormatSymbols symbols
integerValue
protected java.lang.Number integerValue
IntegerDocument
public IntegerDocument()
isRight
public boolean isRight()
format
public void format()
getIntegerValue
public java.lang.Number getIntegerValue(java.lang.String s)
getNumberTypeUsed
public int getNumberTypeUsed()
setNumberTypeUsed
public void setNumberTypeUsed(int lastNumberTypeUsed)
getNumericValue
protected java.lang.Number getNumericValue(java.lang.String s)
- This method returns a
Number object in function of type
specified in getNumberTypeUsed() (This type is also modifiable in parameter
"numbertype" of IntegerDataField#init(java.util.Hashtable).
Available types are:
- BIGINTEGER
- BIGDECIMAL
- SHORT
- LONG
- INTEGER (default)
- Parameters:
s - the string with value
- Returns:
- the correspondent object
setValue
public void setValue(java.lang.Number value)
getValue
public java.lang.Number getValue()
updateValue
protected void updateValue()
insertString
public void insertString(int offset,
java.lang.String stringValue,
javax.swing.text.AttributeSet attributes)
throws javax.swing.text.BadLocationException
- Throws:
javax.swing.text.BadLocationException
insertStringWithoutCheck
protected void insertStringWithoutCheck(int offset,
java.lang.String stringValue,
javax.swing.text.AttributeSet attributes)
throws javax.swing.text.BadLocationException
- Throws:
javax.swing.text.BadLocationException
removeWithoutCheck
protected void removeWithoutCheck(int offset,
int len)
throws javax.swing.text.BadLocationException
- Throws:
javax.swing.text.BadLocationException
remove
public void remove(int offset,
int len)
throws javax.swing.text.BadLocationException
- Throws:
javax.swing.text.BadLocationException
setMinimumIntegerDigits
public void setMinimumIntegerDigits(int number)
setMaximumIntegerDigits
public void setMaximumIntegerDigits(int number)
setGroupingUsed
public void setGroupingUsed(boolean m)