- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.plaf.basic.BasicSplitPaneDivider
-
- 实现的所有接口
-
ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
public class BasicSplitPaneDividerextends Containerimplements PropertyChangeListener
BasicSplitPaneUI使用的分隔符。 Subclassers可能希望覆盖油漆来做更有趣的事情。 边框效果在BasicSplitPaneUI中绘制,因此如果您不喜欢该边框,请在那里重置它。 要有条件地从某些区域拖动子类mousePressed并在希望拖动开始时调用super。警告:此类的序列化对象与以后的Swing版本不兼容。 当前的序列化支持适用于运行相同版本Swing的应用程序之间的短期存储或RMI。 从1.4开始,
java.beans
软件包中添加了对所有JavaBeansjava.beans
长期存储的支持。 请参阅XMLEncoder
。- 另请参见:
- Serialized Form
-
-
嵌套类汇总
嵌套类 变量和类型 类 描述 protected class
BasicSplitPaneDivider.DividerLayout
用于布局BasicSplitPaneDivider
。protected class
BasicSplitPaneDivider.DragController
在面向HORIZONTAL_SPLIT的拆分窗格的拖动会话期间处理事件。protected class
BasicSplitPaneDivider.MouseHandler
MouseHandler负责将鼠标事件(已发布,拖动...)转换为适当的DragController方法。protected class
BasicSplitPaneDivider.VerticalDragController
在面向VERTICAL_SPLIT的拆分窗格的拖动会话期间处理事件。-
嵌套类/接口声明在类 java.awt.Container
Container.AccessibleAWTContainer
-
-
字段汇总
字段 变量和类型 字段 描述 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
的分隔线的宽度或高度BasicSplitPaneUI
增加了两个。protected int
orientation
JSplitPane的方向。protected JButton
rightButton
用于快速切换正确组件的按钮。protected JSplitPane
splitPane
接收器中包含JSplitPane。protected BasicSplitPaneUI
splitPaneUI
这个实例的UI是从中创建的。-
声明的属性在类 java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields declared in interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
构造方法摘要
构造方法 构造器 描述 BasicSplitPaneDivider(BasicSplitPaneUI ui)
创建BasicSplitPaneDivider
的实例。
-
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 protected JButton
createLeftOneTouchButton()
创建并返回JButton
的实例,该实例可用于折叠拆分窗格中的左侧组件。protected JButton
createRightOneTouchButton()
创建并返回JButton
的实例,该实例可用于折叠拆分窗格中的右侧组件。protected void
dragDividerTo(int location)
使用包含此实例的dragDividerTo向BasicSplitPaneUI发送消息。protected void
finishDraggingTo(int location)
使用此实例包含的finishDraggingTo消息BasicSplitPaneUI。BasicSplitPaneUI
getBasicSplitPaneUI()
返回接收器当前所在的SplitPaneUI
。Border
getBorder()
返回此组件的边框,如果当前未设置边框,则返回null。int
getDividerSize()
返回分隔符的大小,即splitpane为HORIZONTAL_SPLIT时的宽度,或VERTICAL_SPLIT的高度。Insets
getInsets()
如果已在此组件上设置了边框,则返回边框的insets,否则调用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)
设置鼠标当前是否在分隔符上。-
声明方法的类 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
的分隔线的宽度或高度BasicSplitPaneUI
增加了两个。- 另请参见:
- 常数字段值
-
ONE_TOUCH_OFFSET
protected static final int ONE_TOUCH_OFFSET
分频器的偏移量。- 另请参见:
- 常数字段值
-
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
处理此类和拆分窗格中的鼠标事件。 处理splitpane的鼠标事件是因为您希望能够在单击分隔符边框时进行拖动,而分隔符不是由分隔符绘制的。
-
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
。 如果splitpane为HORIZONTAL_SPLIT
,或者高度为VERTICAL_SPLIT
,VERTICAL_SPLIT
。- 参数
-
newSize
- 新尺码
-
getDividerSize
public int getDividerSize()
返回分隔符的大小,即splitpane为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()
如果已在此组件上设置了边框,则返回边框的insets,否则调用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值包含在更改中时传递消息。 如果它们为null,将创建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)
使用包含此实例的dragDividerTo向BasicSplitPaneUI发送消息。- 参数
-
location
- 一个位置
-
finishDraggingTo
protected void finishDraggingTo(int location)
使用此实例包含的finishDraggingTo消息BasicSplitPaneUI。- 参数
-
location
- a location
-
-