当前页面:
在线文档首页 >
JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档
Java(TM) 2 Platform, Standard Edition, v1.2.2 API Specification: Class BasicMenuItemUI - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档
javax.swing.plaf.basic
Class BasicMenuItemUI
java.lang.Object
|
+--javax.swing.plaf.ComponentUI
|
+--javax.swing.plaf.ButtonUI
|
+--javax.swing.plaf.MenuItemUI
|
+--javax.swing.plaf.basic.BasicMenuItemUI
- Direct Known Subclasses:
- BasicCheckBoxMenuItemUI, BasicMenuUI, BasicRadioButtonMenuItemUI
- public class BasicMenuItemUI
- extends MenuItemUI
BasicMenuItem implementation
Method Summary |
protected MenuDragMouseListener |
createMenuDragMouseListener(JComponent c)
|
protected MenuKeyListener |
createMenuKeyListener(JComponent c)
|
protected MouseInputListener |
createMouseInputListener(JComponent c)
|
static ComponentUI |
createUI(JComponent c)
|
Dimension |
getMaximumSize(JComponent c)
|
Dimension |
getMinimumSize(JComponent c)
|
MenuElement[] |
getPath()
|
protected Dimension |
getPreferredMenuItemSize(JComponent c,
Icon checkIcon,
Icon arrowIcon,
int defaultTextIconGap)
|
Dimension |
getPreferredSize(JComponent c)
|
protected String |
getPropertyPrefix()
|
protected void |
installDefaults()
|
protected void |
installKeyboardActions()
|
protected void |
installListeners()
|
void |
installUI(JComponent c)
|
void |
paint(Graphics g,
JComponent c)
|
protected void |
paintMenuItem(Graphics g,
JComponent c,
Icon checkIcon,
Icon arrowIcon,
Color background,
Color foreground,
int defaultTextIconGap)
|
protected void |
uninstallDefaults()
|
protected void |
uninstallKeyboardActions()
|
protected void |
uninstallListeners()
|
void |
uninstallUI(JComponent c)
|
void |
update(Graphics g,
JComponent c)
We draw the background in paintMenuItem()
so override update (which fills the background of opaque
components by default) to just call paint(). |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
menuItem
protected JMenuItem menuItem
selectionBackground
protected Color selectionBackground
selectionForeground
protected Color selectionForeground
disabledForeground
protected Color disabledForeground
acceleratorForeground
protected Color acceleratorForeground
acceleratorSelectionForeground
protected Color acceleratorSelectionForeground
defaultTextIconGap
protected int defaultTextIconGap
acceleratorFont
protected Font acceleratorFont
mouseInputListener
protected MouseInputListener mouseInputListener
menuDragMouseListener
protected MenuDragMouseListener menuDragMouseListener
menuKeyListener
protected MenuKeyListener menuKeyListener
arrowIcon
protected Icon arrowIcon
checkIcon
protected Icon checkIcon
oldBorderPainted
protected boolean oldBorderPainted
BasicMenuItemUI
public BasicMenuItemUI()
createUI
public static ComponentUI createUI(JComponent c)
installUI
public void installUI(JComponent c)
- Overrides:
- installUI in class ComponentUI
installDefaults
protected void installDefaults()
getPropertyPrefix
protected String getPropertyPrefix()
installListeners
protected void installListeners()
installKeyboardActions
protected void installKeyboardActions()
uninstallUI
public void uninstallUI(JComponent c)
- Overrides:
- uninstallUI in class ComponentUI
uninstallDefaults
protected void uninstallDefaults()
uninstallListeners
protected void uninstallListeners()
uninstallKeyboardActions
protected void uninstallKeyboardActions()
createMouseInputListener
protected MouseInputListener createMouseInputListener(JComponent c)
createMenuDragMouseListener
protected MenuDragMouseListener createMenuDragMouseListener(JComponent c)
createMenuKeyListener
protected MenuKeyListener createMenuKeyListener(JComponent c)
getMinimumSize
public Dimension getMinimumSize(JComponent c)
- Overrides:
- getMinimumSize in class ComponentUI
getPreferredSize
public Dimension getPreferredSize(JComponent c)
- Overrides:
- getPreferredSize in class ComponentUI
getMaximumSize
public Dimension getMaximumSize(JComponent c)
- Overrides:
- getMaximumSize in class ComponentUI
getPreferredMenuItemSize
protected Dimension getPreferredMenuItemSize(JComponent c,
Icon checkIcon,
Icon arrowIcon,
int defaultTextIconGap)
update
public void update(Graphics g,
JComponent c)
- We draw the background in paintMenuItem()
so override update (which fills the background of opaque
components by default) to just call paint().
- Overrides:
- update in class ComponentUI
paint
public void paint(Graphics g,
JComponent c)
- Overrides:
- paint in class ComponentUI
paintMenuItem
protected void paintMenuItem(Graphics g,
JComponent c,
Icon checkIcon,
Icon arrowIcon,
Color background,
Color foreground,
int defaultTextIconGap)
getPath
public MenuElement[] getPath()
Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.