/**
* @see javax.swing.plaf.ComponentUI#update(java.awt.Graphics, javax.swing.JComponent)
*/
public void update(Graphics g, JComponent c) {
SeaGlassContext context = getContext(c);
SeaGlassLookAndFeel.update(context, g);
if (((JRootPane) c).getWindowDecorationStyle() != JRootPane.NONE) {
context.getPainter().paintRootPaneBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
} else if (PlatformUtils.isMac()) {
// We may need to paint the rootpane on a Mac if the window is
// decorated.
boolean shouldPaint = false;
Container toplevelContainer = c.getParent();
if (toplevelContainer instanceof JFrame) {
shouldPaint = !((JFrame) toplevelContainer).isUndecorated();
}
if (shouldPaint) {
if (!paintTextured) {
g.setColor(c.getBackground());
g.fillRect(0, 0, c.getWidth(), c.getHeight());
} else if (isWindowFocused.isInState(c)) {
contentActive.paint((Graphics2D) g, c, c.getWidth(), c.getHeight());
} else {
contentInactive.paint((Graphics2D) g, c, c.getWidth(), c.getHeight());
}
}
}
paint(context, g);
context.dispose();
}