Package org.jppf.ui.options
Class SpinnerNumberOption
java.lang.Object
org.jppf.ui.options.AbstractOptionProperties
org.jppf.ui.options.AbstractOptionElement
org.jppf.ui.options.AbstractOption
org.jppf.ui.options.SpinnerNumberOption
- All Implemented Interfaces:
Serializable,Option,OptionElement,OptionProperties
An option that uses a JSpinner control to edit its value.
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NumberMaximum value for the spinner control.protected NumberMinimum value for the spinner control.protected NumberFormatUse to parse from string values toNumberinstances.protected StringThe number format pattern.protected JLabelLabel associated with theJSpinnerfield.protected NumberStep size for the spinner control.Fields inherited from class org.jppf.ui.options.AbstractOption
listeners, persistent, valueFields inherited from class org.jppf.ui.options.AbstractOptionElement
parent, rootFields inherited from class org.jppf.ui.options.AbstractOptionProperties
bordered, componentConstraints, detachable, eventsEnabled, finalizer, horizontalScrollbar, iconPath, initializer, label, layoutConstraints, mouseListener, name, scripts, scrollable, toolTipText, UIComponent, verticalScrollbar -
Constructor Summary
ConstructorsConstructorDescriptionConstructor provided as a convenience to facilitate the creation of option elements through reflexion. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateUI()Create the UI components for this option.getMax()Get the maximum value for the spinner control.getMin()Get the minimum value for the spinner control.Get the number format pattern.Get tabel associated with theJSpinnerfield.getStep()Get ttep size for the spinner control.getValue()Get the current value for this option.voidsetEnabled(boolean enabled) Enable or disable this option.voidSet the maximum value for the spinner control.voidSet the minimum value for the spinner control.voidsetPattern(String pattern) Set the number format pattern.voidSet ttep size for the spinner control.protected voidPropagate the selection changes in the underlying combo box to the listeners to this option.voidSet the current value for this option.toString()Get a string representation of this element.Methods inherited from class org.jppf.ui.options.AbstractOption
addValueChangeListener, fireValueChanged, isPersistent, layoutComponents, layoutComponents, removeValueChangeListener, setPersistentMethods inherited from class org.jppf.ui.options.AbstractOptionElement
findAll, findAllWithName, findElement, findFirstWithName, findLastWithName, getChildForName, getParent, getPath, getRoot, getStringPath, setParentMethods inherited from class org.jppf.ui.options.AbstractOptionProperties
createScrollPane, getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isHorizontalScrollbar, isScrollable, isVerticalScrollbar, setBordered, setComponentConstraints, setDetachable, setEditable, setEventsEnabled, setFinalizer, setHorizontalScrollbar, setIconPath, setInitializer, setLabel, setLayoutConstraints, setMouseListener, setName, setScrollable, setToolTipText, setUIComponent, setVerticalScrollbarMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.ui.options.OptionElement
findAllWithName, findElement, findFirstWithName, findLastWithName, getParent, getPath, getRoot, getStringPathMethods inherited from interface org.jppf.ui.options.OptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isScrollable, setComponentConstraints, setEditable, setEventsEnabled, setLayoutConstraints, setMouseListener
-
Field Details
-
spinnerLabel
Label associated with theJSpinnerfield. -
min
Minimum value for the spinner control. -
max
Maximum value for the spinner control. -
step
Step size for the spinner control. -
nf
Use to parse from string values toNumberinstances. -
pattern
The number format pattern.
-
-
Constructor Details
-
SpinnerNumberOption
public SpinnerNumberOption()Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
-
-
Method Details
-
createUI
public void createUI()Description copied from class:AbstractOptionPropertiesCreate the UI components for this option.- Specified by:
createUIin classAbstractOptionProperties
-
getValue
Get the current value for this option.- Specified by:
getValuein interfaceOption- Overrides:
getValuein classAbstractOption- Returns:
- a
Numberinstance.
-
setValue
Set the current value for this option.- Overrides:
setValuein classAbstractOption- Parameters:
value- aNumberinstance.
-
setupValueChangeNotifications
protected void setupValueChangeNotifications()Propagate the selection changes in the underlying combo box to the listeners to this option.- Specified by:
setupValueChangeNotificationsin classAbstractOption- See Also:
-
setEnabled
public void setEnabled(boolean enabled) Enable or disable this option.- Parameters:
enabled- true to enable this option, false to disable it.
-
getMax
Get the maximum value for the spinner control.- Returns:
- the value as a
Number.
-
setMax
Set the maximum value for the spinner control.- Parameters:
max- the value as aNumber.
-
getMin
Get the minimum value for the spinner control.- Returns:
- the value as a
Number.
-
setMin
Set the minimum value for the spinner control.- Parameters:
min- the value aNumber.
-
getStep
Get ttep size for the spinner control.- Returns:
- the step size as a
Number.
-
setStep
Set ttep size for the spinner control.- Parameters:
step- the step size as aNumber.
-
toString
Description copied from class:AbstractOptionElementGet a string representation of this element.- Overrides:
toStringin classAbstractOption- Returns:
- a string providing information about this option element.
- See Also:
-
getPattern
Get the number format pattern.- Returns:
- the pattern as a string.
-
setPattern
Set the number format pattern.- Parameters:
pattern- the pattern as a string.
-
getSpinnerLabel
Get tabel associated with theJSpinnerfield.- Returns:
- a
JLabelinstance.
-