A SwingTree builder node designed for configuring
JSpinner
instances.-
Method Summary
Modifier and TypeMethodDescriptionprotected UIForSpinner
<S> _newBuilderWithState
(swingtree.BuilderState<S> newState) An internal wither method which creates a new builder instance with the providedBuilderState
stored inside it.protected swingtree.BuilderState
<S> _state()
Returns the state of the builder, which is a container for the wrapped component as well as it's type and currentEventProcessor
.final UIForSpinner
<S> onChange
(sprouts.Action<ComponentDelegate<JSpinner, ChangeEvent>> action) Adds anAction
to the underlyingJSpinner
through anChangeListener
, Use this to register an action to be performed when the spinner's value changes.final UIForSpinner
<S> Sets the numeric step size of the value of the spinner.final <N extends Number>
UIForSpinner<S> withStepSize
(sprouts.Val<N> val) Sets the numeric step size of the value of the spinner and also binds to said value.final UIForSpinner
<S> Sets the value of the spinner.final UIForSpinner
<S> withValue
(sprouts.Val<?> value) Sets the value of the spinner and also binds to said value.final UIForSpinner
<S> withValue
(sprouts.Var<?> value) Sets the value of the spinner and also binds to the provided property.Methods inherited from class swingtree.UIForAnySwing
_addComponentTo, _addViewableProps, _addViewableProps, _isUndefinedColor, _isUndefinedFont, _setBackground, _setEnabled, _setMinHeight, _setMinWidth, _setPrefWidth, add, add, add, add, add, add, add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAll, doUpdates, group, group, id, id, isEnabledIf, isEnabledIf, isEnabledIf, isEnabledIfNot, isEnabledIfNot, isEnabledIfNot, isFocusableIf, isFocusableIf, isFocusableIf, isFocusableIfNot, isFocusableIfNot, isFocusableIfNot, isValidIf, isVisibleIf, isVisibleIf, isVisibleIf, isVisibleIfNot, isVisibleIfNot, isVisibleIfNot, makeFocused, makeNonOpaque, makeOpaque, on, on, onCharTyped, onFocusGain, onFocusLoss, onHidden, onKeyPress, onKeyRelease, onKeyTyped, onMouseClick, onMouseDrag, onMouseEnter, onMouseEnter, onMouseEnterGreedy, onMouseExit, onMouseExit, onMouseExitGreedy, onMouseMove, onMousePress, onMouseRelease, onMouseWheelDown, onMouseWheelMove, onMouseWheelUp, onMoved, onPressed, onRelease, onResize, onShown, onTyped, onTyped, onView, withBackground, withBackground, withBackgroundColor, withBackgroundIf, withBackgroundIf, withBackgroundIf, withBackgroundIf, withBorder, withBorder, withBorderTitled, withBorderTitled, withBoxLayout, withCompoundBorder, withCompoundBorderTitled, withCursor, withCursor, withCursorIf, withCursorIf, withDragAway, withDropSite, withEmptyBorder, withEmptyBorder, withEmptyBorder, withEmptyBorder, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withFlowLayout, withFlowLayout, withFlowLayout, withForeground, withForeground, withForegroundColor, withForegroundIf, withForegroundIf, withForegroundIf, withForegroundIf, withGridBagLayout, withGridLayout, withGridLayout, withGridLayout, withHeight, withHeight, withHeightExactly, withHeightExactly, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLineBorder, withLineBorder, withLineBorder, withLineBorderTitled, withLineBorderTitled, withLineBorderTitled, withLineBorderTitled, withMatteBorder, withMatteBorder, withMatteBorder, withMatteBorderTitled, withMatteBorderTitled, withMatteBorderTitled, withMaxHeight, withMaxHeight, withMaxSize, withMaxSize, withMaxSize, withMaxSize, withMaxSize, withMaxWidth, withMaxWidth, withMinHeight, withMinHeight, withMinSize, withMinSize, withMinSize, withMinSize, withMinSize, withMinWidth, withMinWidth, withPrefHeight, withPrefHeight, withPrefSize, withPrefSize, withPrefSize, withPrefSize, withPrefSize, withPrefWidth, withPrefWidth, withProperty, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withSize, withSize, withSize, withSize, withSizeExactly, withSizeExactly, withSizeExactly, withSizeExactly, withStyle, withTooltip, withTooltip, withTransitionalStyle, withTransitoryStyle, withWidth, withWidth, withWidthExactly, withWidthExactly
Methods inherited from class swingtree.UIForAnything
_addBuildersTo, _addBuilderTo, _addComponentsTo, _disposeState, _onShow, _onShow, _runInApp, _runInApp, _runInUI, _this, _with, _withOnShow, _withOnShow, add, add, add, add, apply, applyIf, applyIfPresent, component, equals, get, getComponent, getType, hashCode, peek, toString
-
Method Details
-
_state
Description copied from class:UIForAnything
Returns the state of the builder, which is a container for the wrapped component as well as it's type and currentEventProcessor
.- Specified by:
_state
in classUIForAnything<UIForSpinner<S extends JSpinner>,
S extends JSpinner, JComponent> - Returns:
- The state of the builder.
-
_newBuilderWithState
Description copied from class:UIForAnything
An internal wither method which creates a new builder instance with the providedBuilderState
stored inside it.- Specified by:
_newBuilderWithState
in classUIForAnything<UIForSpinner<S extends JSpinner>,
S extends JSpinner, JComponent> - Parameters:
newState
- The new state which should be stored inside the new builder instance.- Returns:
- A new builder instance with the provided state stored inside it.
-
onChange
public final UIForSpinner<S> onChange(sprouts.Action<ComponentDelegate<JSpinner, ChangeEvent>> action) Adds anAction
to the underlyingJSpinner
through anChangeListener
, Use this to register an action to be performed when the spinner's value changes.- Parameters:
action
- The action to be performed.- Returns:
- This very instance, which enables builder-style method chaining.
-
withValue
Sets the value of the spinner.- Parameters:
value
- The value to set.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifvalue
isnull
.
-
withValue
Sets the value of the spinner and also binds to said value.- Parameters:
value
- TheVal
wrapper whose value should be set.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifvalue
isnull
.
-
withValue
Sets the value of the spinner and also binds to the provided property.- Parameters:
value
- TheVar
wrapper whose value should be set.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifvalue
isnull
.
-
withStepSize
Sets the numeric step size of the value of the spinner. This expects your spinner to be based on theSpinnerNumberModel
.- Parameters:
n
- TheNumber
which should be set as step size.- Returns:
- This very instance, which enables builder-style method chaining.
-
withStepSize
Sets the numeric step size of the value of the spinner and also binds to said value. This expects your spinner to be based on theSpinnerNumberModel
.- Type Parameters:
N
- The type of the number.- Parameters:
val
- TheVal
wrapper whose step size should be set.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifval
isnull
.
-