All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.BSNumberTextFields.BSDoubleTextField

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.TextComponent
                   |
                   +----java.awt.TextField
                           |
                           +----COM.BSNumberTextFields.BSDoubleTextField

public class BSDoubleTextField
extends TextField
implements FocusListener, TextListener
A TextField which only allows its input to be the range of floating-point values acceptable for a Java primitive double. That range is approximately - 1.7e308 to 1.7e308.

Should a value be entered into the TextField which is not in range or contains non-digit characters the TextField will attempt to create a representation of the value which is within the range of double, if possible.

Note: The non-digit value '-' (the minus sign) is allowed. Its value is zero (0).

These bean properties can be used to modify the format the TextField will enforce: prefixString and suffixString.

prefixString: The String which will always appear at the beginning of the TextField.

suffixString: The String which will always appear at the end of the TextField.


Variable Index

 o fieldPrefixString
 o fieldSuffixString
 o ivjInputAsDouble
 o javaVendor
 o propertyChange

Constructor Index

 o BSDoubleTextField()
Constructor
 o BSDoubleTextField(int)
BSDoubleTextField constructor comment.
 o BSDoubleTextField(String)
BSDoubleTextField constructor comment.
 o BSDoubleTextField(String, int)
BSDoubleTextField constructor comment.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
The addPropertyChangeListener method was generated to support the propertyChange field.
 o conn0(FocusEvent)
conn0
 o conn1(TextEvent)
conn1
 o firePropertyChange(String, Object, Object)
The firePropertyChange method was generated to support the propertyChange field.
 o focusGained(FocusEvent)
Method to handle events for the FocusListener interface.
 o focusLost(FocusEvent)
Method to handle events for the FocusListener interface.
 o getInputAs_double()
This method will return the Java primitive double value of the text presently in the TextField.
 o getInputAsDouble()
Return the InputAsDouble property value, the Double representation of the text currently in the TextField.
 o getMinimumSize()
Returns the minimum size Dimensions needed for this TextField.
 o getPreferredSize()
Returns the preferred size Dimensions needed for this TextField.
 o getPrefixString()
Gets the prefixStringproperty (java.lang.String) value.
 o getSuffixString()
Gets the suffixStringproperty (java.lang.String) value.
 o getTextAsString()
Returns the String value of what is currently in the TextField.
 o handleException(Throwable)
Called whenever the part throws an exception.
 o initConnections()
Initializes connections
 o initialize()
Initialize the class.
 o removePropertyChangeListener(PropertyChangeListener)
The removePropertyChangeListener method was generated to support the propertyChange field.
 o repaint(String, String)
This method determines if the TextField is currently displaying a valid value.
 o setCaretPosition(int)
Sets the position of the text insertion caret for the TextComponent
 o setInputAsDouble(Double)
Set the InputAsDouble to a new value.
 o setPrefixString(String)
Sets the prefixString property (java.lang.String) value.
 o setSuffixString(String)
Sets the suffixString property (java.lang.String) value.
 o textValueChanged(TextEvent)
Method to handle events for the TextListener interface.
 o typeSensitiveTextValueEnforcer(String)
This method ensures that the value entered by the user into the TextField conforms to the range of a Java primitive double.

Variables

 o fieldPrefixString
 protected String fieldPrefixString
 o fieldSuffixString
 protected String fieldSuffixString
 o ivjInputAsDouble
 private Double ivjInputAsDouble
 o javaVendor
 protected String javaVendor
 o propertyChange
 protected transient PropertyChangeSupport propertyChange

Constructors

 o BSDoubleTextField
 public BSDoubleTextField()
Constructor

 o BSDoubleTextField
 public BSDoubleTextField(int columns)
BSDoubleTextField constructor comment.

Parameters:
columns - int
 o BSDoubleTextField
 public BSDoubleTextField(String text)
BSDoubleTextField constructor comment.

Parameters:
text - java.lang.String
 o BSDoubleTextField
 public BSDoubleTextField(String text,
                          int columns)
BSDoubleTextField constructor comment.

Parameters:
text - java.lang.String
columns - int

Methods

 o addPropertyChangeListener
 public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
The addPropertyChangeListener method was generated to support the propertyChange field.

