Package org.pushingpixels.substance.internal.painter

# Class BackgroundPaintingUtils

java.lang.Object
org.pushingpixels.substance.internal.painter.BackgroundPaintingUtils

public class BackgroundPaintingUtils extends Object
Delegate for painting filled backgrounds.

## Constructor Summary

Constructors
Constructor
Description
`BackgroundPaintingUtils()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`fillAndWatermark(Graphics g, JComponent c, Color fillColor, Rectangle rect)`
Updates the background of the specified component on the specified graphic context in the specified rectangle.
`static void`
`update(Graphics g, Component c, boolean force)`
Updates the background of the specified component on the specified graphic context.
`static void`
`update(Graphics g, Component c, boolean force, DecorationAreaType decorationType)`
Updates the background of the specified component on the specified graphic context.
`static void`
`updateIfOpaque(Graphics g, Component c)`
Updates the background of the specified component on the specified graphic context.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### BackgroundPaintingUtils

public BackgroundPaintingUtils()

## Method Details

### updateIfOpaque

public static void updateIfOpaque(Graphics g, Component c)
Updates the background of the specified component on the specified graphic context. The background is updated only if the component is opaque.

Parameters:
  `g` - Graphic context.
  `c` - Component.

### update

public static void update(Graphics g, Component c, boolean force)
Updates the background of the specified component on the specified graphic context. The background is not painted when the `force` parameter is `false` and at least one of the following conditions holds:

- The component is in a cell renderer.
- The component is not showing on the screen.
- The component is in the preview mode.

Parameters:
  `g` - Graphic context.
  `c` - Component.
  `force` - If `true`, the painting of background is enforced.

### update

public static void update(Graphics g, Component c, boolean force, DecorationAreaType decorationType)
Updates the background of the specified component on the specified graphic context. The background is not painted when the `force` parameter is `false` and at least one of the following conditions holds:

- The component is in a cell renderer.
- The component is not showing on the screen.
- The component is in the preview mode.

Parameters:
  `g` - Graphic context.
  `c` - Component.
  `force` - If `true`, the painting of background is enforced.
  `decorationType` - The decoration type to use. A `null` value will result in the component being asked.

### fillAndWatermark

public static void fillAndWatermark(Graphics g, JComponent c, Color fillColor, Rectangle rect)
Updates the background of the specified component on the specified graphic context in the specified rectangle.

Parameters:
  `g` - Graphic context.
  `c` - Component.
  `fillColor` - Fill color.
  `rect` - The rectangle to fill.