org.jvnet.substance.painter.utils
Class BackgroundPaintingUtils

java.lang.Object
  extended by org.jvnet.substance.painter.utils.BackgroundPaintingUtils

public class BackgroundPaintingUtils
extends java.lang.Object

Delegate for painting filled backgrounds.

Author:
Kirill Grouchnikov

Constructor Summary
BackgroundPaintingUtils()
           
 
Method Summary
static void fillAndWatermark(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Color fillColor, java.awt.Rectangle rect)
          Updates the background of the specified component on the specified graphic context in the specified rectangle.
static void update(java.awt.Graphics g, java.awt.Component c, boolean force)
          Updates the background of the specified component on the specified graphic context.
static void updateIfOpaque(java.awt.Graphics g, java.awt.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 Detail

BackgroundPaintingUtils

public BackgroundPaintingUtils()
Method Detail

updateIfOpaque

public static void updateIfOpaque(java.awt.Graphics g,
                                  java.awt.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(java.awt.Graphics g,
                          java.awt.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:

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

fillAndWatermark

public static void fillAndWatermark(java.awt.Graphics g,
                                    javax.swing.JComponent c,
                                    java.awt.Color fillColor,
                                    java.awt.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.