javax.swing.plaf.metal
Class MetalBorders.ButtonBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by javax.swing.plaf.metal.MetalBorders.ButtonBorder
All Implemented Interfaces:
Serializable, Border, UIResource
Direct Known Subclasses:
MetalBorders.RolloverButtonBorder, MetalBorders.ToggleButtonBorder
Enclosing class:
MetalBorders

public static class MetalBorders.ButtonBorder
extends AbstractBorder
implements UIResource

A border used for JButton components.

This Border implementation can handle only instances of AbstractButton and their subclasses.

If the Metal Look and Feel's current theme is 'Ocean' the border will be painted with a special highlight when the mouse cursor if over the button (ie. the property rollover of the button's model is true) and is not a direct child of a JToolBar.

See Also:
Serialized Form

Field Summary
protected static Insets borderInsets
          The borders insets.
 
Constructor Summary
MetalBorders.ButtonBorder()
          Creates a new instance of ButtonBorder.
 
Method Summary
 Insets getBorderInsets(Component c)
          Returns the insets of the ButtonBorder.
 Insets getBorderInsets(Component c, Insets newInsets)
          Returns the insets of the ButtonBorder in the specified newInsets object.
 void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
          Paints the button border.
 
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 borders insets.

Constructor Detail

MetalBorders.ButtonBorder

public MetalBorders.ButtonBorder()
Creates a new instance of ButtonBorder.

Method Detail

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int w,
                        int h)
Paints the button border.

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

getBorderInsets

public Insets getBorderInsets(Component c)
Returns the insets of the ButtonBorder.

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

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets newInsets)
Returns the insets of the ButtonBorder in the specified newInsets object.

Overrides:
getBorderInsets in class AbstractBorder
Parameters:
c - the component for which the border is used (ignored).
newInsets - the insets object where to put the values ( null not permitted).
Returns:
The newInsets reference.
See Also:
AbstractBorder.getBorderInsets(Component)