Ontimize 5.2072EN

com.ontimize.gui.field.document
Class IntegerDocument

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.PlainDocument
          extended bycom.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 Class Summary
 
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
 
Field Summary
static int BIGDECIMAL
           
static int BIGINTEGER
           
static int INTEGER
           
protected  java.lang.Number integerValue
           
protected  int lastNumberTypeUsed
           
static int LONG
           
protected  java.text.NumberFormat numberFormat
           
static int SHORT
           
protected  java.text.DecimalFormatSymbols symbols
           
 
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
IntegerDocument()
           
 
Method Summary
 void format()
           
 java.lang.Number getIntegerValue(java.lang.String s)
           
 int getNumberTypeUsed()
           
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).
 java.lang.Number getValue()
           
 void insertString(int offset, java.lang.String stringValue, javax.swing.text.AttributeSet attributes)
           
protected  void insertStringWithoutCheck(int offset, java.lang.String stringValue, javax.swing.text.AttributeSet attributes)
           
 boolean isRight()
           
 void remove(int offset, int len)
           
protected  void removeWithoutCheck(int offset, int len)
           
 void setGroupingUsed(boolean m)
           
 void setMaximumIntegerDigits(int number)
           
 void setMinimumIntegerDigits(int number)
           
 void setNumberTypeUsed(int lastNumberTypeUsed)
           
 void setValue(java.lang.Number value)
           
protected  void updateValue()
           
 
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
 

Field Detail

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
Constructor Detail

IntegerDocument

public IntegerDocument()
Method Detail

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:

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)

Ontimize