public class BasicToolBarUI extends ToolBarUI implements SwingConstants
Modifier and Type | Class and Description |
---|---|
class |
BasicToolBarUI.DockingListener
这个类应该被视为一个“受保护”的内部类。
|
protected class |
BasicToolBarUI.DragWindow |
protected class |
BasicToolBarUI.FrameListener |
protected class |
BasicToolBarUI.PropertyListener |
protected class |
BasicToolBarUI.ToolBarContListener |
protected class |
BasicToolBarUI.ToolBarFocusListener |
Modifier and Type | Field and Description |
---|---|
protected String |
constraintBeforeFloating |
protected Color |
dockingBorderColor |
protected Color |
dockingColor |
protected MouseInputListener |
dockingListener |
protected KeyStroke |
downKey
已弃用
从Java 2平台v1.3开始。
|
protected BasicToolBarUI.DragWindow |
dragWindow |
protected Color |
floatingBorderColor |
protected Color |
floatingColor |
protected int |
focusedCompIndex |
protected KeyStroke |
leftKey
已弃用
从Java 2平台v1.3开始。
|
protected PropertyChangeListener |
propertyListener |
protected KeyStroke |
rightKey
已弃用
从Java 2平台v1.3开始。
|
protected JToolBar |
toolBar |
protected ContainerListener |
toolBarContListener |
protected FocusListener |
toolBarFocusListener |
protected KeyStroke |
upKey
已弃用
从Java 2平台v1.3开始。
|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
BasicToolBarUI() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDock(Component c, Point p) |
protected MouseInputListener |
createDockingListener() |
protected BasicToolBarUI.DragWindow |
createDragWindow(JToolBar toolbar) |
protected JFrame |
createFloatingFrame(JToolBar toolbar)
不再使用,使用BasicToolBarUI.createFloatingWindow(JToolBar)
|
protected RootPaneContainer |
createFloatingWindow(JToolBar toolbar)
在从其容器中拖出工具栏后,创建一个包含工具栏的窗口
|
protected WindowListener |
createFrameListener() |
protected Border |
createNonRolloverBorder()
创建工具栏组件的非滚动边框。
|
protected PropertyChangeListener |
createPropertyListener() |
protected Border |
createRolloverBorder()
为工具栏组件创建滚动边框。
|
protected ContainerListener |
createToolBarContListener() |
protected FocusListener |
createToolBarFocusListener() |
static ComponentUI |
createUI(JComponent c) |
protected void |
dragTo(Point position, Point origin) |
protected void |
floatAt(Point position, Point origin) |
Color |
getDockingColor()
获取在停靠区域上显示的颜色
|
Color |
getFloatingColor()
获取在浮动区域上显示的颜色
|
protected Border |
getNonRolloverBorder(AbstractButton b)
返回按钮的非滚动边框。
|
protected Border |
getRolloverBorder(AbstractButton b)
返回按钮的翻转边框。
|
protected void |
installComponents() |
protected void |
installDefaults() |
protected void |
installKeyboardActions() |
protected void |
installListeners() |
protected void |
installNonRolloverBorders(JComponent c)
在JComponent的所有子组件上安装非滚动边框。
|
protected void |
installNormalBorders(JComponent c)
在JComponent的所有子组件上安装正常边界。
|
protected void |
installRolloverBorders(JComponent c)
在JComponent的所有子组件上安装滚动边框。
|
void |
installUI(JComponent c)
适当地配置指定的组件的外观和感觉。
|
boolean |
isFloating() |
boolean |
isRolloverBorders()
返回一个标志,以确定是否启用滚动按钮边框。
|
protected void |
navigateFocusedComp(int direction) |
protected void |
paintDragWindow(Graphics g)
绘制用于拖动的窗口的内容。
|
protected void |
setBorderToNonRollover(Component c)
将组件的边框设置为具有
createNonRolloverBorder() 方法创建的非滚动边框。
|
protected void |
setBorderToNormal(Component c)
将组件的边框设置为具有正常边框。
|
protected void |
setBorderToRollover(Component c)
将组件的边框设置为具有
createRolloverBorder() 方法创建的翻转边框。
|
void |
setDockingColor(Color c)
设置在停靠区域上显示的颜色
|
void |
setFloating(boolean b, Point p) |
void |
setFloatingColor(Color c)
设置在浮动区域上显示的颜色
|
void |
setFloatingLocation(int x, int y) |
void |
setOrientation(int orientation) |
void |
setRolloverBorders(boolean rollover)
设置在工具栏上启用滚动边框的标志,并且还将根据标志的状态安装适当的边框。
|
protected void |
uninstallComponents() |
protected void |
uninstallDefaults() |
protected void |
uninstallKeyboardActions() |
protected void |
uninstallListeners() |
void |
uninstallUI(JComponent c)
在installUI中反转在
installUI 上完成的
installUI 。
|
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
protected JToolBar toolBar
protected BasicToolBarUI.DragWindow dragWindow
protected int focusedCompIndex
protected Color dockingColor
protected Color floatingColor
protected Color dockingBorderColor
protected Color floatingBorderColor
protected MouseInputListener dockingListener
protected PropertyChangeListener propertyListener
protected ContainerListener toolBarContListener
protected FocusListener toolBarFocusListener
protected String constraintBeforeFloating
@Deprecated protected KeyStroke upKey
@Deprecated protected KeyStroke downKey
@Deprecated protected KeyStroke leftKey
@Deprecated protected KeyStroke rightKey
public static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
ComponentUI
ComponentUI
实例作为指定组件上的UI委托时,将调用此方法。
该方法应该完全配置组件的外观,包括以下内容:
LayoutManager
上安装LayoutManager。 PropertyChangeListener
上创建/安装PropertyChangeListener,以便适当地检测和响应组件属性的更改。 installUI
在
ComponentUI
类
c
- 正在安装此UI代理的组件
ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void uninstallUI(JComponent c)
ComponentUI
installUI
上完成的installUI
。
当将此UIComponent
实例作为指定组件的UI委托删除时,将调用此方法。
该方法应该撤消在installUI中执行的installUI
,小心使JComponent
实例处于干净状态(无外部监听器,外观特定属性对象等)。
这应该包括以下内容:
uninstallUI
在
ComponentUI
c
- 从中删除此UI代理的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.updateUI()
protected void installDefaults()
protected void uninstallDefaults()
protected void installComponents()
protected void uninstallComponents()
protected void installListeners()
protected void uninstallListeners()
protected void installKeyboardActions()
protected void uninstallKeyboardActions()
protected void navigateFocusedComp(int direction)
protected Border createRolloverBorder()
覆盖此方法以提供备用的翻转边框。
protected Border createNonRolloverBorder()
覆盖此方法以提供备用的翻转边框。
protected JFrame createFloatingFrame(JToolBar toolbar)
protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
RootPaneContainer
对象,包含工具栏。
protected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
public boolean isRolloverBorders()
setRolloverBorders(boolean)
public void setRolloverBorders(boolean rollover)
rollover
- 如果为true,则安装滚动边框。
否则将安装非滚动边框
isRolloverBorders()
protected void installRolloverBorders(JComponent c)
这是一个方便的方法来调用setBorderToRollover
每个子组件。
c
- 容纳子组件的容器(通常是JToolBar)
setBorderToRollover(java.awt.Component)
protected void installNonRolloverBorders(JComponent c)
这是一个方便的方法来调用setBorderToNonRollover
每个子组件。
c
- 容纳子组件的容器(通常是JToolBar)
setBorderToNonRollover(java.awt.Component)
protected void installNormalBorders(JComponent c)
这是一个方便的方法来调用setBorderNormal
每个子组件。
c
- 容纳子组件的容器(通常是JToolBar)
setBorderToNonRollover(java.awt.Component)
protected void setBorderToRollover(Component c)
createRolloverBorder()
方法创建的翻转边框。
c
- 将安装滚动边框的组件
createRolloverBorder()
protected Border getRolloverBorder(AbstractButton b)
b
- 计算滚动边框的按钮
setBorderToRollover(java.awt.Component)
protected void setBorderToNonRollover(Component c)
createNonRolloverBorder()
方法创建的非滚动边框。
c
- 将安装非滚动边界的组件
createNonRolloverBorder()
protected Border getNonRolloverBorder(AbstractButton b)
b
- 用于计算非滚动边框的按钮
setBorderToNonRollover(java.awt.Component)
protected void setBorderToNormal(Component c)
c
- 将重新安装正常边框的组件
createNonRolloverBorder()
public void setFloatingLocation(int x, int y)
public boolean isFloating()
public void setFloating(boolean b, Point p)
public void setOrientation(int orientation)
public Color getDockingColor()
public void setDockingColor(Color c)
public Color getFloatingColor()
public void setFloatingColor(Color c)
protected ContainerListener createToolBarContListener()
protected FocusListener createToolBarFocusListener()
protected PropertyChangeListener createPropertyListener()
protected MouseInputListener createDockingListener()
protected WindowListener createFrameListener()
protected void paintDragWindow(Graphics g)
g
- 绘图的图形。
NullPointerException
- 为
g
为空
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.