Class ComponentDividerSplitPaneUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.SplitPaneUI
javax.swing.plaf.basic.BasicSplitPaneUI
com.inductiveautomation.ignition.designer.gui.ComponentDividerSplitPaneUI
A
BasicSplitPaneUI that embeds an arbitrary component inside the split-pane divider and
keeps drag feedback visually aligned with that component.
The standard Swing divider is a plain strip. This UI replaces it with a ComponentDivider that centers component within the strip. Because the divider is wider
than usual, several overrides correct the drag-overlay size and position so the ghost rectangle
tracks the center of the component rather than the edge of the strip.
Use the static install(JSplitPane, JComponent) factory to attach this UI to a split
pane.
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicSplitPaneUI
BasicSplitPaneUI.BasicHorizontalLayoutManager, BasicSplitPaneUI.BasicVerticalLayoutManager, BasicSplitPaneUI.FocusHandler, BasicSplitPaneUI.KeyboardDownRightHandler, BasicSplitPaneUI.KeyboardEndHandler, BasicSplitPaneUI.KeyboardHomeHandler, BasicSplitPaneUI.KeyboardResizeToggleHandler, BasicSplitPaneUI.KeyboardUpLeftHandler, BasicSplitPaneUI.PropertyHandler -
Field Summary
Fields inherited from class BasicSplitPaneUI
beginDragDividerLocation, divider, dividerResizeToggleKey, dividerSize, downKey, draggingHW, endKey, focusListener, homeKey, KEYBOARD_DIVIDER_MOVE_OFFSET, keyboardDownRightListener, keyboardEndListener, keyboardHomeListener, keyboardResizeToggleListener, keyboardUpLeftListener, layoutManager, leftKey, NON_CONTINUOUS_DIVIDER, nonContinuousLayoutDivider, propertyChangeListener, rightKey, splitPane, upKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinishDraggingTo(int location) Resets the drag flag after the super call repositions the divider.intShifts the reported drag position right by half the component width during a drag.static voidinstall(JSplitPane splitPane, JComponent component) Attaches this UI tosplitPaneand disables the built-in one-touch expand arrows, since the embeddedcomponentserves as the collapse control.protected voidTemporarily injects a semi-transparent tint ofColors.Primaryas the drag-overlay color before delegating to super, then immediately restores the original value.protected voidNarrowsdividerSizetoComponentDivider.PADDINGwhile dragging so the ghost overlay is a thin strip.Methods inherited from class BasicSplitPaneUI
createDefaultNonContinuousLayoutDivider, createFocusListener, createKeyboardDownRightListener, createKeyboardEndListener, createKeyboardHomeListener, createKeyboardResizeToggleListener, createKeyboardUpLeftListener, createPropertyChangeListener, createUI, dragDividerTo, finishedPaintingChildren, getDivider, getDividerBorderSize, getDividerLocation, getInsets, getMaximumDividerLocation, getMaximumSize, getMinimumDividerLocation, getMinimumSize, getNonContinuousLayoutDivider, getOrientation, getPreferredSize, getSplitPane, installKeyboardActions, installListeners, installUI, isContinuousLayout, paint, resetLayoutManager, resetToPreferredSizes, setContinuousLayout, setDividerLocation, setLastDragLocation, setNonContinuousLayoutDivider, setNonContinuousLayoutDivider, setOrientation, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUIMethods inherited from class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, update
-
Constructor Details
-
ComponentDividerSplitPaneUI
- Parameters:
component- the component to embed in the divider
-
-
Method Details
-
createDefaultDivider
- Overrides:
createDefaultDividerin classBasicSplitPaneUI
-
installDefaults
protected void installDefaults()Temporarily injects a semi-transparent tint ofColors.Primaryas the drag-overlay color before delegating to super, then immediately restores the original value.- Overrides:
installDefaultsin classBasicSplitPaneUI
-
startDragging
protected void startDragging()NarrowsdividerSizetoComponentDivider.PADDINGwhile dragging so the ghost overlay is a thin strip. Paired with the centering offset ingetLastDragLocation(), this keeps the ghost visually centred on the embedded component.- Overrides:
startDraggingin classBasicSplitPaneUI
-
finishDraggingTo
protected void finishDraggingTo(int location) Resets the drag flag after the super call repositions the divider.- Overrides:
finishDraggingToin classBasicSplitPaneUI
-
getLastDragLocation
public int getLastDragLocation()Shifts the reported drag position right by half the component width during a drag. The divider is wider than a standard one, so without this offset the ghost rectangle would track the left edge of the strip rather than the visual center of the embedded component.- Overrides:
getLastDragLocationin classBasicSplitPaneUI
-
install
Attaches this UI tosplitPaneand disables the built-in one-touch expand arrows, since the embeddedcomponentserves as the collapse control.
-