javax.swing.plaf.metal
Class MetalBorders.MenuItemBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by javax.swing.plaf.metal.MetalBorders.MenuItemBorder
All Implemented Interfaces:
Serializable, Border, UIResource
Enclosing class:
MetalBorders

public static class MetalBorders.MenuItemBorder
extends AbstractBorder
implements UIResource

A border used for JMenu and JMenuItem components.

See Also:
Serialized Form

Field Summary
protected static Insets borderInsets
          The border insets.
 
Constructor Summary
MetalBorders.MenuItemBorder()
          Creates a new border instance.
 
Method Summary
 Insets getBorderInsets(Component c)
          Returns the border insets.
 Insets getBorderInsets(Component c, Insets insets)
          Populates insets with the border insets, then returns it.
 void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
          Paints the border for the component.
 
Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle, getInteriorRectangle, isBorderOpaque
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

borderInsets

protected static Insets borderInsets
The border insets.

Constructor Detail

MetalBorders.MenuItemBorder

public MetalBorders.MenuItemBorder()
Creates a new border instance.

Method Detail

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 JMenu or an armed JMenuItem.

Specified by:
paintBorder in interface Border
Overrides:
paintBorder in class AbstractBorder
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.

getBorderInsets

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

Specified by:
getBorderInsets in interface Border
Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component (ignored).
Returns:
The border insets.
See Also:
AbstractBorder.getBorderInsets(java.awt.Component, java.awt.Insets)

getBorderInsets

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

Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component (ignored).
insets - the object to populate with the border insets.
Returns:
The border insets.
Throws:
NullPointerException - if insets is null.
See Also:
AbstractBorder.getBorderInsets(Component)