- java.lang.Object
- 
- javax.swing.plaf.ComponentUI
- 
- javax.swing.plaf.SplitPaneUI
- 
- javax.swing.plaf.basic.BasicSplitPaneUI
 
 
 
- 
- Direct Known Subclasses:
- MetalSplitPaneUI,- SynthSplitPaneUI
 
 public class BasicSplitPaneUI extends SplitPaneUI A Basic L&F implementation of the SplitPaneUI.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classBasicSplitPaneUI.BasicHorizontalLayoutManagerLayoutManager for JSplitPanes that have an orientation of HORIZONTAL_SPLIT.classBasicSplitPaneUI.BasicVerticalLayoutManagerLayoutManager used for JSplitPanes with an orientation of VERTICAL_SPLIT.classBasicSplitPaneUI.FocusHandlerImplementation of the FocusListener that the JSplitPane UI uses.classBasicSplitPaneUI.KeyboardDownRightHandlerImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classBasicSplitPaneUI.KeyboardEndHandlerImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classBasicSplitPaneUI.KeyboardHomeHandlerImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classBasicSplitPaneUI.KeyboardResizeToggleHandlerImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classBasicSplitPaneUI.KeyboardUpLeftHandlerImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classBasicSplitPaneUI.PropertyHandlerImplementation of the PropertyChangeListener that the JSplitPane UI uses.
 - 
Field SummaryFields Modifier and Type Field Description protected intbeginDragDividerLocationLocation of the divider when the dragging session began.protected BasicSplitPaneDividerdividerInstance of the divider for this JSplitPane.protected KeyStrokedividerResizeToggleKeyDeprecated.As of Java 2 platform v1.3.protected intdividerSizeThe size of the divider while the dragging session is valid.protected KeyStrokedownKeyDeprecated.As of Java 2 platform v1.3.protected booleandraggingHWSet to true in startDragging if any of the children (not including the nonContinuousLayoutDivider) are heavy weights.protected KeyStrokeendKeyDeprecated.As of Java 2 platform v1.3.protected FocusListenerfocusListenerInstance of the FocusListener for this JSplitPane.protected KeyStrokehomeKeyDeprecated.As of Java 2 platform v1.3.protected static intKEYBOARD_DIVIDER_MOVE_OFFSETHow far (relative) the divider does move when it is moved around by the cursor keys on the keyboard.protected ActionListenerkeyboardDownRightListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerkeyboardEndListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerkeyboardHomeListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerkeyboardResizeToggleListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerkeyboardUpLeftListenerDeprecated.As of Java 2 platform v1.3.protected BasicSplitPaneUI.BasicHorizontalLayoutManagerlayoutManagerLayoutManager that is created and placed into the split pane.protected KeyStrokeleftKeyDeprecated.As of Java 2 platform v1.3.protected static StringNON_CONTINUOUS_DIVIDERThe divider used for non-continuous layout is added to the split pane with this object.protected ComponentnonContinuousLayoutDividerInstance for the shadow of the divider when non continuous layout is being used.protected PropertyChangeListenerpropertyChangeListenerInstance of the PropertyChangeListener for this JSplitPane.protected KeyStrokerightKeyDeprecated.As of Java 2 platform v1.3.protected JSplitPanesplitPaneJSplitPane instance this instance is providing the look and feel for.protected KeyStrokeupKeyDeprecated.As of Java 2 platform v1.3.
 - 
