org.jvnet.substance.utils
Class PairwiseButtonBackgroundDelegate

java.lang.Object
  extended by org.jvnet.substance.utils.PairwiseButtonBackgroundDelegate

public class PairwiseButtonBackgroundDelegate
extends java.lang.Object

Delegate class for painting backgrounds of buttons in Substance look and feel. This class is for internal use only.

Author:
Kirill Grouchnikov

Nested Class Summary
static class PairwiseButtonBackgroundDelegate.ButtonBackground
          Contains information on a button background.
 
Constructor Summary
PairwiseButtonBackgroundDelegate()
          Simple constructor.
 
Method Summary
static java.awt.image.BufferedImage getPairwiseBackground(javax.swing.AbstractButton button, SubstanceGradientPainter painter, int width, int height, SubstanceConstants.Side side, boolean toIgnoreOpenSides)
          Retrieves background image for the specified button in button pair (such as scrollbar arrows, for example).
static void reset()
          Resets image maps (used when setting new theme).
static void updateBackground(java.awt.Graphics g, javax.swing.AbstractButton button, SubstanceConstants.Side side)
          Updates background of the specified button.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PairwiseButtonBackgroundDelegate

public PairwiseButtonBackgroundDelegate()
Simple constructor.

Method Detail

reset

public static void reset()
Resets image maps (used when setting new theme).

See Also:
SubstanceLookAndFeel.setCurrentTheme(String), SubstanceLookAndFeel.setCurrentTheme(SubstanceTheme)

getPairwiseBackground

public static java.awt.image.BufferedImage getPairwiseBackground(javax.swing.AbstractButton button,
                                                                 SubstanceGradientPainter painter,
                                                                 int width,
                                                                 int height,
                                                                 SubstanceConstants.Side side,
                                                                 boolean toIgnoreOpenSides)
Retrieves background image for the specified button in button pair (such as scrollbar arrows, for example).

Parameters:
button - Button.
painter - Gradient painter.
width - Button width.
height - Button height.
side - Button orientation.
toIgnoreOpenSides - If true, the open side setting (controlled by the SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY is ignored.
Returns:
Button background image.

updateBackground

public static void updateBackground(java.awt.Graphics g,
                                    javax.swing.AbstractButton button,
                                    SubstanceConstants.Side side)
Updates background of the specified button.

Parameters:
g - Graphic context.
button - Button to update.
side - Button side.