If necessary paints the background of the component, then
invokes paint
.
boolean isOpaque = c.isOpaque();
if (g == null) {
throw new NullPointerException("Graphics must be non-null");
}
if (isOpaque && (c.getBackground() instanceof UIResource) &&
UIManager.get("MenuBar.gradient") != null) {
if (MetalToolBarUI.doesMenuBarBorderToolBar((JMenuBar)c)) {
JToolBar tb = (JToolBar)MetalToolBarUI.
findRegisteredComponentOfType(c, JToolBar.class);
if (tb.isOpaque() &&tb.getBackground() instanceof UIResource) {
MetalUtils.drawGradient(c, g, "MenuBar.gradient", 0, 0,
c.getWidth(), c.getHeight() +
tb.getHeight(), true);
paint(g, c);
return;
}
}
MetalUtils.drawGradient(c, g, "MenuBar.gradient", 0, 0,
c.getWidth(), c.getHeight(),true);
paint(g, c);
}
else {
super.update(g, c);
}