API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.plaf.basic. BasicMenuItemUI View Source
Author(s)
Georges Saab
David Karlton
Arnaud Weber
Fredrik Lagerblad
Since
Version
1.142 12/15/06
Serial
Hierarchy
 Object
      ComponentUI
          ButtonUI
              MenuItemUI
                  BasicMenuItemUI
Implements
Subclasses
Description
public class BasicMenuItemUI
BasicMenuItem implementation
See also:   
Constructors
public BasicMenuItemUI ()
Methods
Hide/Show inherited methods
public boolean contains (JComponent c, int x, int y) [Inherited From ComponentUI]
  Returns true if the specified x,y location is contained within the look and feel's defined shape of the specified component.
pack-private InputMap createInputMap (int condition)
protected MenuDragMouseListener createMenuDragMouseListener (JComponent c)
protected MenuKeyListener createMenuKeyListener (JComponent c)
protected MouseInputListener createMouseInputListener (JComponent c)
protected PropertyChangeListener createPropertyChangeListener (JComponent c)
  Creates a PropertyChangeListener which will be added to the menu item.
publicstatic ComponentUI createUI (JComponent c) [Overrides ComponentUI]
protected void doClick (MenuSelectionManager msm)
  Call this method when a menu item is to be activated.
public Accessible getAccessibleChild (JComponent c, int i) [Inherited From ComponentUI]
  Returns the ith Accessible child of the object.
public int getAccessibleChildrenCount (JComponent c) [Inherited From ComponentUI]
  Returns the number of accessible children in the object.
public int getBaseline (JComponent c, int width, int height) [Inherited From ComponentUI]
  Returns the baseline.
public BaselineResizeBehavior getBaselineResizeBehavior (JComponent c) [Inherited From ComponentUI]
  Returns an enum indicating how the baseline of he component changes as the size changes.
pack-private Handler getHandler ()
public Dimension getMaximumSize (JComponent c) [Overrides ComponentUI]
public Dimension getMinimumSize (JComponent c) [Overrides ComponentUI]
public MenuElement getPath ()
protected Dimension getPreferredMenuItemSize (JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)
public Dimension getPreferredSize (JComponent c) [Overrides ComponentUI]
protected String getPropertyPrefix ()
protected void installComponents (JMenuItem menuItem)
 
protected void installDefaults ()
protected void installKeyboardActions ()
pack-private void installLazyActionMap ()
protected void installListeners ()
public void installUI (JComponent c) [Overrides ComponentUI]
pack-privatestatic void loadActionMap (LazyActionMap map)
public void paint (Graphics g, JComponent c) [Overrides ComponentUI]
protected void paintBackground (Graphics g, JMenuItem menuItem, Color bgColor)
  Draws the background of the menu item.
protected void paintMenuItem (Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)
protected void paintText (Graphics g, JMenuItem menuItem, Rectangle textRect, String text)
  Renders the text of the current menu item.
pack-private void printMenuElementArray (MenuElement path, boolean dumpStack)
protected void uninstallComponents (JMenuItem menuItem)
 
protected void uninstallDefaults ()
protected void uninstallKeyboardActions ()
protected void uninstallListeners ()
public void uninstallUI (JComponent c) [Overrides ComponentUI]
public void update (Graphics g, JComponent c) [Overrides ComponentUI]
We draw the background in paintMenuItem() so override update (which fills the background of opaque components by default) to just call paint().
pack-private void updateAcceleratorBinding ()
Fields
Hide/Show inherited fields
protected Font acceleratorFont
protected Color acceleratorForeground
pack-privatestatic Rectangle acceleratorRect
protected Color acceleratorSelectionForeground
protected Icon arrowIcon
pack-privatestatic Rectangle arrowIconRect
protected Icon checkIcon
pack-privatestatic Rectangle checkIconRect
protected int defaultTextIconGap
protected Color disabledForeground
pack-private Handler handler
pack-privatestatic Rectangle iconRect
pack-privatefinalstatic String MAX_ACC_WIDTH = "maxAccWidth"
pack-privatefinalstatic String MAX_ARROW_ICON_WIDTH = "maxArrowIconWidth"
pack-privatefinalstatic String MAX_CHECK_ICON_WIDTH = "maxCheckIconWidth"
pack-privatefinalstatic StringBuffer MAX_ICON_OFFSET
pack-privatefinalstatic String MAX_ICON_WIDTH = "maxIconWidth"
pack-privatefinalstatic String MAX_TEXT_WIDTH = "maxTextWidth"
protected MenuDragMouseListener menuDragMouseListener
protected JMenuItem menuItem
protected MenuKeyListener menuKeyListener
protected MouseInputListener mouseInputListener
protected boolean oldBorderPainted
protected PropertyChangeListener propertyChangeListener
  PropertyChangeListener returned from createPropertyChangeListener.
pack-privatestatic Rectangle r
protected Color selectionBackground
protected Color selectionForeground
pack-privatestatic Rectangle textRect
pack-privatestatic Rectangle viewRect
pack-privatestatic Rectangle zeroRect
Nested Classes
  BasicMenuItemUI.MouseInputHandler
  BasicMenuItemUI.Handler
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar