Class BasicSplitPaneUI
- Direct Known Subclasses:
-
MetalSplitPaneUI
,SynthSplitPaneUI
public class BasicSplitPaneUI extends SplitPaneUI
Nested Class Summary
Modifier and Type | Class | Description |
---|---|---|
class |
BasicSplitPaneUI.BasicHorizontalLayoutManager |
LayoutManager for JSplitPanes that have an orientation of HORIZONTAL_SPLIT. |
class |
BasicSplitPaneUI.BasicVerticalLayoutManager |
LayoutManager used for JSplitPanes with an orientation of VERTICAL_SPLIT. |
class |
BasicSplitPaneUI.FocusHandler |
Implementation of the FocusListener that the JSplitPane UI uses. |
class |
BasicSplitPaneUI.KeyboardDownRightHandler |
Implementation of an ActionListener that the JSplitPane UI uses for handling specific key presses. |
class |
BasicSplitPaneUI.KeyboardEndHandler |
Implementation of an ActionListener that the JSplitPane UI uses for handling specific key presses. |
class |
BasicSplitPaneUI.KeyboardHomeHandler |
Implementation of an ActionListener that the JSplitPane UI uses for handling specific key presses. |
class |
BasicSplitPaneUI.KeyboardResizeToggleHandler |
Implementation of an ActionListener that the JSplitPane UI uses for handling specific key presses. |
class |
BasicSplitPaneUI.KeyboardUpLeftHandler |
Implementation of an ActionListener that the JSplitPane UI uses for handling specific key presses. |
class |
BasicSplitPaneUI.PropertyHandler |
Implementation of the PropertyChangeListener that the JSplitPane UI uses. |
Field Summary
Modifier and Type | Field | Description |
---|---|---|
protected int |
beginDragDividerLocation |
Location of the divider when the dragging session began. |
protected BasicSplitPaneDivider |
divider |
Instance of the divider for this JSplitPane. |
protected KeyStroke |
dividerResizeToggleKey |
Deprecated. As of Java 2 platform v1.3. |
protected int |
dividerSize |
The size of the divider while the dragging session is valid. |
protected KeyStroke |
downKey |
Deprecated. As of Java 2 platform v1.3. |
protected boolean |
draggingHW |
Set to true in startDragging if any of the children (not including the nonContinuousLayoutDivider) are heavy weights. |
protected KeyStroke |
endKey |
Deprecated. As of Java 2 platform v1.3. |
protected FocusListener |
focusListener |
Instance of the FocusListener for this JSplitPane. |
protected KeyStroke |
homeKey |
Deprecated. As of Java 2 platform v1.3. |
protected 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. |
protected ActionListener |
keyboardDownRightListener |
Deprecated. As of Java 2 platform v1.3. |
protected ActionListener |
keyboardEndListener |
Deprecated. As of Java 2 platform v1.3. |
protected ActionListener |
keyboardHomeListener |
Deprecated. As of Java 2 platform v1.3. |
protected ActionListener |
keyboardResizeToggleListener |
Deprecated. As of Java 2 platform v1.3. |
protected ActionListener |
keyboardUpLeftListener |
Deprecated. As of Java 2 platform v1.3. |
protected BasicSplitPaneUI.BasicHorizontalLayoutManager |
layoutManager |
LayoutManager that is created and placed into the split pane. |
protected KeyStroke |
leftKey |
Deprecated. As of Java 2 platform v1.3. |
protected static final String |
NON_CONTINUOUS_DIVIDER |
The divider used for non-continuous layout is added to the split pane with this object. |
protected Component |
nonContinuousLayoutDivider |
Instance for the shadow of the divider when non continuous layout is being used. |
protected PropertyChangeListener |
propertyChangeListener |
Instance of the PropertyChangeListener for this JSplitPane. |
protected KeyStroke |
rightKey |
Deprecated. As of Java 2 platform v1.3. |
protected JSplitPane |
splitPane |
JSplitPane instance this instance is providing the look and feel for. |
protected KeyStroke |
upKey |
Deprecated. As of Java 2 platform v1.3. |
Constructor Summary
Constructor | Description |
---|---|
BasicSplitPaneUI() |
Constructs a BasicSplitPaneUI . |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
BasicSplitPaneDivider |
createDefaultDivider() |
Creates the default divider. |
protected Component |
createDefaultNonContinuousLayoutDivider() |
Returns the default non continuous layout divider, which is an instance of Canvas that fills in the background with dark gray. |
protected FocusListener |
createFocusListener() |
Creates a FocusListener for the JSplitPane UI. |
protected ActionListener |
createKeyboardDownRightListener() |
Deprecated. As of Java 2 platform v1.3. |
protected ActionListener |
createKeyboardEndListener() |
Deprecated. As of Java 2 platform v1.3. |
protected ActionListener |
createKeyboardHomeListener() |
Deprecated. As of Java 2 platform v1.3. |
protected ActionListener |
createKeyboardResizeToggleListener() |
Deprecated. As of Java 2 platform v1.3. |
protected ActionListener |
createKeyboardUpLeftListener() |
Deprecated. As of Java 2 platform v1.3. |
protected PropertyChangeListener |
createPropertyChangeListener() |
Creates a PropertyChangeListener for the JSplitPane UI. |
static ComponentUI |
createUI |
Creates a new instance of BasicSplitPaneUI . |
protected void |
dragDividerTo |
Messaged during a dragging session to move the divider to the passed in location . |
protected void |
finishDraggingTo |
Messaged to finish the dragging session. |
void |
finishedPaintingChildren |
Called when the specified split pane has finished painting its children. |
BasicSplitPaneDivider |
getDivider() |
Returns the divider between the top Components. |
protected int |
getDividerBorderSize() |
Deprecated. As of Java 2 platform v1.3, instead set the border on the divider. |
int |
getDividerLocation |
Returns the location of the divider, which may differ from what the splitpane thinks the location of the divider is. |
Insets |
getInsets |
Returns the insets. |
int |
getLastDragLocation() |
Returns the last drag location of the JSplitPane . |
int |
getMaximumDividerLocation |
Gets the maximum location of the divider. |
Dimension |
getMaximumSize |
Returns the maximum size for the passed in component, This is passed off to the current layout manager. |
int |
getMinimumDividerLocation |
Gets the minimum location of the divider. |
Dimension |
getMinimumSize |
Returns the minimum size for the passed in component, This is passed off to the current layout manager. |
Component |
getNonContinuousLayoutDivider() |
Returns the divider to use when the JSplitPane is configured to not continuously layout. |
int |
getOrientation() |
Returns the orientation for the JSplitPane . |
Dimension |
getPreferredSize |
Returns the preferred size for the passed in component, This is passed off to the current layout manager. |
JSplitPane |
getSplitPane() |
Returns the JSplitPane this instance is currently contained in. |
protected void |
installDefaults() |
Installs the UI defaults. |
protected void |
installKeyboardActions() |
Installs the keyboard actions for the UI. |
protected void |
installListeners() |
Installs the event listeners for the UI. |
void |
installUI |
Installs the UI. |
boolean |
isContinuousLayout() |
Determines whether the JSplitPane is set to use a continuous layout. |
protected void |
resetLayoutManager() |
Resets the layout manager based on orientation and messages it with invalidateLayout to pull in appropriate Components. |
void |
resetToPreferredSizes |
Messaged to reset the preferred sizes. |
void |
setContinuousLayout |
Turn continuous layout on/off. |
void |
setDividerLocation |
Sets the location of the divider to location. |
void |
setLastDragLocation |
Set the last drag location of the JSplitPane . |
protected void |
setNonContinuousLayoutDivider |
Sets the divider to use when the JSplitPane is configured to not continuously layout. |
protected void |
setNonContinuousLayoutDivider |
Sets the divider to use. |
void |
setOrientation |
Set the orientation for the JSplitPane . |
protected void |
startDragging() |
Should be messaged before the dragging session starts, resets lastDragLocation and dividerSize. |
protected void |
uninstallDefaults() |
Uninstalls the UI defaults. |
protected void |
uninstallKeyboardActions() |
Uninstalls the keyboard actions for the UI. |
protected void |
uninstallListeners() |
Uninstalls the event listeners for the UI. |
void |
uninstallUI |
Uninstalls the UI. |
Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
Field Details
NON_CONTINUOUS_DIVIDER
protected static final String NON_CONTINUOUS_DIVIDER
- See Also:
KEYBOARD_DIVIDER_MOVE_OFFSET
protected static int KEYBOARD_DIVIDER_MOVE_OFFSET
splitPane
protected JSplitPane splitPane
layoutManager
protected BasicSplitPaneUI.BasicHorizontalLayoutManager layoutManager
divider
protected BasicSplitPaneDivider divider
propertyChangeListener
protected PropertyChangeListener propertyChangeListener
focusListener
protected FocusListener focusListener
dividerSize
protected int dividerSize
nonContinuousLayoutDivider
protected Component nonContinuousLayoutDivider
draggingHW
protected boolean draggingHW
beginDragDividerLocation
protected int beginDragDividerLocation
upKey
@Deprecated protected KeyStroke upKey
downKey
@Deprecated protected KeyStroke downKey
leftKey
@Deprecated protected KeyStroke leftKey
rightKey
@Deprecated protected KeyStroke rightKey
homeKey
@Deprecated protected KeyStroke homeKey
endKey
@Deprecated protected KeyStroke endKey
dividerResizeToggleKey
@Deprecated protected KeyStroke dividerResizeToggleKey
keyboardUpLeftListener
@Deprecated protected ActionListener keyboardUpLeftListener
keyboardDownRightListener
@Deprecated protected ActionListener keyboardDownRightListener
keyboardHomeListener
@Deprecated protected ActionListener keyboardHomeListener
keyboardEndListener
@Deprecated protected ActionListener keyboardEndListener
keyboardResizeToggleListener
@Deprecated protected ActionListener keyboardResizeToggleListener
Constructor Details
BasicSplitPaneUI
public BasicSplitPaneUI()
BasicSplitPaneUI
.Method Details
createUI
public static ComponentUI createUI(JComponent x)
BasicSplitPaneUI
.- Parameters:
-
x
- a component - Returns:
- a new instance of
BasicSplitPaneUI
installUI
public void installUI(JComponent c)
- Overrides:
-
installUI
in classComponentUI
- Parameters:
-
c
- the component where this UI delegate is being installed - See Also:
installDefaults
protected void installDefaults()
installListeners
protected void installListeners()
installKeyboardActions
protected void installKeyboardActions()
uninstallUI
public void uninstallUI(JComponent c)
- Overrides:
-
uninstallUI
in 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()
uninstallListeners
protected void uninstallListeners()
uninstallKeyboardActions
protected void uninstallKeyboardActions()
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
PropertyChangeListener
for the JSplitPane
UI.- Returns:
- an instance of
PropertyChangeListener
createFocusListener
protected FocusListener createFocusListener()
FocusListener
for the JSplitPane
UI.- Returns:
- an instance of
FocusListener
createKeyboardUpLeftListener
@Deprecated protected ActionListener createKeyboardUpLeftListener()
Action
wrapping the ActionListener
, and register that Action
by overriding installKeyboardActions
and placing the Action
in the SplitPane's ActionMap
. Please refer to the key bindings specification for further details. Creates an ActionListener
for the JSplitPane
UI that listens for specific key presses.
- Returns:
- an instance of
ActionListener
createKeyboardDownRightListener
@Deprecated protected ActionListener createKeyboardDownRightListener()
Action
wrapping the ActionListener
, and register that Action
by overriding installKeyboardActions
and placing the Action
in the SplitPane's ActionMap
. Please refer to the key bindings specification for further details. Creates an ActionListener
for the JSplitPane
UI that listens for specific key presses.
- Returns:
- an instance of
ActionListener
createKeyboardHomeListener
@Deprecated protected ActionListener createKeyboardHomeListener()
Action
wrapping the ActionListener
, and register that Action
by overriding installKeyboardActions
and placing the Action
in the SplitPane's ActionMap
. Please refer to the key bindings specification for further details. Creates an ActionListener
for the JSplitPane
UI that listens for specific key presses.
- Returns:
- an instance of
ActionListener
createKeyboardEndListener
@Deprecated protected ActionListener createKeyboardEndListener()
Action
wrapping the ActionListener
, and register that Action
by overriding installKeyboardActions
and placing the Action
in the SplitPane's ActionMap
. Please refer to the key bindings specification for further details. Creates an ActionListener
for the JSplitPane
UI that listens for specific key presses.
- Returns:
- an instance of
ActionListener
createKeyboardResizeToggleListener
@Deprecated protected ActionListener createKeyboardResizeToggleListener()
Action
wrapping the ActionListener
, and register that Action
by overriding installKeyboardActions
and placing the Action
in the SplitPane's ActionMap
. Please refer to the key bindings specification for further details. Creates an ActionListener
for the JSplitPane
UI that listens for specific key presses.
- Returns:
- an instance of
ActionListener
getOrientation
public int getOrientation()
JSplitPane
.- Returns:
- the orientation
setOrientation
public void setOrientation(int orientation)
JSplitPane
.- Parameters:
-
orientation
- the orientation
isContinuousLayout
public boolean isContinuousLayout()
JSplitPane
is set to use a continuous layout.- Returns:
-
true
if a continuous layout is set
setContinuousLayout
public void setContinuousLayout(boolean b)
- Parameters:
-
b
- iftrue
the continuous layout turns on
getLastDragLocation
public int getLastDragLocation()
JSplitPane
.- Returns:
- the last drag location
setLastDragLocation
public void setLastDragLocation(int l)
JSplitPane
.- Parameters:
-
l
- the drag location
getDivider
public BasicSplitPaneDivider getDivider()
- Returns:
- the divider between the top Components
createDefaultNonContinuousLayoutDivider
protected Component createDefaultNonContinuousLayoutDivider()
Canvas
that fills in the background with dark gray.- Returns:
- the default non continuous layout divider
setNonContinuousLayoutDivider
protected void setNonContinuousLayoutDivider(Component newDivider)
JSplitPane
is 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
protected void setNonContinuousLayoutDivider(Component newDivider, boolean rememberSizes)
- Parameters:
-
newDivider
- the new divider -
rememberSizes
- iftrue
the pane size is remembered
getNonContinuousLayoutDivider
public Component getNonContinuousLayoutDivider()
JSplitPane
is configured to not continuously layout. This divider will only be used during a dragging session.- Returns:
- the divider
getSplitPane
public JSplitPane getSplitPane()
JSplitPane
this instance is currently contained in.- Returns:
- the instance of
JSplitPane
createDefaultDivider
public BasicSplitPaneDivider createDefaultDivider()
- Returns:
- the default divider
resetToPreferredSizes
public void resetToPreferredSizes(JSplitPane jc)
- Specified by:
-
resetToPreferredSizes
in classSplitPaneUI
- Parameters:
-
jc
- aJSplitPane
setDividerLocation
public void setDividerLocation(JSplitPane jc, int location)
- Specified by:
-
setDividerLocation
in classSplitPaneUI
- Parameters:
-
jc
- aJSplitPane
-
location
- an integer specifying the location of the divider
getDividerLocation
public int getDividerLocation(JSplitPane jc)
- Specified by:
-
getDividerLocation
in classSplitPaneUI
- Parameters:
-
jc
- aJSplitPane
- Returns:
- an integer specifying the location of the divider
getMinimumDividerLocation
public int getMinimumDividerLocation(JSplitPane jc)
- Specified by:
-
getMinimumDividerLocation
in classSplitPaneUI
- Parameters:
-
jc
- aJSplitPane
- Returns:
- and integer specifying the minimum location of the divider
getMaximumDividerLocation
public int getMaximumDividerLocation(JSplitPane jc)
- Specified by:
-
getMaximumDividerLocation
in classSplitPaneUI
- Parameters:
-
jc
- aJSplitPane
- Returns:
- an integer specifying the maximum location of the divider
finishedPaintingChildren
public void finishedPaintingChildren(JSplitPane sp, Graphics g)
- Specified by:
-
finishedPaintingChildren
in classSplitPaneUI
- Parameters:
-
sp
- aJSplitPane
-
g
- theGraphics
context
getPreferredSize
public Dimension getPreferredSize(JComponent jc)
- Overrides:
-
getPreferredSize
in 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
Dimension
object containing given component's preferred size appropriate for the look and feel - See Also:
getMinimumSize
public Dimension getMinimumSize(JComponent jc)
- Overrides:
-
getMinimumSize
in 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
Dimension
object ornull
- See Also:
getMaximumSize
public Dimension getMaximumSize(JComponent jc)
- Overrides:
-
getMaximumSize
in 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
Dimension
object ornull
- See Also:
getInsets
public Insets getInsets(JComponent jc)
- Parameters:
-
jc
- a component - Returns:
- the insets
resetLayoutManager
protected void resetLayoutManager()
startDragging
protected void startDragging()
dragDividerTo
protected void dragDividerTo(int location)
location
. If continuousLayout
is true
the location is reset and the splitPane validated.- Parameters:
-
location
- the location of divider
finishDraggingTo
protected void finishDraggingTo(int location)
location
will be reset.- Parameters:
-
location
- the location of divider
getDividerBorderSize
@Deprecated protected int getDividerBorderSize()
Returns the width of one side of the divider border.
- Returns:
- the width of one side of the divider border
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/plaf/basic/BasicSplitPaneUI.html