Constructor SummaryConstructors Constructor Description BasicSplitPaneUI()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BasicSplitPaneDividercreateDefaultDivider()Creates the default divider.protected ComponentcreateDefaultNonContinuousLayoutDivider()Returns the default non continuous layout divider, which is an instance ofCanvasthat fills in the background with dark gray.protected FocusListenercreateFocusListener()Creates aFocusListenerfor theJSplitPaneUI.protected ActionListenercreateKeyboardDownRightListener()Deprecated.As of Java 2 platform v1.3.protected ActionListenercreateKeyboardEndListener()Deprecated.As of Java 2 platform v1.3.protected ActionListenercreateKeyboardHomeListener()Deprecated.As of Java 2 platform v1.3.protected ActionListenercreateKeyboardResizeToggleListener()Deprecated.As of Java 2 platform v1.3.protected ActionListenercreateKeyboardUpLeftListener()Deprecated.As of Java 2 platform v1.3.protected PropertyChangeListenercreatePropertyChangeListener()Creates aPropertyChangeListenerfor theJSplitPaneUI.static ComponentUIcreateUI(JComponent x)Creates a new instance ofBasicSplitPaneUI.protected voiddragDividerTo(int location)Messaged during a dragging session to move the divider to the passed inlocation.protected voidfinishDraggingTo(int location)Messaged to finish the dragging session.voidfinishedPaintingChildren(JSplitPane sp, Graphics g)Called when the specified split pane has finished painting its children.BasicSplitPaneDividergetDivider()Returns the divider between the top Components.protected intgetDividerBorderSize()Deprecated.As of Java 2 platform v1.3, instead set the border on the divider.intgetDividerLocation(JSplitPane jc)Returns the location of the divider, which may differ from what the splitpane thinks the location of the divider is.InsetsgetInsets(JComponent jc)Returns the insets.intgetLastDragLocation()Returns the last drag location of theJSplitPane.intgetMaximumDividerLocation(JSplitPane jc)Gets the maximum location of the divider.DimensiongetMaximumSize(JComponent jc)Returns the maximum size for the passed in component, This is passed off to the current layout manager.intgetMinimumDividerLocation(JSplitPane jc)Gets the minimum location of the divider.DimensiongetMinimumSize(JComponent jc)Returns the minimum size for the passed in component, This is passed off to the current layout manager.ComponentgetNonContinuousLayoutDivider()Returns the divider to use when theJSplitPaneis configured to not continuously layout.intgetOrientation()Returns the orientation for theJSplitPane.DimensiongetPreferredSize(JComponent jc)Returns the preferred size for the passed in component, This is passed off to the current layout manager.JSplitPanegetSplitPane()Returns theJSplitPanethis instance is currently contained in.protected voidinstallDefaults()Installs the UI defaults.protected voidinstallKeyboardActions()Installs the keyboard actions for the UI.protected voidinstallListeners()Installs the event listeners for the UI.voidinstallUI(JComponent c)Installs the UI.booleanisContinuousLayout()Determines whether theJSplitPaneis set to use a continuous layout.protected voidresetLayoutManager()Resets the layout manager based on orientation and messages it with invalidateLayout to pull in appropriate Components.voidresetToPreferredSizes(JSplitPane jc)Messaged to reset the preferred sizes.voidsetContinuousLayout(boolean b)Turn continuous layout on/off.voidsetDividerLocation(JSplitPane jc, int location)Sets the location of the divider to location.voidsetLastDragLocation(int l)Set the last drag location of theJSplitPane.protected voidsetNonContinuousLayoutDivider(Component newDivider)Sets the divider to use when theJSplitPaneis configured to not continuously layout.protected voidsetNonContinuousLayoutDivider(Component newDivider, boolean rememberSizes)Sets the divider to use.voidsetOrientation(int orientation)Set the orientation for theJSplitPane.protected voidstartDragging()Should be messaged before the dragging session starts, resets lastDragLocation and dividerSize.protected voiduninstallDefaults()Uninstalls the UI defaults.protected voiduninstallKeyboardActions()Uninstalls the keyboard actions for the UI.protected voiduninstallListeners()Uninstalls the event listeners for the UI.voiduninstallUI(JComponent c)Uninstalls the UI.- 
Methods declared in class javax.swing.plaf.ComponentUIcontains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
 
- 
 
- 
- 
- 
Field Detail- 
NON_CONTINUOUS_DIVIDERprotected static final String NON_CONTINUOUS_DIVIDER The divider used for non-continuous layout is added to the split pane with this object.- See Also:
- Constant Field Values
 
 - 
KEYBOARD_DIVIDER_MOVE_OFFSETprotected static int KEYBOARD_DIVIDER_MOVE_OFFSET How far (relative) the divider does move when it is moved around by the cursor keys on the keyboard.
 - 
splitPaneprotected JSplitPane splitPane JSplitPane instance this instance is providing the look and feel for.
 - 
layoutManagerprotected BasicSplitPaneUI.BasicHorizontalLayoutManager layoutManager LayoutManager that is created and placed into the split pane.
 - 
