Package adams.gui.goe
Class DoubleEditor
-
- All Implemented Interfaces:
HelpProvider,PropertyEditorWithConstraint<NumericBounds>,PropertyEditorWithDefaultValue,PropertyEditor
public class DoubleEditor extends AbstractFloatingPointNumberEditor
A custom editor for Doubles.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
-
Fields inherited from class adams.gui.goe.AbstractNumberEditor
m_Constraint, m_CurrentValue, m_DefaultValue
-
Fields inherited from class adams.gui.goe.AbstractPropertyEditorSupport
APPROVE_OPTION, CANCEL_OPTION, EMPTY, m_ChosenOption, m_CustomEditor, m_WindowAdapter, NULL
-
-
Constructor Summary
Constructors Constructor Description DoubleEditor()Initializes the editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NumberTextField.TypegetType()Returns the type of number to check for.ObjectgetValue()Gets the property value.protected Objectparse(String text)Parses the string and returns an object of the correct class.voidsetValue(Object value)Set (or change) the object that is to be edited.protected StringtoString(Object obj)Turns the object into a string representation.-
Methods inherited from class adams.gui.goe.AbstractFloatingPointNumberEditor
createCheckModel, createCustomEditor, updateBounds
-
Methods inherited from class adams.gui.goe.AbstractNumberEditor
getConstraint, getDefaultValue, setConstraint, setDefaultValue
-
Methods inherited from class adams.gui.goe.AbstractBasicTypePropertyEditor
getAsText, initForDisplay, isPaintable, paintValue, setAsText
-
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createTipText, createWindowAdapter, getChosenOption, getCustomEditor, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getParentDialog, getParentFrame, initialize, resetChosenOption, supportsCustomEditor
-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getJavaInitializationString, getSource, getTags, removePropertyChangeListener, setSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.beans.PropertyEditor
addPropertyChangeListener, getAsText, getCustomEditor, getJavaInitializationString, getTags, isPaintable, paintValue, removePropertyChangeListener, setAsText, supportsCustomEditor
-
-
-
-
Method Detail
-
getType
protected NumberTextField.Type getType()
Returns the type of number to check for.- Specified by:
getTypein classAbstractFloatingPointNumberEditor- Returns:
- the type of number
-
setValue
public void setValue(Object value)
Set (or change) the object that is to be edited. Primitive types such as "int" must be wrapped as the corresponding object type such as "java.lang.Double".- Specified by:
setValuein interfacePropertyEditor- Overrides:
setValuein classAbstractPropertyEditorSupport- Parameters:
value- The new target object to be edited. Note that this object should not be modified by the PropertyEditor, rather the PropertyEditor should create a new object to hold any modified value.
-
getValue
public Object getValue()
Gets the property value.- Specified by:
getValuein interfacePropertyEditor- Overrides:
getValuein classPropertyEditorSupport- Returns:
- The value of the property. Primitive types such as "int" will be wrapped as the corresponding object type such as "java.lang.Double".
-
toString
protected String toString(Object obj)
Turns the object into a string representation.- Overrides:
toStringin classAbstractBasicTypePropertyEditor- Parameters:
obj- the object to convert- Returns:
- the string representation
-
parse
protected Object parse(String text) throws IllegalArgumentException
Parses the string and returns an object of the correct class.- Specified by:
parsein classAbstractBasicTypePropertyEditor- Parameters:
text- the string to parse- Returns:
- the generated object
- Throws:
IllegalArgumentException- if parsing fails
-
-