FileDocCategorySizeDatePackage
WindowsRadioButtonUI.javaAPI DocJava SE 5 API3254Fri Aug 26 14:54:50 BST 2005com.sun.java.swing.plaf.windows

WindowsRadioButtonUI

public class WindowsRadioButtonUI extends BasicRadioButtonUI
Windows rendition of the component.

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
private static final WindowsRadioButtonUI
windowsRadioButtonUI
protected int
dashedRectGapX
protected int
dashedRectGapY
protected int
dashedRectGapWidth
protected int
dashedRectGapHeight
protected Color
focusColor
private boolean
initialized
Constructors Summary
Methods Summary
public static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)

    
    // ********************************
    //          Create PLAF
    // ********************************
         
	return windowsRadioButtonUI;
    
protected java.awt.ColorgetFocusColor()

	return focusColor;
    
public java.awt.DimensiongetPreferredSize(javax.swing.JComponent c)

	Dimension d = super.getPreferredSize(c);

	/* Ensure that the width and height of the button is odd,
	 * to allow for the focus line if focus is painted
	 */
        AbstractButton b = (AbstractButton)c;
	if (d != null && b.isFocusPainted()) {
	    if(d.width % 2 == 0) { d.width += 1; }
	    if(d.height % 2 == 0) { d.height += 1; }
	}
	return d;
    
public voidinstallDefaults(javax.swing.AbstractButton b)

	super.installDefaults(b);
	if(!initialized) {
	    dashedRectGapX = ((Integer)UIManager.get("Button.dashedRectGapX")).intValue();
	    dashedRectGapY = ((Integer)UIManager.get("Button.dashedRectGapY")).intValue();
	    dashedRectGapWidth = ((Integer)UIManager.get("Button.dashedRectGapWidth")).intValue();
	    dashedRectGapHeight = ((Integer)UIManager.get("Button.dashedRectGapHeight")).intValue();
	    focusColor = UIManager.getColor(getPropertyPrefix() + "focus");
	    initialized = true;
	}
	if (XPStyle.getXP() != null) {
	    LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
	}
    
protected voidpaintFocus(java.awt.Graphics g, java.awt.Rectangle textRect, java.awt.Dimension d)

	g.setColor(getFocusColor());
	BasicGraphicsUtils.drawDashedRect(g, textRect.x, textRect.y, textRect.width, textRect.height);
    
protected voidpaintText(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text)
Overridden method to render the text without the mnemonic

	WindowsGraphicsUtils.paintText(g, b, textRect, text, getTextShiftOffset());