java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.plaf.basic.BasicSplitPaneDivider
- 所有已实现的接口:
ImageObserver,MenuContainer,PropertyChangeListener,Serializable,EventListener
BasicSplitPaneUI 使用的分隔线。子类可能希望重写 paint 来做一些更有趣的事情。边框效果是在 BasicSplitPaneUI 中绘制的,所以如果您不喜欢那个边框,请在那里重新设置它。要有条件地从某些区域拖动子类 mousePressed 并在您希望开始拖动时调用 super。
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder 。
-
内部类总结
内部类修饰符和类型类描述protected class用于布局BasicSplitPaneDivider。protected class在面向 HORIZONTAL_SPLIT 的拆分窗格的拖动会话期间处理事件。protected classMouseHandler 负责将鼠标事件(释放、拖动...)转换为适当的 DragController 方法。protected class在面向 VERTICAL_SPLIT 的拆分窗格的拖动会话期间处理事件。在类 java.awt.Container 中声明的嵌套类/接口
Container.AccessibleAWTContainer -
字段摘要
字段修饰符和类型Field描述protected int分隔线的大小。protected BasicSplitPaneDivider.DragController处理鼠标拖动消息以进行实际拖动。protected Component用于非连续布局模式的分隔线。protected JButton用于快速切换左侧组件的按钮。protected BasicSplitPaneDivider.MouseHandler处理来自此类和拆分窗格的鼠标事件。protected static final int分隔符的偏移量。protected static final int基于方向的分隔线的宽度或高度BasicSplitPaneUI添加两个。protected intJSplitPane 的方向。protected JButton用于快速切换正确组件的按钮。protected JSplitPane接收器包含在 JSplitPane 中。protected BasicSplitPaneUI创建此实例的 UI。在类 java.awt.Component 中声明的字段
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT在接口 java.awt.image.ImageObserver 中声明的字段
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
构造方法总结
构造方法 -
方法总结
修饰符和类型方法描述protected JButton创建并返回JButton的实例,可用于折叠拆分窗格中的左侧组件。protected JButton创建并返回JButton的实例,可用于折叠拆分窗格中的右侧组件。protected voiddragDividerTo(int location) 使用包含此实例的 dragDividerTo 向 BasicSplitPaneUI 发送消息。protected voidfinishDraggingTo(int location) 使用包含此实例的 finishDraggingTo 向 BasicSplitPaneUI 发送消息。返回接收器当前所在的SplitPaneUI。返回此组件的边框,如果当前未设置边框,则返回 null。int返回分隔线的大小,如果拆分窗格为 HORIZONTAL_SPLIT,则为宽度;如果为 VERTICAL_SPLIT,则为高度。如果已在此组件上设置了边框,则返回边框的 insets,否则调用 super.getInsets。返回分隔符的最小大小。返回分隔线的首选大小。boolean返回鼠标当前是否在分隔线上方protected void当分隔符包含在 JSplitPane 的 oneTouchExpandable 值更改中时发出消息。void绘制分隔线。protected void准备拖动的消息。void可能来自 JSplitPane 的属性更改事件将在必要时向 updateOrientation 发送消息。void设置正在使用接收器的SplitPaneUI。void设置此组件的边框。voidsetDividerSize(int newSize) 将分频器的大小设置为newSize。protected voidsetMouseOver(boolean mouseOver) 设置鼠标当前是否在分隔线上方。在类 java.awt.Container 中声明的方法
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree在类 java.awt.Component 中声明的方法
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
字段详细信息
-
ONE_TOUCH_SIZE
protected static final int ONE_TOUCH_SIZE基于方向的分隔线的宽度或高度BasicSplitPaneUI添加两个。- 参见:
-
ONE_TOUCH_OFFSET
protected static final int ONE_TOUCH_OFFSET分隔符的偏移量。- 参见:
-
dragger
处理鼠标拖动消息以进行实际拖动。 -
splitPaneUI
创建此实例的 UI。 -
dividerSize
protected int dividerSize分隔线的大小。 -
splitPane
接收器包含在 JSplitPane 中。 -
mouseHandler
处理来自此类和拆分窗格的鼠标事件。为拆分窗格处理鼠标事件,因为您希望能够在单击分隔线的边框时进行拖动,而分隔线不是由分隔线绘制的。 -
orientation
protected int orientationJSplitPane 的方向。 -
leftButton
用于快速切换左侧组件的按钮。 -
rightButton
用于快速切换正确组件的按钮。
-
-
构造方法详细信息
-
BasicSplitPaneDivider
创建BasicSplitPaneDivider的实例。为鼠标事件和鼠标拖动事件注册此实例。- 参数:
ui-BasicSplitPaneUI的实例
-
-
方法详情
-
setBasicSplitPaneUI
设置正在使用接收器的SplitPaneUI。- 参数:
newUI- 新的SplitPaneUI
-
getBasicSplitPaneUI
返回接收器当前所在的SplitPaneUI。- 返回:
SplitPaneUI接收器当前在
-
setDividerSize
public void setDividerSize(int newSize) 将分频器的大小设置为newSize。如果拆分窗格为HORIZONTAL_SPLIT,则为宽度,或者为VERTICAL_SPLIT的高度。分隔符大小newSize < 0将被忽略。- 参数:
newSize- 新尺寸
-
getDividerSize
public int getDividerSize()返回分隔线的大小,如果拆分窗格为 HORIZONTAL_SPLIT,则为宽度;如果为 VERTICAL_SPLIT,则为高度。- 返回:
- 分隔线的大小
-
setBorder
设置此组件的边框。- 参数:
border- 新边框- 自从:
- 1.3
-
getBorder
返回此组件的边框,如果当前未设置边框,则返回 null。- 返回:
- 该组件的边框对象
- 自从:
- 1.3
- 参见:
-
getInsets
如果已在此组件上设置了边框,则返回边框的 insets,否则调用 super.getInsets。 -
setMouseOver
protected void setMouseOver(boolean mouseOver) 设置鼠标当前是否在分隔线上方。- 参数:
mouseOver- 鼠标当前是否在分隔线上方- 自从:
- 1.5
-
isMouseOver
public boolean isMouseOver()返回鼠标当前是否在分隔线上方- 返回:
- 鼠标当前是否在分隔线上方
- 自从:
- 1.5
-
getPreferredSize
返回分隔线的首选大小。- 重写:
getPreferredSize在类Container中- 实现注意事项:
-
在当前的实现中,如果分割窗格是 HORIZONTAL_SPLIT,则首选大小是从
getDividerSize像素的宽度和 1 像素的高度获得的 如果分割窗格是 VERTICAL_SPLIT,则首选大小是从getDividerSize像素的高度和 1 像素的宽度获取的 - 返回:
-
一个
Dimension对象包含BasicSplitPaneDivider的首选大小 - 参见:
-
getMinimumSize
返回分隔符的最小大小。- 重写:
getMinimumSize在类Container中- 实现注意事项:
-
在当前实现中,如果分割窗格是 HORIZONTAL_SPLIT,则最小尺寸是从
getDividerSize像素的宽度和 1 像素的高度获得的 如果分割窗格是 VERTICAL_SPLIT,则最小尺寸是从getDividerSize像素的高度和 1 像素的宽度获得的 - 返回:
-
包含
BasicSplitPaneDivider最小大小的Dimension对象 - 参见:
-
propertyChange
可能来自 JSplitPane 的属性更改事件将在必要时向 updateOrientation 发送消息。- 指定者:
propertyChange在接口PropertyChangeListener中- 参数:
e- 描述事件源和已更改属性的 PropertyChangeEvent 对象。
-
paint
绘制分隔线。 -
oneTouchExpandableChanged
protected void oneTouchExpandableChanged()当分隔符包含在 JSplitPane 的 oneTouchExpandable 值更改中时发出消息。将创建leftButton和rightButton如果它们为 null 并且相应的 JSplitPane 支持 oneTouchExpandable 属性。也使相应的 JSplitPane 无效。 -
createLeftOneTouchButton
创建并返回JButton的实例,可用于折叠拆分窗格中的左侧组件。- 返回:
JButton的实例
-
createRightOneTouchButton
创建并返回JButton的实例,可用于折叠拆分窗格中的右侧组件。- 返回:
JButton的实例
-
prepareForDragging
protected void prepareForDragging()准备拖动的消息。这会向 BasicSplitPaneUI 发送带有 startDragging 的消息。 -
dragDividerTo
protected void dragDividerTo(int location) 使用包含此实例的 dragDividerTo 向 BasicSplitPaneUI 发送消息。- 参数:
location- 一个位置
-
finishDraggingTo
protected void finishDraggingTo(int location) 使用包含此实例的 finishDraggingTo 向 BasicSplitPaneUI 发送消息。- 参数:
location- 一个位置
-