Class UIForSplitPane<P extends JSplitPane>
- Type Parameters:
P- The type ofJSplitPanethat thisUIForSplitPaneis configuring.
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 providedBuilderStatestored 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> withLayoutOrientation(sprouts.Val<UI.Align> align) Dynamically sets the layout of the two components in the split pane to either be placed left to right (horizontal split) or on top of each other (vertical split).final UIForSplitPane<P> withLayoutOrientation(UI.Align align) Sets the layout of the two components in the split pane to either be placed left to right (horizontal split) or on top of each other (vertical split).Methods inherited from class swingtree.UIForAnySwing
_addComponentTo, _addViewableProps, _addViewableProps, _addViewableProps, _isUndefinedColor, _isUndefinedFont, _isUndefinedFont, _setBackground, _setEnabled, _setMinHeight, _setMinWidth, _setPrefWidth, _tryCalculatingDiffBetween, add, add, add, add, add, add, add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAll, 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, 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, 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, withFont, withFont, withFont, withFontSize, withFontSize, 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, withLayout, withLineBorder, withLineBorder, withLineBorder, withLineBorderTitled, withLineBorderTitled, withLineBorderTitled, withLineBorderTitled, withMatteBorder, withMatteBorder, withMatteBorder, withMatteBorderTitled, withMatteBorderTitled, withMatteBorderTitled, withMaxHeight, withMaxHeight, withMaxSize, withMaxSize, withMaxSize, withMaxSize, withMaxWidth, withMaxWidth, withMinHeight, withMinHeight, withMinSize, withMinSize, withMinSize, withMinSize, withMinWidth, withMinWidth, withPrefHeight, withPrefHeight, withPrefSize, withPrefSize, withPrefSize, withPrefSize, withPrefWidth, withPrefWidth, withProperty, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withSize, withSize, withSize, withSizeExactly, withSizeExactly, withSizeExactly, withSizeExactly, withStyle, withTooltip, withTooltip, withTransitionalStyle, withTransitoryStyle, withWidth, withWidth, withWidthExactly, withWidthExactlyMethods inherited from class swingtree.UIForAnything
_addBuildersTo, _addBuilderTo, _addComponentsTo, _disposeState, _onShow, _onShow, _onShowDelegated, _runInApp, _runInApp, _runInUI, _this, _with, _withOnShow, _withOnShow, add, add, add, add, apply, applyIf, applyIfPresent, equals, get, getType, hashCode, peek, toString
-
Method Details
-
_state
Description copied from class:UIForAnythingReturns the state of the builder, which is a container for the wrapped component as well as it's type and currentEventProcessor.- Specified by:
_statein classUIForAnything<UIForSplitPane<P extends JSplitPane>,P extends JSplitPane, JComponent> - Returns:
- The state of the builder.
-
_newBuilderWithState
Description copied from class:UIForAnythingAn internal wither method which creates a new builder instance with the providedBuilderStatestored inside it.- Specified by:
_newBuilderWithStatein 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.
-
withLayoutOrientation
Sets the layout of the two components in the split pane to either be placed left to right (horizontal split) or on top of each other (vertical split). If you want to control this property dynamically through a bound property, then consider using thewithLayoutOrientation(Val)method.
You can also directly construct a split pane with the desired layout through theUIFactoryMethods.splitPane(UI.Align)andUIFactoryMethods.splitPane(Val)factory methods.- Parameters:
align- The alignment of the components in the split pane, which determines the layout of the split pane.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException- if the provided alignment is null.
-
withLayoutOrientation
Dynamically sets the layout of the two components in the split pane to either be placed left to right (horizontal split) or on top of each other (vertical split). This method binds the supplied layout property to the split pane, which means that when the property changes itsUI.Align, then the layout of the split pane will be updated accordingly. If you want to set a fixed layout that does not change dynamically, then consider using thewithLayoutOrientation(UI.Align)method.
You can also directly construct a split pane with the desired layout through theUIFactoryMethods.splitPane(UI.Align)andUIFactoryMethods.splitPane(Val)factory methods.- Parameters:
align- A property dynamically determining the alignment of the components in the split pane, which determines the layout of the split pane.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException- ifalignisnull.
-
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- iflocationisnull.
-
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- ifsizeisnull.
-
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.
-