FileDocCategorySizeDatePackage
WindowsCheckBoxMenuItemUI.javaAPI DocJava SE 6 API2767Tue Jun 10 00:21:58 BST 2008com.sun.java.swing.plaf.windows

WindowsCheckBoxMenuItemUI

public class WindowsCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI
Windows check box menu item.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.

Fields Summary
final WindowsMenuItemUIAccessor
accessor
Constructors Summary
Methods Summary
public static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent b)

         
        return new WindowsCheckBoxMenuItemUI();
    
protected voidpaintBackground(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Color bgColor)

        if (WindowsMenuItemUI.isVistaPainting()) {
            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
            return;
        }
        super.paintBackground(g, menuItem, bgColor);
    
protected voidpaintText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text)
Method which renders the text of the current menu item.

param
g Graphics context
param
menuItem Current menu item to render
param
textRect Bounding rectangle to render the text.
param
text String to render
since
1.4

        if (WindowsMenuItemUI.isVistaPainting()) {
            WindowsMenuItemUI.paintText(accessor, g, menuItem, 
                                        textRect, text);
            return;
        }
        ButtonModel model = menuItem.getModel();
        Color oldColor = g.getColor();

        if(model.isEnabled() && model.isArmed()) {
            g.setColor(selectionForeground); // Uses protected field.
        }

        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);

        g.setColor(oldColor);