public class SplitPane
ImplementsAnimation, Editable, Iterable<Component>, StyleListener
A Split Pane component.
A split pane can either be horizontal or vertical, and provides a draggable divider
between two components. If the #orientation is #HORIZONTAL_SPLIT, then the
child components will be laid out horizontally (side by side with a vertical bar as a divider).
If the #orientation is #VERTICAL_SPLIT, then the components are laid out vertically (one above
the other.
The bar divider bar includes arrows to collapse and expand the divider also.
Splitpane UI
The following is an example of a UI that is built around a split pane. This has an outer “horizontal” split pane, and the left side has a vertical split pane.
Collapsed:
Expanded:
Nested types
class SplitPane.Settings | An object to configure settings for a SplitPane. |
Fields
public static final int HORIZONTAL_SPLIT = 0 | Constant used for orientation. |
public static final int VERTICAL_SPLIT = 1 | Constant used for orientation. |
Constructors
Methods
public void changeInsets(String minInset, String preferredInset, String maxInset) | Changes the minimum, preferred, and maximum insets of the split pane. |
public Component getBottomOrRightComponent() | Gets the component that is currently placed in the bottom or right of the split pane. |
public Component getBottom() | Gets the component that is currently placed in the bottom of the split pane. |
public void setBottom(Component cmp) | Sets the component to be placed on the bottom of the split pane. |
public Component getRight() | Gets the component that is currently placed in the right of the split pane. |
public void setRight(Component cmp) | Sets the component to be placed on the right of the split pane. |
public Component getTopOrLeftComponent() | Gets the component that is currently placed in the top or left of the split pane. |
public Component getTop() | Gets the component that is currently placed in the top of the split pane. |
public void setTop(Component cmp) | Sets the component that should be placed in the top section of the split pane. |
public Component getLeft() | Gets the component that is currently placed in the left of the split pane. |
public void setLeft(Component cmp) | Sets the component that should be placed in the left section of the split pane. |
public void toggleCollapsePreferred() | Toggles the split pane between collapsed state and preferred state. |
public void toggleExpandPreferred() | Toggles the split pane between expanded state and preferred state. |
public void expand() | Expands the split pane. |
public void expand(boolean force) | Expands the split pane. |
public void collapse() | Collapses the aplit pane. |
public void collapse(boolean force) | Collapses the split pane. |
public void setInset(String inset, boolean clamp) | Sets the inset of the divider explicitly. |
public void setInset(String inset) | Sets the inset of the divider explicitly. |
public String getPreferredInset() | Gets the string value of the preferred inset. |
public void setPreferredInset(String inset) | Sets the preferred inset of this split pane. |
public String getMinInset() | Gets the string value of the minimum inset of the divider. |
public void setMinInset(String inset) | Sets the minimum inset allowed for the divider. |
public String getMaxInset() | Gets the string value of the maximum inset of the divider. |
public void setMaxInset(String inset) | Sets the maximum inset allowed for the divider. |
Inherited fields
From Component
DEFAULT_CURSOR, CROSSHAIR_CURSOR, TEXT_CURSOR, WAIT_CURSOR, SW_RESIZE_CURSOR, SE_RESIZE_CURSOR, NW_RESIZE_CURSOR, NE_RESIZE_CURSOR, N_RESIZE_CURSOR, S_RESIZE_CURSOR, W_RESIZE_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_Y, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_IMMEDIATELY_DRAG_XY, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_CENTER_OFFSET, BRB_OTHER, CENTER, TOP, LEFT, BOTTOM, RIGHT, BASELINE
Inherited methods
From Container
encloseIn, encloseIn, initLaf, getUIManager, setUIManager, isSurface, add, addAll, add, add, add, add, add, getLeadComponent, setLeadComponent, getLeadParent, keyPressed, keyReleased, getLayout, setLayout, invalidate, setShouldLayout, setShouldCalcPreferredSize, getLayoutWidth, getLayoutHeight, applyRTL, constrainWidthWhenScrollable, constrainHeightWhenScrollable, addComponent, addComponent, addComponent, addComponent, replaceAndWait, replaceAndWait, replace, replaceAndWait, replace, createReplaceTransition, isEnabled, setEnabled, removeComponent, cancelRepaints, flushReplace, removeAll, revalidateWithAnimationSafety, revalidate, revalidateLater, forceRevalidate, clearClientProperties, paint, paintGlass, layoutContainer, isSafeArea, setSafeArea, isSafeAreaRoot, getSafeAreaRoot, setSafeAreaRoot, getComponentCount, getComponentAt, getComponentIndex, contains, scrollComponentToVisible, getClosestComponentTo, getResponderAt, getComponentAt, findDropTargetAt, pointerPressed, calcPreferredSize, paramString, refreshTheme, isScrollableX, setScrollableX, isScrollableY, setScrollableY, getSideGap, getBottomGap, setScrollable, setCellRenderer, getScrollIncrement, setScrollIncrement, findFirstFocusable, dragInitiated, fireClicked, isSelectableInteraction, getGridPosY, paintComponentBackground, getGridPosX, animateHierarchyAndWait, createAnimateHierarchy, animateHierarchy, animateHierarchyFadeAndWait, createAnimateHierarchyFade, animateHierarchyFade, animateLayoutFadeAndWait, createAnimateLayoutFadeAndWait, animateLayoutFade, createAnimateLayoutFade, animateLayoutAndWait, animateLayout, updateTabIndices, createAnimateLayout, drop, createAnimateMotion, morph, morphAndWait, animateUnlayout, animateUnlayoutAndWait, createAnimateUnlayout, getChildrenAsList, iterator, iterator
From Component
setSameSize, isSetCursorSupported, parsePreferredSize, getDefaultDragTransparency, setDefaultDragTransparency, getEditingDelegate, setEditingDelegate, getCursor, setCursor, showNativeOverlay, hideNativeOverlay, updateNativeOverlay, getNativeOverlay, getAllStyles, getSameWidth, setSameWidth, getSameHeight, setSameHeight, getX, setX, getOuterX, getInnerX, getY, setY, getOuterY, getInnerY, isVisible, setVisible, getClientProperty, stripMarginAndPadding, putClientProperty, getDirtyRegion, setDirtyRegion, isOpaque, setOpaque, getWidth, setWidth, getOuterWidth, getInnerWidth, getHeight, setHeight, getOuterHeight, getInnerHeight, isDragRegion, getDragRegionStatus, getBaseline, getBaselineResizeBehavior, getPreferredSizeStr, setPreferredSizeStr, getPreferredSize, setPreferredSize, getScrollDimension, calcScrollSize, setScrollSize, getPreferredW, setPreferredW, getPreferredH, setPreferredH, getOuterPreferredH, getInnerPreferredH, getOuterPreferredW, getInnerPreferredW, setSize, getUIID, setUIID, setUIIDFinal, setUIID, getInlineAllStyles, setInlineAllStyles, getInlineSelectedStyles, setInlineSelectedStyles, getInlineUnselectedStyles, setInlineUnselectedStyles, getInlineDisabledStyles, setInlineDisabledStyles, getInlinePressedStyles, setInlinePressedStyles, remove, getParent, getOwner, setOwner, isOwnedBy, containsOrOwns, addFocusListener, removeFocusListener, addScrollListener, removeScrollListener, getSelectCommandText, setSelectCommandText, getLabelForComponent, setLabelForComponent, focusGained, focusLost, paintBackgrounds, paintShadows, getAbsoluteX, getAbsoluteY, isInClippingRegion, paintIntersectingComponentsAbove, paintScrollbars, paintScrollbarX, getScrollOpacity, getSelectedRect, paintScrollbarY, paintComponent, paintComponent, getBorder, getScrollable, paintBackground, isScrollable, getScrollX, setScrollX, getScrollY, setScrollY, onScrollX, onScrollY, getDraggedx, getDraggedy, contains, visibleBoundsContains, hasFixedPreferredSize, getBounds, getBounds, getVisibleBounds, getVisibleBounds, isFocusable, setFocusable, onSetFocusable, resetFocusable, getTabIndex, setTabIndex, getPreferredTabIndex, setPreferredTabIndex, isTraversable, setTraversable, handlesInput, setHandlesInput, consumesRawTextInput, hasFocus, setFocus, getComponentForm, getTopLevelContainer, repaint, repaint, longKeyPress, keyRepeated, registerForAnimation, deregisterFromAnimation, getAnimationManager, getScrollAnimationSpeed, setScrollAnimationSpeed, isBlockLead, setBlockLead, isIgnorePointerEvents, setIgnorePointerEvents, isRippleEffect, setRippleEffect, getInlineStylesTheme, setInlineStylesTheme, shouldRenderComponentSelection, isHideInLandscape, setHideInLandscape, createStyleAnimation, isSmoothScrolling, setSmoothScrolling, pointerHover, stopScrollMomentum, pointerHoverReleased, pointerHoverPressed, pinch, pinchReleased, pinch, rotation, isPinchBlocksDragAndDrop, setPinchBlocksDragAndDrop, pointerDragged, getDragImage, getDragTransparency, setDragTransparency, toImage, drawDraggedImage, draggingOver, dragEnter, dragExit, addPullToRefresh, setPullToRefresh, respondsToPointerEvents, pointerDragged, isStickyDrag, pointerPressed, isDragAndDropOperation, pointerReleased, longPointerPress, pointerReleased, setVerticalScrollBounds, setHorizontalScrollBounds, isVScrollThumbGrabbed, isHScrollThumbGrabbed, isVScrollThumbHover, isHScrollThumbHover, isTensileDragEnabled, setTensileDragEnabled, getTextSelectionSupport, addDropListener, removeDropListener, addDragOverListener, removeDragOverListener, isNativeDragSource, setNativeDragSource, getNativeDragOperation, setNativeDragOperation, createNativeDragOperation, isNativeDropTarget, setNativeDropTarget, getAcceptedDropMimeTypes, setAcceptedDropMimeTypes, getAcceptedDropActions, setAcceptedDropActions, canAcceptNativeDrop, nativeDragEnter, nativeDragOver, nativeDragExit, nativeDrop, addNativeDropListener, removeNativeDropListener, addNativeDragOverListener, removeNativeDragOverListener, dragFinished, addDragFinishedListener, addStateChangeListener, removeStateChangeListener, addPointerPressedListener, addLongPressListener, addContextMenuListener, removeContextMenuListener, addMouseWheelListener, removeMouseWheelListener, addStylusListener, removeStylusListener, mouseWheel, paintRippleOverlay, removePointerPressedListener, removeLongPressListener, removeDragFinishedListener, addPointerReleasedListener, removePointerReleasedListener, addPointerDraggedListener, removePointerDraggedListener, getDragSpeed, getStyle, getPressedStyle, setPressedStyle, initUnselectedStyle, initPressedStyle, initDisabledStyle, initSelectedStyle, getUnselectedStyle, setUnselectedStyle, getSelectedStyle, setSelectedStyle, getDisabledStyle, setDisabledStyle, installDefaultPainter, requestFocus, toString, refreshTheme, refreshTheme, isDragActivated, animate, scrollRectToVisible, scrollRectToVisible, paintBorder, paintBorderBackground, isCellRenderer, isScrollVisible, setScrollVisible, setIsScrollVisible, startEditingAsync, stopEditing, isEditing, isEditable, laidOut, deinitialize, initComponent, isInitialized, setInitialized, styleChanged, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, setRTL, isTactileTouch, isTactileTouch, setTactileTouch, getPropertyNames, getPropertyTypes, getPropertyTypeNames, getPropertyValue, setPropertyValue, paintLockRelease, paintLock, isSnapToGrid, setSnapToGrid, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, blocksSideSwipe, isFlatten, setFlatten, getTensileLength, setTensileLength, isGrabsPointerEvents, setGrabsPointerEvents, getScrollOpacityChangeSpeed, setScrollOpacityChangeSpeed, growShrink, isAlwaysTensile, setAlwaysTensile, isDraggable, setDraggable, isDropTarget, setDropTarget, isChildOf, isHideInPortrait, setHideInPortrait, getBindablePropertyNames, getBindablePropertyTypes, bindProperty, unbindProperty, getBoundPropertyValue, setBoundPropertyValue, getCloudBoundProperty, setCloudBoundProperty, getCloudDestinationProperty, setCloudDestinationProperty, getComponentState, setComponentState, setHidden, isHidden, setHidden, isHidden, announceForAccessibility, getAccessibilityText, setAccessibilityText, getSemantics, getAccessibilityNode, accessibilityChanged, accessibilityChanged, getTooltip, setTooltip
Field details
HORIZONTAL_SPLIT
public static final int HORIZONTAL_SPLIT = 0VERTICAL_SPLIT
public static final int VERTICAL_SPLIT = 1Constructor details
SplitPane
public SplitPane(SplitPane.Settings settings, Component topOrLeft, Component bottomOrRight)Parameters
settingsSplitPane.Settings- The settings for the split pane (e.g. insets, styles, etc…).
topOrLeftComponent- The component to place in the “top” (for vertical), or “left” (for horizontal).
bottomOrRightComponent- The component to place in the “bottom” (for vertical) or “right” (for horizontal).
SplitPane
public SplitPane(int orientation, Component topOrLeft, Component bottomOrRight, String minInset, String preferredInset, String maxInset)Parameters
orientationint- Either
#HORIZONTAL_SPLITor#VERTICAL_SPLIT topOrLeftComponent- The component to place in the “top” (for vertical), or “left” (for horizontal).
bottomOrRightComponent- The component to place in the “bottom” (for vertical) or “right” (for horizontal).
minInsetString- The minimum allowable inset for the divider. The inset should be expressed as a string with both a value and a unit. E.g. “75%”, “50mm”, “200px”.
preferredInsetString- The default preferred inset for the divider. The inset should be expressed as a string with both value and unit. E.g. “75%”, “50mm”, “20px”.
maxInsetString- The maximum allowable inset for the divider. The inset should be expressed as a string with both a value and a unit. E.g. “75%”, “50mm”, “20px”.
Method details
changeInsets
public void changeInsets(String minInset, String preferredInset, String maxInset)Parameters
minInsetString- The minimum inset. Can be expressed in pixels (px), millimetres (mm), or percent (%). E.g. “25%”
preferredInsetString- The preferred inset. Can be expressed in pixels (px), millimetres (mm), or percent (%). E.g. “25%”
maxInsetString- Can be expressed in pixels (px), millimetres (mm), or percent (%). E.g. “25%”
getBottomOrRightComponent
public Component getBottomOrRightComponent()getBottom
public Component getBottom()setBottom
public void setBottom(Component cmp)Parameters
cmpComponent- The component to place on the bottom.
getRight
public Component getRight()setRight
public void setRight(Component cmp)Parameters
cmpComponent- The component to place on the right.
getTopOrLeftComponent
public Component getTopOrLeftComponent()getTop
public Component getTop()setTop
public void setTop(Component cmp)Parameters
cmpComponent- The component to place on top.
getLeft
public Component getLeft()setLeft
public void setLeft(Component cmp)Parameters
cmpComponent- The component to place on the left.
toggleCollapsePreferred
public void toggleCollapsePreferred()toggleExpandPreferred
public void toggleExpandPreferred()expand
public void expand()expand
public void expand(boolean force)Parameters
forceboolean- If this is true, then it will only expand “all the way”. It will skip the preferred position if it is currently in collapsed state.
collapse
public void collapse()collapse
public void collapse(boolean force)Parameters
forceboolean- True to force it to collapse to minimum position (skipping preferred position if it is in expanded state).
setInset
public void setInset(String inset, boolean clamp)Parameters
insetString- Not documented.
clampboolean- True to clamp the inset to prevent it from running off the page.
setInset
public void setInset(String inset)getPreferredInset
public String getPreferredInset()Returns
setPreferredInset
public void setPreferredInset(String inset)Parameters
insetString- The inset. E.g. “2mm”, “25%”, “200px”.
getMinInset
public String getMinInset()setMinInset
public void setMinInset(String inset)Parameters
insetString- The inset. E.g. “2mm”, “10%”, “200px”
getMaxInset
public String getMaxInset()setMaxInset
public void setMaxInset(String inset)Parameters
insetString- The inset. E.g. “2mm”, “10%”, “200px”