javax.swing.plaf.metal

Class MetalCheckBoxIcon

public class MetalCheckBoxIcon extends Object implements Icon, UIResource, Serializable

An {@link Icon} used by the {@link MetalCheckBoxUI} class.
Constructor Summary
MetalCheckBoxIcon()
Creates a new MetalCheckBoxIcon instance.
Method Summary
protected voiddrawCheck(Component c, Graphics g, int x, int y)
Draws the check in the CheckBox.
protected intgetControlSize()
Returns the size (both X and Y) of the checkbox icon.
intgetIconHeight()
Returns the height of the icon in pixels.
intgetIconWidth()
Returns the width of the icon in pixels.
voidpaintIcon(Component c, Graphics g, int x, int y)
Paints the icon.

Constructor Detail

MetalCheckBoxIcon

public MetalCheckBoxIcon()
Creates a new MetalCheckBoxIcon instance.

Method Detail

drawCheck

protected void drawCheck(Component c, Graphics g, int x, int y)
Draws the check in the CheckBox.

Parameters: c the component to draw on g the Graphics context to draw with x the X position y the Y position

getControlSize

protected int getControlSize()
Returns the size (both X and Y) of the checkbox icon.

Returns: the size of the checkbox icon

getIconHeight

public int getIconHeight()
Returns the height of the icon in pixels.

Returns: the height of the icon in pixels

getIconWidth

public int getIconWidth()
Returns the width of the icon in pixels.

Returns: the width of the icon in pixels

paintIcon

public void paintIcon(Component c, Graphics g, int x, int y)
Paints the icon. This first paints the border of the CheckBox and if the CheckBox is selected it calls {@link #drawCheck} to draw the check.

Parameters: c the Component to draw on (gets casted to JCheckBox) g the Graphics context to draw with x the X position y the Y position