dividerprotected BasicSplitPaneDivider divider Instance of the divider for this JSplitPane.
 - 
propertyChangeListenerprotected PropertyChangeListener propertyChangeListener Instance of the PropertyChangeListener for this JSplitPane.
 - 
focusListenerprotected FocusListener focusListener Instance of the FocusListener for this JSplitPane.
 - 
dividerSizeprotected int dividerSize The size of the divider while the dragging session is valid.
 - 
nonContinuousLayoutDividerprotected Component nonContinuousLayoutDivider Instance for the shadow of the divider when non continuous layout is being used.
 - 
draggingHWprotected boolean draggingHW Set to true in startDragging if any of the children (not including the nonContinuousLayoutDivider) are heavy weights.
 - 
beginDragDividerLocationprotected int beginDragDividerLocation Location of the divider when the dragging session began.
 - 
upKey@Deprecated protected KeyStroke upKey Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
downKey@Deprecated protected KeyStroke downKey Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
leftKey@Deprecated protected KeyStroke leftKey Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
rightKey@Deprecated protected KeyStroke rightKey Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
homeKey@Deprecated protected KeyStroke homeKey Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
endKey@Deprecated protected KeyStroke endKey Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
dividerResizeToggleKey@Deprecated protected KeyStroke dividerResizeToggleKey Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
keyboardUpLeftListener@Deprecated protected ActionListener keyboardUpLeftListener Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
keyboardDownRightListener@Deprecated protected ActionListener keyboardDownRightListener Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
keyboardHomeListener@Deprecated protected ActionListener keyboardHomeListener Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
keyboardEndListener@Deprecated protected ActionListener keyboardEndListener Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 - 
keyboardResizeToggleListener@Deprecated protected ActionListener keyboardResizeToggleListener Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
 
- 
 - 
Method Detail- 
createUIpublic static ComponentUI createUI(JComponent x) Creates a new instance ofBasicSplitPaneUI.- Parameters:
- x- a component
- Returns:
- a new instance of BasicSplitPaneUI
 
 - 
installUIpublic void installUI(JComponent c) Installs the UI.- Overrides:
- installUIin class- ComponentUI
- Parameters:
- c- the component where this UI delegate is being installed
- See Also:
- ComponentUI.uninstallUI(javax.swing.JComponent),- JComponent.setUI(javax.swing.plaf.ComponentUI),- JComponent.updateUI()
 
 - 
installDefaultsprotected void installDefaults() Installs the UI defaults.
 - 
installListenersprotected void installListeners() Installs the event listeners for the UI.
 - 
installKeyboardActionsprotected void installKeyboardActions() Installs the keyboard actions for the UI.
 - 
uninstallUIpublic void uninstallUI(JComponent c) Uninstalls the UI.- Overrides:
- uninstallUIin class- ComponentUI
- Parameters:
- c- the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
- See Also:
- ComponentUI.installUI(javax.swing.JComponent),- JComponent.updateUI()
 
 - 
uninstallDefaultsprotected void uninstallDefaults() Uninstalls the UI defaults.
 - 
uninstallListenersprotected void uninstallListeners() Uninstalls the event listeners for the UI.
 - 
uninstallKeyboardActionsprotected void uninstallKeyboardActions() Uninstalls the keyboard actions for the UI.
 - 
createPropertyChangeListenerprotected PropertyChangeListener createPropertyChangeListener() Creates aPropertyChangeListenerfor theJSplitPaneUI.- Returns:
- an instance of PropertyChangeListener
 
 - 
createFocusListenerprotected FocusListener createFocusListener() Creates aFocusListenerfor theJSplitPaneUI.- Returns:
- an instance of FocusListener
 
 - 
createKeyboardUpLeftListener@Deprecated protected ActionListener createKeyboardUpLeftListener() Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create anActionwrapping theActionListener, and register thatActionby overridinginstallKeyboardActionsand placing theActionin theSplitPane's ActionMap. Please refer to the key bindings specification for further details.Creates an ActionListenerfor theJSplitPaneUI that listens for specific key presses.- Returns:
- an instance of ActionListener
 
 - 
