Package adams.gui.goe
Class AbstractNumberEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- adams.gui.goe.AbstractPropertyEditorSupport
-
- adams.gui.goe.AbstractBasicTypePropertyEditor
-
- adams.gui.goe.AbstractNumberEditor
-
- All Implemented Interfaces:
HelpProvider,PropertyEditorWithConstraint<NumericBounds>,PropertyEditorWithDefaultValue,PropertyEditor
- Direct Known Subclasses:
AbstractFloatingPointNumberEditor,AbstractIntegralNumberEditor
public abstract class AbstractNumberEditor extends AbstractBasicTypePropertyEditor implements PropertyEditorWithConstraint<NumericBounds>, PropertyEditorWithDefaultValue
An abstract ancestor for custom editors for numbers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected NumericBoundsm_Constraintthe constraint.protected Numberm_CurrentValuethe current value.protected Numberm_DefaultValuethe default value.-
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 AbstractNumberEditor()Initializes the editor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description NumericBoundsgetConstraint()Return the constraint in use.ObjectgetDefaultValue()Returns the default value.voidsetConstraint(NumericBounds value)The constraint to use.voidsetDefaultValue(Object value)Sets the default value.protected abstract voidupdateBounds()Updates the bounds.-
Methods inherited from class adams.gui.goe.AbstractBasicTypePropertyEditor
createCustomEditor, getAsText, initForDisplay, isPaintable, paintValue, parse, setAsText, toString
-
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createTipText, createWindowAdapter, getChosenOption, getCustomEditor, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getParentDialog, getParentFrame, initialize, resetChosenOption, setValue, supportsCustomEditor
-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getJavaInitializationString, getSource, getTags, getValue, 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, getValue, isPaintable, paintValue, removePropertyChangeListener, setAsText, setValue, supportsCustomEditor
-
-
-
-
Field Detail
-
m_CurrentValue
protected Number m_CurrentValue
the current value.
-
m_DefaultValue
protected Number m_DefaultValue
the default value. May get ignored by the concrete editor.
-
m_Constraint
protected NumericBounds m_Constraint
the constraint.
-
-
Method Detail
-
setDefaultValue
public void setDefaultValue(Object value)
Sets the default value. May get ignored by the concrete editor.- Specified by:
setDefaultValuein interfacePropertyEditorWithDefaultValue- Parameters:
value- the default value
-
getDefaultValue
public Object getDefaultValue()
Returns the default value.- Specified by:
getDefaultValuein interfacePropertyEditorWithDefaultValue- Returns:
- the default value
-
setConstraint
public void setConstraint(NumericBounds value)
The constraint to use.- Specified by:
setConstraintin interfacePropertyEditorWithConstraint<NumericBounds>- Parameters:
value- the constraint, null to remove
-
getConstraint
public NumericBounds getConstraint()
Return the constraint in use.- Specified by:
getConstraintin interfacePropertyEditorWithConstraint<NumericBounds>- Returns:
- the constraint, null if none set
-
updateBounds
protected abstract void updateBounds()
Updates the bounds.
-
-