java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.SplitPaneUI
javax.swing.plaf.basic.BasicSplitPaneUI
- Direct Known Subclasses:
MetalSplitPaneUI,SynthSplitPaneUI
A Basic L&F implementation of the SplitPaneUI.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassLayoutManager for JSplitPanes that have an orientation of HORIZONTAL_SPLIT.classLayoutManager used for JSplitPanes with an orientation of VERTICAL_SPLIT.classImplementation of the FocusListener that the JSplitPane UI uses.classImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classImplementation of an ActionListener that the JSplitPane UI uses for handling specific key presses.classImplementation of the PropertyChangeListener that the JSplitPane UI uses. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intLocation of the divider when the dragging session began.protected BasicSplitPaneDividerInstance of the divider for this JSplitPane.protected KeyStrokeDeprecated.As of Java 2 platform v1.3.protected intThe size of the divider while the dragging session is valid.protected KeyStrokeDeprecated.As of Java 2 platform v1.3.protected booleanSet to true in startDragging if any of the children (not including the nonContinuousLayoutDivider) are heavy weights.protected KeyStrokeDeprecated.As of Java 2 platform v1.3.protected FocusListenerInstance of the FocusListener for this JSplitPane.protected KeyStrokeDeprecated.As of Java 2 platform v1.3.protected static intHow far (relative) the divider does move when it is moved around by the cursor keys on the keyboard.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerDeprecated.As of Java 2 platform v1.3.LayoutManager that is created and placed into the split pane.protected KeyStrokeDeprecated.As of Java 2 platform v1.3.protected static final StringThe divider used for non-continuous layout is added to the split pane with this object.protected ComponentInstance for the shadow of the divider when non continuous layout is being used.protected PropertyChangeListenerInstance of the PropertyChangeListener for this JSplitPane.protected KeyStrokeDeprecated.As of Java 2 platform v1.3.protected JSplitPaneJSplitPane instance this instance is providing the look and feel for.protected KeyStrokeDeprecated.As of Java 2 platform v1.3. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates the default divider.protected ComponentReturns the default non continuous layout divider, which is an instance ofCanvasthat fills in the background with dark gray.protected FocusListenerCreates aFocusListenerfor theJSplitPaneUI.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected ActionListenerDeprecated.As of Java 2 platform v1.3.protected PropertyChangeListenerCreates aPropertyChangeListenerfor theJSplitPaneUI.static ComponentUICreates 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.voidCalled when the specified split pane has finished painting its children.Returns the divider between the top Components.protected intDeprecated.As of Java 2 platform v1.3, instead set the border on the divider.intReturns the location of the divider, which may differ from what the splitpane thinks the location of the divider is.getInsets(JComponent jc) Returns the insets.intReturns the last drag location of theJSplitPane.intGets the maximum location of the divider.Returns the maximum size for the passed in component, This is passed off to the current layout manager.intGets the minimum location of the divider.Returns the minimum size for the passed in component, This is passed off to the current layout manager.Returns the divider to use when theJSplitPaneis configured to not continuously layout.intReturns the orientation for theJSplitPane.Returns the preferred size for the passed in component, This is passed off to the current layout manager.Returns theJSplitPanethis instance is currently contained in.protected voidInstalls the UI defaults.protected voidInstalls the keyboard actions for the UI.protected voidInstalls the event listeners for the UI.voidInstalls the UI.booleanDetermines whether theJSplitPaneis set to use a continuous layout.protected voidResets the layout manager based on orientation and messages it with invalidateLayout to pull in appropriate Components.voidMessaged 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 voidShould be messaged before the dragging session starts, resets lastDragLocation and dividerSize.protected voidUninstalls the UI defaults.protected voidUninstalls the keyboard actions for the UI.protected voidUninstalls the event listeners for the UI.voidUninstalls the UI.Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
-
Field Details
-
NON_CONTINUOUS_DIVIDER
The divider used for non-continuous layout is added to the split pane with this object.- See Also:
-
KEYBOARD_DIVIDER_MOVE_OFFSET
protected static int KEYBOARD_DIVIDER_MOVE_OFFSETHow far (relative) the divider does move when it is moved around by the cursor keys on the keyboard. -
splitPane
JSplitPane instance this instance is providing the look and feel for. -
layoutManager
LayoutManager that is created and placed into the split pane. -
divider
Instance of the divider for this JSplitPane. -
propertyChangeListener
Instance of the PropertyChangeListener for this JSplitPane. -
focusListener
Instance of the FocusListener for this JSplitPane. -
dividerSize
protected int dividerSizeThe size of the divider while the dragging session is valid. -
nonContinuousLayoutDivider
Instance for the shadow of the divider when non continuous layout is being used. -
draggingHW
protected boolean draggingHWSet to true in startDragging if any of the children (not including the nonContinuousLayoutDivider) are heavy weights. -
beginDragDividerLocation
protected int beginDragDividerLocationLocation of the divider when the dragging session began. -
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.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.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.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.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.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.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.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.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.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.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.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.
-
-
Constructor Details
-
BasicSplitPaneUI
public BasicSplitPaneUI()Constructs aBasicSplitPaneUI.
-
-
Method Details
-
createUI
Creates a new instance ofBasicSplitPaneUI.- Parameters:
x- a component- Returns:
- a new instance of
BasicSplitPaneUI
-
installUI
Installs the UI.- Overrides:
installUIin classComponentUI- Parameters:
c- the component where this UI delegate is being installed- See Also:
-
installDefaults
protected void installDefaults()Installs the UI defaults. -
installListeners
protected void installListeners()Installs the event listeners for the UI. -
installKeyboardActions
protected void installKeyboardActions()Installs the keyboard actions for the UI. -
uninstallUI
Uninstalls the UI.- Overrides:
uninstallUIin classComponentUI- 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:
-
uninstallDefaults
protected void uninstallDefaults()Uninstalls the UI defaults. -
uninstallListeners
protected void uninstallListeners()Uninstalls the event listeners for the UI. -
uninstallKeyboardActions
protected void uninstallKeyboardActions()Uninstalls the keyboard actions for the UI. -
createPropertyChangeListener
Creates aPropertyChangeListenerfor theJSplitPaneUI.- Returns:
- an instance of
PropertyChangeListener
-
createFocusListener
Creates aFocusListenerfor theJSplitPaneUI.- Returns:
- an instance of
FocusListener
-
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.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.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.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.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
-
getOrientation
public int getOrientation()Returns the orientation for theJSplitPane.- Returns:
- the orientation
-
setOrientation
public void setOrientation(int orientation) Set the orientation for theJSplitPane.- Parameters:
orientation- the orientation
-
isContinuousLayout
public boolean isContinuousLayout()Determines whether theJSplitPaneis set to use a continuous layout.- Returns:
trueif a continuous layout is set
-
setContinuousLayout
public void setContinuousLayout(boolean b) Turn continuous layout on/off.- Parameters:
b- iftruethe continuous layout turns on
-
getLastDragLocation
public int getLastDragLocation()Returns the last drag location of theJSplitPane.- Returns:
- the last drag location
-
setLastDragLocation
public void setLastDragLocation(int l) Set the last drag location of theJSplitPane.- Parameters:
l- the drag location
-
getDivider
Returns the divider between the top Components.- Returns:
- the divider between the top Components
-
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
-
setNonContinuousLayoutDivider
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
-
setNonContinuousLayoutDivider
Sets the divider to use.- Parameters:
newDivider- the new dividerrememberSizes- iftruethe pane size is remembered
-
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
-
getSplitPane
Returns theJSplitPanethis instance is currently contained in.- Returns:
- the instance of
JSplitPane
-
createDefaultDivider
Creates the default divider.- Returns:
- the default divider
-
resetToPreferredSizes
Messaged to reset the preferred sizes.- Specified by:
resetToPreferredSizesin classSplitPaneUI- Parameters:
jc- aJSplitPane
-
setDividerLocation
Sets the location of the divider to location.- Specified by:
setDividerLocationin classSplitPaneUI- Parameters:
jc- aJSplitPanelocation- an integer specifying the location of the divider
-
getDividerLocation
Returns the location of the divider, which may differ from what the splitpane thinks the location of the divider is.- Specified by:
getDividerLocationin classSplitPaneUI- Parameters:
jc- aJSplitPane- Returns:
- an integer specifying the location of the divider
-
getMinimumDividerLocation
Gets the minimum location of the divider.- Specified by:
getMinimumDividerLocationin classSplitPaneUI- Parameters:
jc- aJSplitPane- Returns:
- and integer specifying the minimum location of the divider
-
getMaximumDividerLocation
Gets the maximum location of the divider.- Specified by:
getMaximumDividerLocationin classSplitPaneUI- Parameters:
jc- aJSplitPane- Returns:
- an integer specifying the maximum location of the divider
-
finishedPaintingChildren
Called when the specified split pane has finished painting its children.- Specified by:
finishedPaintingChildrenin classSplitPaneUI- Parameters:
sp- aJSplitPaneg- theGraphicscontext
-
getPreferredSize
Returns the preferred size for the passed in component, This is passed off to the current layout manager.- Overrides:
getPreferredSizein classComponentUI- 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:
-
getMinimumSize
Returns the minimum size for the passed in component, This is passed off to the current layout manager.- Overrides:
getMinimumSizein classComponentUI- 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:
-
getMaximumSize
Returns the maximum size for the passed in component, This is passed off to the current layout manager.- Overrides:
getMaximumSizein classComponentUI- 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:
-
getInsets
Returns the insets. The insets are returned from the border insets of the current border.- Parameters:
jc- a component- Returns:
- the insets
-
resetLayoutManager
protected void resetLayoutManager()Resets the layout manager based on orientation and messages it with invalidateLayout to pull in appropriate Components. -
startDragging
protected void startDragging()Should be messaged before the dragging session starts, resets lastDragLocation and dividerSize. -
dragDividerTo
protected 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
-
finishDraggingTo
protected 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.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
-