org.jvnet.substance.title
Class ImageWrapperHeaderPainter

java.lang.Object
  extended by org.jvnet.substance.title.BaseHeaderPainter
      extended by org.jvnet.substance.title.ImageWrapperHeaderPainter
All Implemented Interfaces:
SubstanceHeaderPainter, SubstanceTitlePainter, SubstanceTrait
Direct Known Subclasses:
BrushedMetalHeaderPainter, MarbleNoiseHeaderPainter

public abstract class ImageWrapperHeaderPainter
extends BaseHeaderPainter

Implementation of SubstanceHeaderPainter that uses brushed metal painting on title panes.

Since:
version 4.0
Author:
Kirill Grouchnikov

Field Summary
protected  SubstanceTitlePainter baseTitlePainter
           
protected  java.util.LinkedHashMap<java.lang.String,java.awt.Image> colorizedTileMap
           
protected  boolean isPaintingSeparators
           
protected  ImageWrapperHeaderPainter secondaryTitlePainter
           
protected  java.awt.Image singleTile
           
protected  float textureAlpha
           
 
Fields inherited from class org.jvnet.substance.title.BaseHeaderPainter
isPaintingGeneralDecorationAreas, isPaintingToolbars
 
Constructor Summary
ImageWrapperHeaderPainter()
          Creates a new brushed metal header painter that is used to paint title panes, menubars and toolbars.
ImageWrapperHeaderPainter(boolean isPaintingToolbars, boolean isPaintingGeneralDecorationAreas)
          Creates a new brushed metal header painter
 
Method Summary
protected  java.awt.Image getColorizedTile(SubstanceTheme theme)
           
 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.
 void setBaseTitlePainter(SubstanceTitlePainter baseTitlePainter)
           
 void setPaintingSeparators(boolean isPaintingSeparators)
          Sets indication whether this painter paints separators.
 void setTextureAlpha(float textureAlpha)
           
protected  void tileArea(java.awt.Graphics2D g, java.awt.Component comp, SubstanceTheme tileTheme, int offsetTextureX, int offsetTextureY, int x, int y, int width, int height)
           
 
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
 
Methods inherited from interface org.jvnet.substance.title.SubstanceTitlePainter
getDisplayName
 

Field Detail

singleTile

protected java.awt.Image singleTile

baseTitlePainter

protected SubstanceTitlePainter baseTitlePainter

secondaryTitlePainter

protected ImageWrapperHeaderPainter secondaryTitlePainter

colorizedTileMap

protected java.util.LinkedHashMap<java.lang.String,java.awt.Image> colorizedTileMap

textureAlpha

protected float textureAlpha

isPaintingSeparators

protected boolean isPaintingSeparators
Constructor Detail

ImageWrapperHeaderPainter

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


ImageWrapperHeaderPainter

public ImageWrapperHeaderPainter(boolean isPaintingToolbars,
                                 boolean isPaintingGeneralDecorationAreas)
Creates a new brushed metal 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

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.

tileArea

protected void tileArea(java.awt.Graphics2D g,
                        java.awt.Component comp,
                        SubstanceTheme tileTheme,
                        int offsetTextureX,
                        int offsetTextureY,
                        int x,
                        int y,
                        int width,
                        int 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.

setBaseTitlePainter

public void setBaseTitlePainter(SubstanceTitlePainter baseTitlePainter)

setTextureAlpha

public void setTextureAlpha(float textureAlpha)

setPaintingSeparators

public void setPaintingSeparators(boolean isPaintingSeparators)
Sets indication whether this painter paints separators.

Parameters:
isPaintingSeparators - Indication whether this painter paints separators.

getColorizedTile

protected java.awt.Image getColorizedTile(SubstanceTheme theme)