org.jvnet.substance.title
Class ClassicTitlePainter

java.lang.Object
  extended by org.jvnet.substance.title.ClassicTitlePainter
All Implemented Interfaces:
SubstanceTitlePainter, SubstanceTrait

public class ClassicTitlePainter
extends java.lang.Object
implements SubstanceTitlePainter

Title painter that paints a classic gradient. This class is part of officially supported API.

Author:
Kirill Grouchnikov

Field Summary
static java.lang.String DISPLAY_NAME
          The display name for the title painters of this class.
protected  ClassicGradientPainter painter
          Single gradient painter instance.
protected static java.util.Map<java.lang.String,java.awt.image.BufferedImage> smallImageCache
          Cache for small objects.
 
Constructor Summary
ClassicTitlePainter()
          Creates new classic title painter.
 
Method Summary
 java.lang.String getDisplayName()
          Returns the display name of this trait.
protected  void internalPaint(java.awt.Graphics2D graphics, int width, int height, int leftTitleX, int rightTitleX, SubstanceTheme theme, float borderAlpha)
          Paints the title background.
 void paintTitleBackground(java.awt.Graphics2D graphics, java.awt.Component comp, int width, int height, int leftTitleX, int rightTitleX, SubstanceTheme theme, float borderAlpha)
          Paints the title background.
static void reset()
          Resets image maps (used when setting new theme).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAY_NAME

public static final java.lang.String DISPLAY_NAME
The display name for the title painters of this class.

See Also:
Constant Field Values

smallImageCache

protected static java.util.Map<java.lang.String,java.awt.image.BufferedImage> smallImageCache
Cache for small objects.


painter

protected ClassicGradientPainter painter
Single gradient painter instance.

Constructor Detail

ClassicTitlePainter

public ClassicTitlePainter()
Creates new classic title painter.

Method Detail

getDisplayName

public java.lang.String getDisplayName()
Description copied from interface: SubstanceTrait
Returns the display name of this trait. This method is part of officially supported API.

Specified by:
getDisplayName in interface SubstanceTitlePainter
Specified by:
getDisplayName in interface SubstanceTrait
Returns:
The display name of this trait.

paintTitleBackground

public void paintTitleBackground(java.awt.Graphics2D graphics,
                                 java.awt.Component comp,
                                 int width,
                                 int height,
                                 int leftTitleX,
                                 int rightTitleX,
                                 SubstanceTheme theme,
                                 float borderAlpha)
Description copied from interface: SubstanceTitlePainter
Paints the title background.

Specified by:
paintTitleBackground in interface SubstanceTitlePainter
Parameters:
graphics - Graphics context.
comp - Component.
width - Width.
height - Height.
leftTitleX - Title start poisition.
rightTitleX - Title end position.
theme - Substance theme for painting the title packground.
borderAlpha - Border alpha factor.

internalPaint

protected void internalPaint(java.awt.Graphics2D graphics,
                             int width,
                             int height,
                             int leftTitleX,
                             int rightTitleX,
                             SubstanceTheme theme,
                             float borderAlpha)
Paints the title background.

Parameters:
graphics - Graphics context.
width - Width.
height - Height.
leftTitleX - Title start poisition.
rightTitleX - Title end position.
theme - Substance theme for painting the title packground.
borderAlpha - Border alpha.

reset

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

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