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.
-
fieldPrefixString
-
-
fieldSuffixString
-
-
ivjInputAsDouble
-
-
javaVendor
-
-
propertyChange
-
-
BSDoubleTextField()
- Constructor
-
BSDoubleTextField(int)
- BSDoubleTextField constructor comment.
-
BSDoubleTextField(String)
- BSDoubleTextField constructor comment.
-
BSDoubleTextField(String, int)
- BSDoubleTextField constructor comment.
-
addPropertyChangeListener(PropertyChangeListener)
- The addPropertyChangeListener method was generated to support the propertyChange field.
-
conn0(FocusEvent)
- conn0
-
conn1(TextEvent)
- conn1
-
firePropertyChange(String, Object, Object)
- The firePropertyChange method was generated to support the propertyChange field.
-
focusGained(FocusEvent)
- Method to handle events for the FocusListener interface.
-
focusLost(FocusEvent)
- Method to handle events for the FocusListener interface.
-
getInputAs_double()
- This method will return the Java primitive double value of the
text presently in the TextField.
-
getInputAsDouble()
- Return the InputAsDouble property value, the Double representation
of the text currently in the TextField.
-
getMinimumSize()
- Returns the minimum size Dimensions needed for this TextField.
-
getPreferredSize()
- Returns the preferred size Dimensions needed for this TextField.
-
getPrefixString()
- Gets the prefixStringproperty (java.lang.String) value.
-
getSuffixString()
- Gets the suffixStringproperty (java.lang.String) value.
-
getTextAsString()
- Returns the String value of what is currently in the TextField.
-
handleException(Throwable)
- Called whenever the part throws an exception.
-
initConnections()
- Initializes connections
-
initialize()
- Initialize the class.
-
removePropertyChangeListener(PropertyChangeListener)
- The removePropertyChangeListener method was generated to support the propertyChange field.
-
repaint(String, String)
- This method determines if the TextField is currently displaying
a valid value.
-
setCaretPosition(int)
- Sets the position of the text insertion caret for the TextComponent
-
setInputAsDouble(Double)
- Set the InputAsDouble to a new value.
-
setPrefixString(String)
- Sets the prefixString property (java.lang.String) value.
-
setSuffixString(String)
- Sets the suffixString property (java.lang.String) value.
-
textValueChanged(TextEvent)
- Method to handle events for the TextListener interface.
-
typeSensitiveTextValueEnforcer(String)
- This method ensures that the value entered by the user into the
TextField conforms to the range of a Java primitive double.
fieldPrefixString
protected String fieldPrefixString
fieldSuffixString
protected String fieldSuffixString
ivjInputAsDouble
private Double ivjInputAsDouble
javaVendor
protected String javaVendor
propertyChange
protected transient PropertyChangeSupport propertyChange
BSDoubleTextField
public BSDoubleTextField()
- Constructor
BSDoubleTextField
public BSDoubleTextField(int columns)
- BSDoubleTextField constructor comment.
- Parameters:
- columns - int
BSDoubleTextField
public BSDoubleTextField(String text)
- BSDoubleTextField constructor comment.
- Parameters:
- text - java.lang.String
BSDoubleTextField
public BSDoubleTextField(String text,
int columns)
- BSDoubleTextField constructor comment.
- Parameters:
- text - java.lang.String
- columns - int
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- The addPropertyChangeListener method was generated to support the propertyChange field.
- Parameters:
- listener - java.beans.PropertyChangeListener
conn0
private void conn0(FocusEvent arg1)
- conn0
- Parameters:
- arg1 - java.awt.event.FocusEvent
conn1
private void conn1(TextEvent arg1)
- conn1
- Parameters:
- arg1 - java.awt.event.TextEvent
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
focusGained
public void focusGained(FocusEvent e)
- Method to handle events for the FocusListener interface.
- Parameters:
- e - java.awt.event.FocusEvent
focusLost
public void focusLost(FocusEvent e)
- Method to handle events for the FocusListener interface.
- Parameters:
- e - java.awt.event.FocusEvent
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
getInputAsDouble
public Double getInputAsDouble()
- Return the InputAsDouble property value, the Double representation
of the text currently in the TextField.
- Returns:
- java.lang.Double
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum size Dimensions needed for this TextField.
- Overrides:
- getMinimumSize in class TextField
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred size Dimensions needed for this TextField.
- Overrides:
- getPreferredSize in class TextField
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
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
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
handleException
private void handleException(Throwable exception)
- Called whenever the part throws an exception.
- Parameters:
- exception - java.lang.Throwable
initConnections
private void initConnections()
- Initializes connections
initialize
private void initialize()
- Initialize the class.
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- The removePropertyChangeListener method was generated to support the propertyChange field.
- Parameters:
- listener - java.beans.PropertyChangeListener
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
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
setInputAsDouble
private void setInputAsDouble(Double newValue)
- Set the InputAsDouble to a new value.
- Parameters:
- newValue - java.lang.Double
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
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
textValueChanged
public void textValueChanged(TextEvent e)
- Method to handle events for the TextListener interface.
- Parameters:
- e - java.awt.event.TextEvent
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