org.jvnet.substance.title
Class MatteHeaderPainter

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

public class MatteHeaderPainter
extends BaseHeaderPainter

Implementation of SubstanceHeaderPainter that uses matte painting on title panes.

Author:
Kirill Grouchnikov

Field Summary
static java.lang.String DISPLAY_NAME
          The display name for the header painters of this class.
 
Fields inherited from class org.jvnet.substance.title.BaseHeaderPainter
isPaintingGeneralDecorationAreas
 
Constructor Summary
MatteHeaderPainter()
          Creates a new matte header painter that is used to paint title panes, menubars and toolbars.
MatteHeaderPainter(boolean isPaintingToolbars, boolean isPaintingGeneralDecorationAreas)
          Creates a new matte header painter
 
Method Summary
protected  void fill(java.awt.Graphics2D graphics, ColorScheme scheme, int offsetY, int x, int y, int width, int height)
          Fills the relevant part with the gradient fill.
 java.lang.String getDisplayName()
          Returns the display name of this trait.
 SubstanceTitlePainter getSecondaryPainter()
          Returns the secondary painter which is used for painting areas that do not have the painting of title pane (currently used for menu items).
 void paintExtraBackground(java.awt.Graphics2D graphics, java.awt.Container parent, java.awt.Component comp, int width, int height, SubstanceTheme theme, boolean hasDarkBorder)
          Paints background of non-title pane content (such as menubars and toolbars).
 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.
 
Methods inherited from class org.jvnet.substance.title.BaseHeaderPainter
isPaintingContainer, isPaintingToolbarDropShadows, setPaintingGeneralDecorationAreas, setPaintingToolbarDropShadows, setPaintingToolbars
 
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 header painters of this class.

See Also:
Constant Field Values
Constructor Detail

MatteHeaderPainter

public MatteHeaderPainter()
Creates a new matte header painter that is used to paint title panes, menubars and toolbars.


MatteHeaderPainter

public MatteHeaderPainter(boolean isPaintingToolbars,
                          boolean isPaintingGeneralDecorationAreas)
Creates a new matte header painter

Parameters:
isPaintingToolbars - If true, this painter will be used to paint toolbars in addition to painting title panes and menubars.
isPaintingGeneralDecorationAreas - If true, this painter will be used to paint additional general decoration areas.
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.

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.

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.

paintExtraBackground

public void paintExtraBackground(java.awt.Graphics2D graphics,
                                 java.awt.Container parent,
                                 java.awt.Component comp,
                                 int width,
                                 int height,
                                 SubstanceTheme theme,
                                 boolean hasDarkBorder)
Description copied from interface: SubstanceHeaderPainter
Paints background of non-title pane content (such as menubars and toolbars).

Parameters:
graphics - Graphics context.
parent - Component parent.
comp - Component.
width - Area width to paint.
height - Area height to paint.
theme - Theme to use for painting.
hasDarkBorder - Indicates whether a border should be added to the resulting painting.

fill

protected void fill(java.awt.Graphics2D graphics,
                    ColorScheme scheme,
                    int offsetY,
                    int x,
                    int y,
                    int width,
                    int height)
Fills the relevant part with the gradient fill.

Parameters:
graphics - Graphics.
scheme - Color scheme to use.
offsetY - Vertical offset.
x - X coordinate of the fill area.
y - Y coordinate of the fill area.
width - Fill area width.
height - Fill area height.

getSecondaryPainter

public SubstanceTitlePainter getSecondaryPainter()
Description copied from interface: SubstanceHeaderPainter
Returns the secondary painter which is used for painting areas that do not have the painting of title pane (currently used for menu items).

Returns:
The secondary painter.