Package swingtree
Class UIForProgressBar<P extends JProgressBar>
public final class UIForProgressBar<P extends JProgressBar>
extends UIForAnySwing<UIForProgressBar<P>,P>
A SwingTree builder node designed for configuring
JProgressBar
instances.-
Method Summary
Modifier and TypeMethodDescriptionprotected UIForProgressBar
<P> _newBuilderWithState
(swingtree.BuilderState<P> newState) An internal wither method which creates a new builder instance with the providedBuilderState
stored inside it.protected swingtree.BuilderState
<P> _state()
Returns the state of the builder, which is a container for the wrapped component as well as it's type and currentEventProcessor
.final UIForProgressBar
<P> withMax
(int max) Sets the maximum value of the progress bar.final UIForProgressBar
<P> Models the maximum value of the progress bar using aVal
property so that when the value of the property changes, the max value of the progress bar will be updated accordingly.final UIForProgressBar
<P> withMin
(int min) Sets the minimum value of the slider.final UIForProgressBar
<P> Models the minimum value of the slider using aVal
property which allows for dynamic updates to the min value of the slider.final UIForProgressBar
<P> withOrientation
(sprouts.Val<UI.Align> align) Models the orientation of the slider using aVal
property which allows for dynamic updates to the orientation of the slider.final UIForProgressBar
<P> withOrientation
(UI.Align align) Sets a fixed orientation for the slider using theUI.Align
enum.final UIForProgressBar
<P> withProgress
(double progress) Use this to specify the current progress value in terms of a double value between 0 and 1, where 0 represents 0% progress and 1 represents 100% progress.final UIForProgressBar
<P> withProgress
(sprouts.Val<Double> progress) Allows you to model the progress of the progress bar in terms of a double value between 0 and 1 using aVal
property.final UIForProgressBar
<P> withValue
(int value) Sets the value of the progress bar through theJProgressBar.setValue(int)
method of the underlyingJProgressBar
type.final UIForProgressBar
<P> Allows you to model the progress of the progress bar in terms of an integer based property which will update the progress bar value whenever it is changed, typically in your view model or controller.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<UIForProgressBar<P extends JProgressBar>,
P extends JProgressBar, 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<UIForProgressBar<P extends JProgressBar>,
P extends JProgressBar, 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.
-
withOrientation
Sets a fixed orientation for the slider using theUI.Align
enum.- Parameters:
align
- The orientation constant of the slider.- Returns:
- This builder node.
-
withOrientation
Models the orientation of the slider using aVal
property which allows for dynamic updates to the orientation of the slider. So when the value of the property changes, the orientation of the slider will be updated accordingly.- Parameters:
align
- The orientation of the slider.- Returns:
- This builder node.
-
withMin
Sets the minimum value of the slider. For more information seeJProgressBar.setMinimum(int)
.- Parameters:
min
- The minimum value of the slider.- Returns:
- This very instance, which enables builder-style method chaining.
-
withMin
Models the minimum value of the slider using aVal
property which allows for dynamic updates to the min value of the slider. So when the value of the property changes, the min value of the slider will be updated accordingly.- Parameters:
min
- The min property used to dynamically update the min value of the slider.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifmin
isnull
.
-
withMax
Sets the maximum value of the progress bar. For more information seeJProgressBar.setMaximum(int)
(int)}.- Parameters:
max
- The maximum value of the progress bar.- Returns:
- This very instance, which enables builder-style method chaining.
-
withMax
Models the maximum value of the progress bar using aVal
property so that when the value of the property changes, the max value of the progress bar will be updated accordingly. For more information seeJProgressBar.setMaximum(int)
.- Parameters:
max
- An integer property used to dynamically update the max value of the progress bar.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifmax
isnull
.
-
withValue
Sets the value of the progress bar through theJProgressBar.setValue(int)
method of the underlyingJProgressBar
type.- Parameters:
value
- The value to set for thisJProgressBar
.- Returns:
- This very instance, which enables builder-style method chaining.
-
withProgress
Use this to specify the current progress value in terms of a double value between 0 and 1, where 0 represents 0% progress and 1 represents 100% progress. Note that the actual value of the progress bar will be calculated based on the min and max values currently specified for the progress bar.- Parameters:
progress
- The progress value, a number between 0 and 1, to set for thisJProgressBar
. Note that this will be converted to an integer value between the min and max values.- Returns:
- This very instance, which enables builder-style method chaining.
-
withValue
Allows you to model the progress of the progress bar in terms of an integer based property which will update the progress bar value whenever it is changed, typically in your view model or controller.- Parameters:
val
- An integer property used to dynamically update the value of the progress bar.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifvalue
isnull
.
-
withProgress
Allows you to model the progress of the progress bar in terms of a double value between 0 and 1 using aVal
property. When the value of the property changes, the progress bar will be updated accordingly.
The progress value will be converted to an integer value between the min and max values.- Parameters:
progress
- A double property used to dynamically update the value of the progress bar.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifvalue
isnull
.
-