org.formaria.swing.painter
Class GradientButtonPainter

java.lang.Object
  extended by org.formaria.swing.painter.GradientButtonPainter
Direct Known Subclasses:
GradientToggleButtonPainter, StripButtonPainter

public class GradientButtonPainter
extends java.lang.Object

A painter for button backgrounds.

Copyright (c) Formaria Ltd., 2008
License: see license.txt


Field Summary
static int NORMAL
           
static int NUM_STATES
           
static int PRESSED
           
static int PRESSED_SELECTED
           
static int ROLLOVER
           
static int ROLLOVER_SELECTED
           
static int SELECTED
           
 
Constructor Summary
GradientButtonPainter()
           
 
Method Summary
protected  java.awt.geom.Area getArea(javax.swing.JComponent obj, int w, int h)
          Get the Area of the client area
 void paint(java.awt.Graphics2D g, javax.swing.JComponent obj, int w, int h)
          Paints a background for a button
 void paint(java.awt.Graphics2D g, java.lang.Object object, int width, int height)
           
 void setSelectedHighlight(java.awt.Color c)
          Set the selected highlight color
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
See Also:
Constant Field Values

ROLLOVER

public static final int ROLLOVER
See Also:
Constant Field Values

PRESSED

public static final int PRESSED
See Also:
Constant Field Values

SELECTED

public static final int SELECTED
See Also:
Constant Field Values

ROLLOVER_SELECTED

public static final int ROLLOVER_SELECTED
See Also:
Constant Field Values

PRESSED_SELECTED

public static final int PRESSED_SELECTED
See Also:
Constant Field Values

NUM_STATES

public static final int NUM_STATES
See Also:
Constant Field Values
Constructor Detail

GradientButtonPainter

public GradientButtonPainter()
Method Detail

paint

public void paint(java.awt.Graphics2D g,
                  java.lang.Object object,
                  int width,
                  int height)

paint

public void paint(java.awt.Graphics2D g,
                  javax.swing.JComponent obj,
                  int w,
                  int h)
Paints a background for a button

Parameters:
g - the graphics context
obj - The object/component being painted
w - the width coordinate
h - the height coordinate

Copyright: Copyright (c) Formaria Ltd., 2008
License: see license.txt $Revision: 1.3 $


getArea

protected java.awt.geom.Area getArea(javax.swing.JComponent obj,
                                     int w,
                                     int h)
Get the Area of the client area

Parameters:
obj -
w -
h -
Returns:

setSelectedHighlight

public void setSelectedHighlight(java.awt.Color c)
Set the selected highlight color

Parameters:
c - the highlight color or null for no highlight.