* @param g must not be null
* @param the bounds to fill, may be null to indicate the complete size
*/
public static void update(SynthContext context, Graphics g, Rectangle bounds) {
JComponent c = context.getComponent();
SynthStyle style = context.getStyle();
int x, y, width, height;
if (bounds == null) {
x = 0;
y = 0;
width = c.getWidth();
height = c.getHeight();
} else {
x = bounds.x;
y = bounds.y;
width = bounds.width;
height = bounds.height;
}
// Fill in the background, if necessary.
boolean subregion = context.getRegion().isSubregion();
if ((subregion && style.isOpaque(context))
|| (!subregion && c.isOpaque())) {
g.setColor(style.getColor(context, ColorType.BACKGROUND));
g.fillRect(x, y, width, height);
}
}