createKeyboardDownRightListener@Deprecated protected ActionListener createKeyboardDownRightListener() Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create anActionwrapping theActionListener, and register thatActionby overridinginstallKeyboardActionsand placing theActionin theSplitPane's ActionMap. Please refer to the key bindings specification for further details.Creates an ActionListenerfor theJSplitPaneUI that listens for specific key presses.- Returns:
- an instance of ActionListener
 
 - 
createKeyboardHomeListener@Deprecated protected ActionListener createKeyboardHomeListener() Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create anActionwrapping theActionListener, and register thatActionby overridinginstallKeyboardActionsand placing theActionin theSplitPane's ActionMap. Please refer to the key bindings specification for further details.Creates an ActionListenerfor theJSplitPaneUI that listens for specific key presses.- Returns:
- an instance of ActionListener
 
 - 
createKeyboardEndListener@Deprecated protected ActionListener createKeyboardEndListener() Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create anActionwrapping theActionListener, and register thatActionby overridinginstallKeyboardActionsand placing theActionin theSplitPane's ActionMap. Please refer to the key bindings specification for further details.Creates an ActionListenerfor theJSplitPaneUI that listens for specific key presses.- Returns:
- an instance of ActionListener
 
 - 
createKeyboardResizeToggleListener@Deprecated protected ActionListener createKeyboardResizeToggleListener() Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create anActionwrapping theActionListener, and register thatActionby overridinginstallKeyboardActionsand placing theActionin theSplitPane's ActionMap. Please refer to the key bindings specification for further details.Creates an ActionListenerfor theJSplitPaneUI that listens for specific key presses.- Returns:
- an instance of ActionListener
 
 - 
getOrientationpublic int getOrientation() Returns the orientation for theJSplitPane.- Returns:
- the orientation
 
 - 
setOrientationpublic void setOrientation(int orientation) Set the orientation for theJSplitPane.- Parameters:
- orientation- the orientation
 
 - 
isContinuousLayoutpublic boolean isContinuousLayout() Determines whether theJSplitPaneis set to use a continuous layout.- Returns:
- trueif a continuous layout is set
 
 - 
setContinuousLayoutpublic void setContinuousLayout(boolean b) Turn continuous layout on/off.- Parameters:
- b- if- truethe continuous layout turns on
 
 - 
getLastDragLocationpublic int getLastDragLocation() Returns the last drag location of theJSplitPane.- Returns:
- the last drag location
 
 - 
setLastDragLocationpublic void setLastDragLocation(int l) Set the last drag location of theJSplitPane.- Parameters:
- l- the drag location
 
 - 
getDividerpublic BasicSplitPaneDivider getDivider() Returns the divider between the top Components.- Returns:
- the divider between the top Components
 
 - 
createDefaultNonContinuousLayoutDividerprotected Component createDefaultNonContinuousLayoutDivider() Returns the default non continuous layout divider, which is an instance ofCanvasthat fills in the background with dark gray.- Returns:
- the default non continuous layout divider
 
 - 
setNonContinuousLayoutDividerprotected void setNonContinuousLayoutDivider(Component newDivider) Sets the divider to use when theJSplitPaneis configured to not continuously layout. This divider will only be used during a dragging session. It is recommended that the passed in component be a heavy weight.- Parameters:
- newDivider- the new divider
 
 - 
setNonContinuousLayoutDividerprotected void setNonContinuousLayoutDivider(Component newDivider, boolean rememberSizes) Sets the divider to use.- Parameters:
- newDivider- the new divider
- rememberSizes- if- truethe pane size is remembered
 
 - 
getNonContinuousLayoutDividerpublic Component getNonContinuousLayoutDivider() Returns the divider to use when theJSplitPaneis configured to not continuously layout. This divider will only be used during a dragging session.- Returns:
- the divider
 
 - 
getSplitPanepublic JSplitPane getSplitPane() Returns theJSplitPanethis instance is currently contained in.- Returns:
- the instance of JSplitPane
 
 - 
createDefaultDividerpublic BasicSplitPaneDivider createDefaultDivider() Creates the default divider.- Returns:
- the default divider
 
 - 
resetToPreferredSizespublic void resetToPreferredSizes(JSplitPane jc) Messaged to reset the preferred sizes.- Specified by:
- resetToPreferredSizesin class- SplitPaneUI
- Parameters:
- jc- a- JSplitPane
 
 - 
