javax.swing.plaf.metal

Class MetalBorders.MenuItemBorder

public static class MetalBorders.MenuItemBorder extends AbstractBorder implements UIResource

A border used for {@link JMenu} and {@link JMenuItem} components.
Field Summary
protected static InsetsborderInsets
The border insets.
Constructor Summary
MenuItemBorder()
Creates a new border instance.
Method Summary
InsetsgetBorderInsets(Component c)
Returns the border insets.
InsetsgetBorderInsets(Component c, Insets insets)
Populates insets with the border insets, then returns it.
voidpaintBorder(Component c, Graphics g, int x, int y, int w, int h)
Paints the border for the component.

Field Detail

borderInsets

protected static Insets borderInsets
The border insets.

Constructor Detail

MenuItemBorder

public MenuItemBorder()
Creates a new border instance.

Method Detail

getBorderInsets

public Insets getBorderInsets(Component c)
Returns the border insets.

Parameters: c the component (ignored).

Returns: The border insets.

getBorderInsets

public Insets getBorderInsets(Component c, Insets insets)
Populates insets with the border insets, then returns it.

Parameters: c the component (ignored). insets the object to populate with the border insets.

Returns: The border insets.

Throws: NullPointerException if insets is null.

paintBorder

public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
Paints the border for the component. A border is painted only if the component is a selected {@link JMenu} or an armed {@link JMenuItem}.

Parameters: c the component. g the graphics device. x the x-coordinate of the border area. y the y-coordinate of the border area. w the width of the border area. h the height of the border area.