LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.text
Class LyJNumberDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by leon.view.win.swing.text.LyJTextAreaDocument
              extended by leon.view.win.swing.text.LyJTextFieldDocument
                  extended by leon.view.win.swing.text.LyJNumberDocument
All Implemented Interfaces:
java.io.Serializable, javax.swing.text.Document

public class LyJNumberDocument
extends LyJTextFieldDocument

This class manages the content of a number field.

See Also:
Serialized Form

Nested Class Summary
 
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
static java.lang.String __VERSION
           
 
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
 
Fields inherited from class javax.swing.text.AbstractDocument
BidiElementName, ContentElementName, ElementNameAttribute, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
LyJNumberDocument(int maxChars, double min, double max, char decimalSeparator, int decimals)
          Constructor.
 
Method Summary
 void insertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
          Inserts a string in the number field.
 void setDecimals(int decimals)
          Set the number of decimals.
 void setDecimalSeparator(char decimalSeparator)
          Set the character used for decimal separation.
 void setMax(double max)
          Set the maximum value.
 void setMin(double min)
          Sets the minimum value.
 
Methods inherited from class leon.view.win.swing.text.LyJTextAreaDocument
beep, setEnvironment, setMaxChars, setPatterns, setString
 
Methods inherited from class javax.swing.text.PlainDocument
getDefaultRootElement, getParagraphElement
 
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createPosition, dump, getAsynchronousLoadPriority, getBidiRootElement, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyJNumberDocument

public LyJNumberDocument(int maxChars,
                         double min,
                         double max,
                         char decimalSeparator,
                         int decimals)
Constructor. Calls the super implementation and initializes class attributes with the given values.

Parameters:
maxChars - the maximum number of chars
min - the minimum value
max - the maximum value
decimalSeparator - the character used for decimal separation
decimals - the number of allowed decimals
Method Detail

insertString

public void insertString(int offset,
                         java.lang.String str,
                         javax.swing.text.AttributeSet a)
                  throws javax.swing.text.BadLocationException
Inserts a string in the number field.
Overriden to filter input.

Specified by:
insertString in interface javax.swing.text.Document
Overrides:
insertString in class LyJTextFieldDocument
Parameters:
offset - the position of this insert
str - the string to insert
a - the attributes to associate with the inserted content. This may be null if there are no attributes
Throws:
javax.swing.text.BadLocationException - if the value of this field cannot be retrieved
See Also:
Document.insertString(int, java.lang.String, javax.swing.text.AttributeSet)

setMin

public void setMin(double min)
Sets the minimum value.

Parameters:
min - the new minimum value

setMax

public void setMax(double max)
Set the maximum value.

Parameters:
max - the new maximum value

setDecimals

public void setDecimals(int decimals)
Set the number of decimals.

Parameters:
decimals - the new number of decmals

setDecimalSeparator

public void setDecimalSeparator(char decimalSeparator)
Set the character used for decimal separation.

Parameters:
decimalSeparator - the new decimal separator

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com