Parameters:
listener - java.beans.PropertyChangeListener
 o conn0
 private void conn0(FocusEvent arg1)
conn0

Parameters:
arg1 - java.awt.event.FocusEvent
 o conn1
 private void conn1(TextEvent arg1)
conn1

Parameters:
arg1 - java.awt.event.TextEvent
 o firePropertyChange
 public void firePropertyChange(String propertyName,
                                Object oldValue,
                                Object newValue)
The firePropertyChange method was generated to support the propertyChange field.

Parameters:
propertyName - java.lang.String
oldValue - java.lang.Object
newValue - java.lang.Object
 o focusGained
 public void focusGained(FocusEvent e)
Method to handle events for the FocusListener interface.

Parameters:
e - java.awt.event.FocusEvent
 o focusLost
 public void focusLost(FocusEvent e)
Method to handle events for the FocusListener interface.

Parameters:
e - java.awt.event.FocusEvent
 o getInputAs_double
 public final double getInputAs_double()
This method will return the Java primitive double value of the text presently in the TextField.

Returns:
double
 o getInputAsDouble
 public Double getInputAsDouble()
Return the InputAsDouble property value, the Double representation of the text currently in the TextField.

Returns:
java.lang.Double
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size Dimensions needed for this TextField.

Overrides:
getMinimumSize in class TextField
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size Dimensions needed for this TextField.

Overrides:
getPreferredSize in class TextField
 o getPrefixString
 public String getPrefixString()
Gets the prefixStringproperty (java.lang.String) value. The prefixString appears at the begining of the TextField at all times, and is returned with the getTextAsString() method.

Returns:
The prefixString property value.
See Also:
setPrefixString
 o getSuffixString
 public String getSuffixString()
Gets the suffixStringproperty (java.lang.String) value. The suffixString appears at the end of the TextField at all times, and is returned with the getTextAsString() method.

Returns:
The suffixString property value.
See Also:
setSuffixString
 o getTextAsString
 public String getTextAsString()
Returns the String value of what is currently in the TextField. If the TextField only contains its prefixString and suffixString values this method will return an empty String, otherwise it will return the same String as getText().

Returns:
java.lang.String
 o handleException
 private void handleException(Throwable exception)
Called whenever the part throws an exception.

Parameters:
exception - java.lang.Throwable
 o initConnections
 private void initConnections()
Initializes connections

 o initialize
 private void initialize()
Initialize the class.

 o removePropertyChangeListener
 public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
The removePropertyChangeListener method was generated to support the propertyChange field.

Parameters:
listener - java.beans.PropertyChangeListener
 o repaint
 private void repaint(String oldString,
                      String newString)
This method determines if the TextField is currently displaying a valid value. If it is not, the new value is set and the Text Field is repainted -- otherwise no repaint() is performed.

Parameters:
oldString - java.lang.String
newString - java.lang.String
 o setCaretPosition
 public void setCaretPosition(int position)
Sets the position of the text insertion caret for the TextComponent

Parameters:
position - the position
Throws: IllegalArgumentException
If position is less than 0.
Overrides:
setCaretPosition in class TextComponent
 o setInputAsDouble
 private void setInputAsDouble(Double newValue)
Set the InputAsDouble to a new value.

Parameters:
newValue - java.lang.Double
 o setPrefixString
 public void setPrefixString(String prefixString)
Sets the prefixString property (java.lang.String) value. The prefixString appears at the begining of the TextField at all times, and is returned with the getTextAsString() method.

Parameters:
prefixString - The new value for the property.
See Also:
getPrefixString
 o setSuffixString
 public void setSuffixString(String suffixString)
Sets the suffixString property (java.lang.String) value. The suffixString appears at the end of the TextField at all times, and is returned with the getTextAsString() method.

Parameters:
suffixString - The new value for the property.
See Also:
getSuffixString
 o textValueChanged
 public void textValueChanged(TextEvent e)
Method to handle events for the TextListener interface.

Parameters:
e - java.awt.event.TextEvent
 o typeSensitiveTextValueEnforcer
 private void typeSensitiveTextValueEnforcer(String aString)
This method ensures that the value entered by the user into the TextField conforms to the range of a Java primitive double.

Parameters:
aString - java.lang.String

All Packages  Class Hierarchy  This Package  Previous  Next  Index