javax.swing.plaf.metal
Class MetalBorders.PopupMenuBorder

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

public static class MetalBorders.PopupMenuBorder
extends AbstractBorder
implements UIResource

A border implementation for popup menus.

See Also:
Serialized Form

Field Summary
protected static Insets borderInsets
          The border's insets.
 
Constructor Summary
MetalBorders.PopupMenuBorder()
          Constructs a new PopupMenuBorder.
 
Method Summary
 Insets getBorderInsets(Component c)
          Returns the insets of the border, creating a new Insets instance with each call.
 Insets getBorderInsets(Component c, Insets i)
          Returns the insets of the border, using the supplied Insets instance.
 void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
          Paints the border for component c using the Graphics context g with the dimension x, y, w, h.
 
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's insets.

Constructor Detail

MetalBorders.PopupMenuBorder

public MetalBorders.PopupMenuBorder()
Constructs a new PopupMenuBorder.

Method Detail

getBorderInsets

public Insets getBorderInsets(Component c)
Returns the insets of the border, creating a new Insets instance with each call.

Specified by:
getBorderInsets in interface Border
Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component for which we return the border insets (not used here)
Returns:
an Insets object whose left, right, top and bottom fields indicate the width of the border at the respective edge, which is zero for the default implementation provided by AbstractButton.
See Also:
AbstractBorder.getBorderInsets(java.awt.Component, java.awt.Insets)

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets i)
Returns the insets of the border, using the supplied Insets instance.

Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component for which we return the border insets (not used here)
i - the Insets instance to fill with the Insets values
Returns:
The border insets (the same object that was passed as the insets argument).
See Also:
AbstractBorder.getBorderInsets(Component)

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int w,
                        int h)
Paints the border for component c using the Graphics context g with the dimension x, y, w, h.

Specified by:
paintBorder in interface Border
Overrides:
paintBorder in class AbstractBorder
Parameters:
c - the component for which we paint the border
g - the Graphics context to use
x - the X coordinate of the upper left corner of c
y - the Y coordinate of the upper left corner of c
w - the width of c
h - the height of c