Class UIForSplitPane<P extends JSplitPane>
JSplitPane
instances.-
Method Summary
Modifier and TypeMethodDescriptionprotected UIForSplitPane
<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 UIForSplitPane
<P> withDividerAt
(int location) Sets the location of the divider.final UIForSplitPane
<P> withDividerAt
(sprouts.Val<Integer> location) Sets the location of the divider in the form of a property, which can be dynamically update the divide.final UIForSplitPane
<P> withDividerSize
(int size) Sets the size of the divider.final UIForSplitPane
<P> withDividerSize
(sprouts.Val<Integer> size) Sets the size of the divider in the form of a property, which can be dynamically update.final UIForSplitPane
<P> withDivisionOf
(double percentage) Sets the location of the divider based on a percentage value.final UIForSplitPane
<P> withDivisionOf
(sprouts.Val<Double> percentage) Updates the location of the divider based on a percentage property which means that if the split pane split is aligned horizontally, the divider will be set to the percentage of the height of the split pane and if the split pane is aligned vertically, the divider will be set to the percentage of the width of the split pane.final UIForSplitPane
<P> withDivisionOf
(sprouts.Var<Double> percentage) Updates the location of the divider based on a percentage property which means that if the split pane split is aligned horizontally, the divider will be set to the percentage of the height of the split pane.final UIForSplitPane
<P> withOrientation
(sprouts.Val<UI.Align> align) Sets the alignment of the split bar in the split pane dynamically based on the providedVal
property which will be observed by the split pane.final UIForSplitPane
<P> withOrientation
(UI.Align align) Sets the alignment of the split bar in the split pane.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<UIForSplitPane<P extends JSplitPane>,
P extends JSplitPane, 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<UIForSplitPane<P extends JSplitPane>,
P extends JSplitPane, 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 the alignment of the split bar in the split pane.- Parameters:
align
- The alignment of the split bar in the split pane.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- if the provided alignment is null.
-
withOrientation
Sets the alignment of the split bar in the split pane dynamically based on the providedVal
property which will be observed by the split pane.- Parameters:
align
- The alignment property of the split bar in the split pane.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- if the provided alignment is null or the property is allowed to wrap a null value.
-
withDividerAt
Sets the location of the divider. This is passed off to the look and feel implementation, and then listeners are notified. A value less than 0 implies the divider should be reset to a value that attempts to honor the preferred size of the left/top component. After notifying the listeners, the last divider location is updated, viasetLastDividerLocation
.- Parameters:
location
- An int specifying a UI-specific value (typically a pixel count)- Returns:
- This very instance, which enables builder-style method chaining.
-
withDividerAt
Sets the location of the divider in the form of a property, which can be dynamically update the divide. This is passed off to the look and feel implementation, and then listeners are notified. A value less than 0 implies the divider should be reset to a value that attempts to honor the preferred size of the left/top component. After notifying the listeners, the last divider location is updated, viasetLastDividerLocation
.- Parameters:
location
- A property dynamically determining a UI-specific value (typically a pixel count)- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- iflocation
isnull
.
-
withDividerSize
Sets the size of the divider.- Parameters:
size
- An integer giving the size of the divider in pixels- Returns:
- This very instance, which enables builder-style method chaining.
-
withDividerSize
Sets the size of the divider in the form of a property, which can be dynamically update.- Parameters:
size
- A property dynamically determining the size of the divider in pixels- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifsize
isnull
.
-
withDivisionOf
Sets the location of the divider based on a percentage value. So if the split pane split is aligned horizontally, the divider will be set to the percentage of the height of the split pane. If the split pane is aligned vertically, the divider will be set to the percentage of the width of the split pane.Note that a component listener is installed to the split pane's size temporarily, so that the divider location can be calculated when the split pane is sized by the layout manager for the first time. This is because before the layout manager did its thing, there was no way to know the actual location of the divider based on the percentage. So keep in mind that changes to the divider location immediately after this method is called will be overridden by said listener!
A change of the divider location is ultimately passed off to the look and feel implementation, where listeners are then notified. A value less than 0 implies the divider should be reset to a value that attempts to honor the preferred size of the left/top component. After notifying the listeners, the last divider location is updated, via
JSplitPane.setLastDividerLocation(int)
.- Parameters:
percentage
- A double value between 0 and 1, representing the percentage of the split pane's- Returns:
- This very instance, which enables builder-style method chaining.
-
withDivisionOf
Updates the location of the divider based on a percentage property which means that if the split pane split is aligned horizontally, the divider will be set to the percentage of the height of the split pane and if the split pane is aligned vertically, the divider will be set to the percentage of the width of the split pane.This method binds the property uni-directionally, which means that the property will be observed by the split pane, but the split pane will not change the property (see
withDivisionOf(Var)
for a bidirectional variant).A change of the divider location is ultimately passed off to the look and feel implementation, where listeners are then notified. A value less than 0 implies the divider should be reset to a value that attempts to honor the preferred size of the left/top component. After notifying the listeners, the last divider location is updated, via
JSplitPane.setLastDividerLocation(int)
.Note that the percentage is calculated based on the split pane's current size, so if the split pane is resized, the divider location will be recalculated in order to honor the percentage.
- Parameters:
percentage
- A property dynamically determining a double value between 0 and 1, representing the percentage of the split pane's- Returns:
- This very instance, which enables builder-style method chaining.
-
withDivisionOf
Updates the location of the divider based on a percentage property which means that if the split pane split is aligned horizontally, the divider will be set to the percentage of the height of the split pane. If, however, the split pane is aligned vertically, then the divider will be set to the percentage of the width of the split pane.Note that this binds the property to the location of the divider bidirectionally, which means that the value inside the property will be updated when the divider location is changed by the user and the divider location will be updated when the property changes in the business logic.
A change of the divider location is ultimately passed off to the look and feel implementation, where listeners are then notified. A value less than 0 implies the divider should be reset to a value that attempts to honor the preferred size of the left/top component. After notifying the listeners, the last divider location is updated, via
JSplitPane.setLastDividerLocation(int)
.Note that the percentage is calculated based on the split pane's current size, so if the split pane changes its size, the divider location will be recalculated.
- Parameters:
percentage
- A property dynamically determining a double value between 0 and 1, representing the percentage of the split pane's- Returns:
- This very instance, which enables builder-style method chaining.
-