setDividerLocationpublic void setDividerLocation(JSplitPane jc, int location) Sets the location of the divider to location.- Specified by:
- setDividerLocationin class- SplitPaneUI
- Parameters:
- jc- a- JSplitPane
- location- an integer specifying the location of the divider
 
 - 
getDividerLocationpublic int getDividerLocation(JSplitPane jc) Returns the location of the divider, which may differ from what the splitpane thinks the location of the divider is.- Specified by:
- getDividerLocationin class- SplitPaneUI
- Parameters:
- jc- a- JSplitPane
- Returns:
- an integer specifying the location of the divider
 
 - 
getMinimumDividerLocationpublic int getMinimumDividerLocation(JSplitPane jc) Gets the minimum location of the divider.- Specified by:
- getMinimumDividerLocationin class- SplitPaneUI
- Parameters:
- jc- a- JSplitPane
- Returns:
- and integer specifying the minimum location of the divider
 
 - 
getMaximumDividerLocationpublic int getMaximumDividerLocation(JSplitPane jc) Gets the maximum location of the divider.- Specified by:
- getMaximumDividerLocationin class- SplitPaneUI
- Parameters:
- jc- a- JSplitPane
- Returns:
- an integer specifying the maximum location of the divider
 
 - 
finishedPaintingChildrenpublic void finishedPaintingChildren(JSplitPane sp, Graphics g) Called when the specified split pane has finished painting its children.- Specified by:
- finishedPaintingChildrenin class- SplitPaneUI
- Parameters:
- sp- a- JSplitPane
- g- the- Graphicscontext
 
 - 
getPreferredSizepublic Dimension getPreferredSize(JComponent jc) Returns the preferred size for the passed in component, This is passed off to the current layout manager.- Overrides:
- getPreferredSizein class- ComponentUI
- Parameters:
- jc- the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
- Returns:
- a Dimensionobject containing given component's preferred size appropriate for the look and feel
- See Also:
- JComponent.getPreferredSize(),- LayoutManager.preferredLayoutSize(java.awt.Container)
 
 - 
getMinimumSizepublic Dimension getMinimumSize(JComponent jc) Returns the minimum size for the passed in component, This is passed off to the current layout manager.- Overrides:
- getMinimumSizein class- ComponentUI
- Parameters:
- jc- the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
- Returns:
- a Dimensionobject ornull
- See Also:
- JComponent.getMinimumSize(),- LayoutManager.minimumLayoutSize(java.awt.Container),- ComponentUI.getPreferredSize(javax.swing.JComponent)
 
 - 
getMaximumSizepublic Dimension getMaximumSize(JComponent jc) Returns the maximum size for the passed in component, This is passed off to the current layout manager.- Overrides:
- getMaximumSizein class- ComponentUI
- Parameters:
- jc- the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
- Returns:
- a Dimensionobject ornull
- See Also:
- JComponent.getMaximumSize(),- LayoutManager2.maximumLayoutSize(java.awt.Container)
 
 - 
getInsetspublic Insets getInsets(JComponent jc) Returns the insets. The insets are returned from the border insets of the current border.- Parameters:
- jc- a component
- Returns:
- the insets
 
 - 
resetLayoutManagerprotected void resetLayoutManager() Resets the layout manager based on orientation and messages it with invalidateLayout to pull in appropriate Components.
 - 
startDraggingprotected void startDragging() Should be messaged before the dragging session starts, resets lastDragLocation and dividerSize.
 - 
dragDividerToprotected void dragDividerTo(int location) Messaged during a dragging session to move the divider to the passed inlocation. IfcontinuousLayoutistruethe location is reset and the splitPane validated.- Parameters:
- location- the location of divider
 
 - 
finishDraggingToprotected void finishDraggingTo(int location) Messaged to finish the dragging session. If not continuous display the dividerslocationwill be reset.- Parameters:
- location- the location of divider
 
 - 
getDividerBorderSize@Deprecated protected int getDividerBorderSize() Deprecated.As of Java 2 platform v1.3, instead set the border on the divider.As of Java 2 platform v1.3 this method is no longer used. Instead you should set the border on the divider.Returns the width of one side of the divider border. - Returns:
- the width of one side of the divider border
 
 
- 
 
-