Part part = getXPButtonType(b);
if (b.isContentAreaFilled() && xp != null) {
Skin skin = xp.getSkin(b, part);
State state = getXPButtonState(b);
Dimension d = c.getSize();
int dx = 0;
int dy = 0;
int dw = d.width;
int dh = d.height;
Border border = c.getBorder();
Insets insets;
if (border != null) {
// Note: The border may be compound, containing an outer
// opaque border (supplied by the application), plus an
// inner transparent margin border. We want to size the
// background to fill the transparent part, but stay
// inside the opaque part.
insets = WindowsButtonUI.getOpaqueInsets(border, c);
} else {
insets = c.getInsets();
}
if (insets != null) {
dx += insets.left;
dy += insets.top;
dw -= (insets.left + insets.right);
dh -= (insets.top + insets.bottom);
}
skin.paintSkin(g, dx, dy, dw, dh, state);
}
}