org.jdesktop.swingx.util
Class PaintUtils

java.lang.Object
  extended by org.jdesktop.swingx.util.PaintUtils

public class PaintUtils
extends java.lang.Object

A collection of utilties for painting visual effects.

Author:
Mark Davidson

Constructor Summary
PaintUtils()
           
 
Method Summary
static javax.swing.border.Border getDefaultBorder()
           
static java.awt.Rectangle getTextBounds(java.awt.Graphics g, javax.swing.JLabel label)
          Returns the bounds that the text of a label will be drawn into.
static void paintGradient(java.awt.Graphics g, javax.swing.JComponent comp, java.awt.Color color1, java.awt.Color color2)
          Paints a top to bottom gradient fill over the component bounds from color1 to color2.
static void setBackgroundColor(java.awt.Container cont, java.awt.Color color)
          Sets the background color for a containment hierarchy.
static void setFont(java.awt.Container cont, java.awt.Font font)
           
static void setForegroundColor(java.awt.Container cont, java.awt.Color color)
          Sets the foreground color for a containment hierarchy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaintUtils

public PaintUtils()
Method Detail

getDefaultBorder

public static javax.swing.border.Border getDefaultBorder()

getTextBounds

public static java.awt.Rectangle getTextBounds(java.awt.Graphics g,
                                               javax.swing.JLabel label)
Returns the bounds that the text of a label will be drawn into. Takes into account the current font metrics.


paintGradient

public static void paintGradient(java.awt.Graphics g,
                                 javax.swing.JComponent comp,
                                 java.awt.Color color1,
                                 java.awt.Color color2)
Paints a top to bottom gradient fill over the component bounds from color1 to color2.


setBackgroundColor

public static void setBackgroundColor(java.awt.Container cont,
                                      java.awt.Color color)
Sets the background color for a containment hierarchy.


setForegroundColor

public static void setForegroundColor(java.awt.Container cont,
                                      java.awt.Color color)
Sets the foreground color for a containment hierarchy.


setFont

public static void setFont(java.awt.Container cont,
                           java.awt.Font font)


Copyright © 2005 Sun Microsystems All Rights Reserved.