- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.plaf.basic.BasicSplitPaneDivider
-
- All Implemented Interfaces:
-
ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
public class BasicSplitPaneDivider extends Container implements PropertyChangeListener
BasicSplitPaneUI使用的分隔符。 小学生可能希望重写绘画来做更有趣的事情。 边框效果在BasicSplitPaneUI中绘制,因此如果您不喜欢该边框,请在此处重置。 要有条件地从特定区域拖动鼠标压缩并调用超级,当您希望拖动开始。警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已被添加到
java.beans
包中。 请参阅XMLEncoder
。- 另请参见:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 描述 protected class
BasicSplitPaneDivider.DividerLayout
用于布局一个BasicSplitPaneDivider
。protected class
BasicSplitPaneDivider.DragController
在针对HORIZONTAL_SPLIT的拆分窗格的拖动会话期间处理事件。protected class
BasicSplitPaneDivider.MouseHandler
MouseHandler负责将鼠标事件(释放,拖动...)转换为适当的DragController方法。protected class
BasicSplitPaneDivider.VerticalDragController
在VERTICAL_SPLIT面向拆分窗格的拖动会话期间处理事件。-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
-
Field Summary
Fields Modifier and Type Field 描述 protected int
dividerSize
分隔线的尺寸protected BasicSplitPaneDivider.DragController
dragger
处理鼠标拖动消息来做实际拖动。protected Component
hiddenDivider
用于非连续布局模式的分隔线。protected JButton
leftButton
用于快速切换左组件的按钮。protected BasicSplitPaneDivider.MouseHandler
mouseHandler
处理来自这个类和拆分窗格的鼠标事件。protected static int
ONE_TOUCH_OFFSET
分隔线的偏移。protected static int
ONE_TOUCH_SIZE
基于方向的分频器的宽度或高度BasicSplitPaneUI
增加了两个。protected int
orientation
JSplitPane的方向。protected JButton
rightButton
按钮快速切换正确的组件。protected JSplitPane
splitPane
JSplitPane包含接收器。protected BasicSplitPaneUI
splitPaneUI
这个实例是从这个UI创建的。-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
构造方法摘要
构造方法 Constructor 描述 BasicSplitPaneDivider(BasicSplitPaneUI ui)
创建一个BasicSplitPaneDivider
的实例。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected JButton
createLeftOneTouchButton()
创建并返回一个JButton
的实例,该实例可用于折叠拆分窗格中的左组件。protected JButton
createRightOneTouchButton()
创建并返回可用于折叠拆分窗格中正确组件的JButton
实例。protected void
dragDividerTo(int location)
消息的BasicSplitPaneUI与dragDividerTo该实例包含在。protected void
finishDraggingTo(int location)
消息的BasicSplitPaneUI与finishDraggingTo该实例包含在。BasicSplitPaneUI
getBasicSplitPaneUI()
返回接收者目前的SplitPaneUI
。Border
getBorder()
返回此组件的边框,如果当前未设置边框,则返回null。int
getDividerSize()
返回分隔符的大小,即分割窗口为HORIZONTAL_SPLIT时的宽度,或VERTICAL_SPLIT的高度。Insets
getInsets()
如果在此组件上设置了边框,则返回边框的插入,否则调用super.getInsets。Dimension
getMinimumSize()
返回dividerSize x dividerSizeDimension
getPreferredSize()
返回dividerSize x dividerSizeboolean
isMouseOver()
返回鼠标是否在分隔线上protected void
oneTouchExpandableChanged()
当JSplitPane的oneTouchExpandable值接收器包含在更改中时发生消息。void
paint(Graphics g)
涂抹分隔线。protected void
prepareForDragging()
消息准备拖动。void
propertyChange(PropertyChangeEvent e)
属性更改事件(可能来自JSplitPane)将在必要时发送updateOrientation消息。void
setBasicSplitPaneUI(BasicSplitPaneUI newUI)
设置使用接收器的SplitPaneUI
。void
setBorder(Border border)
设置此组件的边框。void
setDividerSize(int newSize)
将分频器的大小设置为newSize
。protected void
setMouseOver(boolean mouseOver)
设置鼠标是否在分隔线上。-
Methods inherited from class 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
-
Methods inherited from class 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
-
-
-
-
字段详细信息
-
ONE_TOUCH_SIZE
protected static final int ONE_TOUCH_SIZE
基于方向的分频器的宽度或高度BasicSplitPaneUI
增加了两个。- 另请参见:
- Constant Field Values
-
ONE_TOUCH_OFFSET
protected static final int ONE_TOUCH_OFFSET
分隔线的偏移。- 另请参见:
- Constant Field Values
-
dragger
protected BasicSplitPaneDivider.DragController dragger
处理鼠标拖动消息来做实际拖动。
-
splitPaneUI
protected BasicSplitPaneUI splitPaneUI
这个实例是从这个UI创建的。
-
dividerSize
protected int dividerSize
分隔线的尺寸
-
hiddenDivider
protected Component hiddenDivider
用于非连续布局模式的分隔线。
-
splitPane
protected JSplitPane splitPane
JSplitPane包含接收器。
-
mouseHandler
protected BasicSplitPaneDivider.MouseHandler mouseHandler
处理来自这个类和拆分窗格的鼠标事件。 因为您希望在点击分隔符的边框时拖动,这不是由分隔符绘制的,所以可以为拆分窗口处理鼠标事件。
-
orientation
protected int orientation
JSplitPane的方向。
-
leftButton
protected JButton leftButton
用于快速切换左组件的按钮。
-
rightButton
protected JButton rightButton
按钮快速切换正确的组件。
-
-
构造方法详细信息
-
BasicSplitPaneDivider
public BasicSplitPaneDivider(BasicSplitPaneUI ui)
创建一个BasicSplitPaneDivider
的实例。 注册此实例用于鼠标事件和鼠标拖动事件。- 参数
-
ui
-实例BasicSplitPaneUI
-
-
方法详细信息
-
setBasicSplitPaneUI
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI)
设置使用接收器的SplitPaneUI
。- 参数
-
newUI
- 新的SplitPaneUI
-
getBasicSplitPaneUI
public BasicSplitPaneUI getBasicSplitPaneUI()
返回接收者当前所在的SplitPaneUI
。- 结果
-
SplitPaneUI
接收机目前在
-
setDividerSize
public void setDividerSize(int newSize)
将分频器的大小设置为newSize
。 也就是说宽度如果将splitPaneHORIZONTAL_SPLIT
,或高度VERTICAL_SPLIT
。- 参数
-
newSize
- 一个新的大小
-
getDividerSize
public int getDividerSize()
返回分隔符的大小,即分割窗口为HORIZONTAL_SPLIT时的宽度,或VERTICAL_SPLIT的高度。- 结果
- 分隔线的大小
-
setBorder
public void setBorder(Border border)
设置此组件的边框。- 参数
-
border
- 一个新的边界 - 从以下版本开始:
- 1.3
-
getBorder
public Border getBorder()
返回此组件的边框,如果当前未设置边框,则返回null。- 结果
- 该组件的边框对象
- 从以下版本开始:
- 1.3
- 另请参见:
-
setBorder(javax.swing.border.Border)
-
getInsets
public Insets getInsets()
如果在此组件上设置了边框,则返回边框的插入,否则调用super.getInsets。- 重写:
-
getInsets
在Container
- 结果
- insets属性的值。
- 另请参见:
-
setBorder(javax.swing.border.Border)
-
setMouseOver
protected void setMouseOver(boolean mouseOver)
设置鼠标是否在分隔线上。- 参数
-
mouseOver
- 鼠标是否正在分隔线上 - 从以下版本开始:
- 1.5
-
isMouseOver
public boolean isMouseOver()
返回鼠标是否在分隔线上- 结果
- 无论鼠标当前是否超过分频器
- 从以下版本开始:
- 1.5
-
getPreferredSize
public Dimension getPreferredSize()
返回dividerSize x dividerSize- 重写:
-
getPreferredSize
在Container
- 结果
-
表示此容器的首选大小的
Dimension
的实例。 - 另请参见:
-
Container.getMinimumSize()
,Container.getMaximumSize()
,Container.getLayout()
,LayoutManager.preferredLayoutSize(Container)
,Component.getPreferredSize()
-
getMinimumSize
public Dimension getMinimumSize()
返回dividerSize x dividerSize- 重写:
-
getMinimumSize
中的Container
- 结果
-
表示此容器的最小大小的
Dimension
的实例。 - 另请参见:
-
Container.getPreferredSize()
,Container.getMaximumSize()
,Container.getLayout()
,LayoutManager.minimumLayoutSize(Container)
,Component.getMinimumSize()
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
属性更改事件(可能来自JSplitPane)将在必要时发送updateOrientation消息。- Specified by:
-
propertyChange
在接口PropertyChangeListener
- 参数
-
e
- 描述事件源和已更改的属性的PropertyChangeEvent对象。
-
paint
public void paint(Graphics g)
涂抹分隔线。- 重写:
-
paint
在Container
- 参数
-
g
- 指定的图形窗口 - 另请参见:
-
Component.update(Graphics)
-
oneTouchExpandableChanged
protected void oneTouchExpandableChanged()
当JSplitPane的oneTouchExpandable值接收器包含在更改中时发生消息。 如果它们为空,将创建leftButton
和rightButton
。 也使接收器无效。
-
createLeftOneTouchButton
protected JButton createLeftOneTouchButton()
创建并返回可用于折叠拆分窗格中左侧组件的JButton
实例。- 结果
-
一个
JButton
的实例
-
createRightOneTouchButton
protected JButton createRightOneTouchButton()
创建并返回可用于折叠拆分窗格中正确组件的JButton
实例。- 结果
-
一个
JButton
-
prepareForDragging
protected void prepareForDragging()
消息准备拖动。 这将使用startDragging消息BasicSplitPaneUI。
-
dragDividerTo
protected void dragDividerTo(int location)
消息的BasicSplitPaneUI与dragDividerTo该实例包含在。- 参数
-
location
- 一个位置
-
finishDraggingTo
protected void finishDraggingTo(int location)
消息的BasicSplitPaneUI与finishDraggingTo该实例包含在。- 参数
-
location
- a location
-
-