public class BasicMenuUI extends BasicMenuItemUI
Modifier and Type | Class and Description |
---|---|
class |
BasicMenuUI.ChangeHandler
从Java 2平台1.4开始,这个以前没有记录的类现在已经过时了。
|
protected class |
BasicMenuUI.MouseInputHandler
由菜单项实例化和使用,以处理鼠标事件当前的菜单选择。
|
Modifier and Type | Field and Description |
---|---|
protected ChangeListener |
changeListener |
protected MenuListener |
menuListener |
acceleratorDelimiter, acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, propertyChangeListener, selectionBackground, selectionForeground
Constructor and Description |
---|
BasicMenuUI() |
Modifier and Type | Method and Description |
---|---|
protected ChangeListener |
createChangeListener(JComponent c) |
protected MenuDragMouseListener |
createMenuDragMouseListener(JComponent c) |
protected MenuKeyListener |
createMenuKeyListener(JComponent c) |
protected MenuListener |
createMenuListener(JComponent c) |
protected MouseInputListener |
createMouseInputListener(JComponent c) |
protected PropertyChangeListener |
createPropertyChangeListener(JComponent c)
创建一个
PropertyChangeListener ,将添加到菜单项。
|
static ComponentUI |
createUI(JComponent x) |
Dimension |
getMaximumSize(JComponent c)
返回指定组件的最大尺寸,适合外观和感觉。
|
protected String |
getPropertyPrefix() |
protected void |
installDefaults() |
protected void |
installKeyboardActions() |
protected void |
installListeners() |
protected void |
setupPostTimer(JMenu menu) |
protected void |
uninstallDefaults() |
protected void |
uninstallKeyboardActions() |
protected void |
uninstallListeners() |
doClick, getMinimumSize, getPath, getPreferredMenuItemSize, getPreferredSize, installComponents, installUI, paint, paintBackground, paintMenuItem, paintText, uninstallComponents, uninstallUI, update
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
protected ChangeListener changeListener
protected MenuListener menuListener
public static ComponentUI createUI(JComponent x)
protected void installDefaults()
protected String getPropertyPrefix()
protected void installListeners()
protected void installKeyboardActions()
protected void uninstallKeyboardActions()
protected MouseInputListener createMouseInputListener(JComponent c)
protected MenuListener createMenuListener(JComponent c)
protected ChangeListener createChangeListener(JComponent c)
protected PropertyChangeListener createPropertyChangeListener(JComponent c)
BasicMenuItemUI
PropertyChangeListener
将被添加到菜单项。
如果此方法返回null,则不会将其添加到菜单项。
createPropertyChangeListener
在
BasicMenuItemUI
PropertyChangeListener
的实例或null
protected void uninstallDefaults()
protected void uninstallListeners()
protected MenuDragMouseListener createMenuDragMouseListener(JComponent c)
protected MenuKeyListener createMenuKeyListener(JComponent c)
public Dimension getMaximumSize(JComponent c)
ComponentUI
null
,则最大大小将由组件的布局管理器计算(这是安装了特定布局管理器的任何组件的首选方法)。
此方法的默认实现调用getPreferredSize
并返回该值。
getMaximumSize
在
BasicMenuItemUI
c
- 查询最大大小的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
Dimension
对象或
null
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
protected void setupPostTimer(JMenu menu)
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.