Class ImageWrapperDecorationPainter
- java.lang.Object
-
- org.pushingpixels.substance.api.painter.decoration.ImageWrapperDecorationPainter
-
- All Implemented Interfaces:
SubstanceDecorationPainter,SubstanceTrait
- Direct Known Subclasses:
BrushedMetalDecorationPainter,MarbleNoiseDecorationPainter
public abstract class ImageWrapperDecorationPainter extends Object implements SubstanceDecorationPainter
Implementation ofSubstanceDecorationPainterthat uses brushed metal painting on decoration areas.- Since:
- version 4.3
-
-
Field Summary
Fields Modifier and Type Field Description protected SubstanceDecorationPainterbaseDecorationPainterThe base decoration painter - the colorized image tiles are painted over the painting of this painter.protected LinkedHashMap<String,Image>colorizedTileMapMap of colorized tiles.protected ImageoriginalTileContains the original (not colorized) image of this painter.protected floattextureAlphaAlpha channel for the texture image (colorized tiles applied on top of thebaseDecorationPainterpainting).
-
Constructor Summary
Constructors Constructor Description ImageWrapperDecorationPainter()Creates a new image wrapper decoration painter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ImagegetColorizedTile(SubstanceColorScheme scheme)Returns a colorized image tile.voidpaintDecorationArea(Graphics2D graphics, Component comp, DecorationAreaType decorationAreaType, int width, int height, SubstanceSkin skin)Paints the decoration area.voidsetBaseDecorationPainter(SubstanceDecorationPainter baseDecorationPainter)Sets the base decoration painter.voidsetTextureAlpha(float textureAlpha)Sets the alpha channel for the image texture.protected voidtileArea(Graphics2D g, Component comp, SubstanceColorScheme tileScheme, int offsetTextureX, int offsetTextureY, int x, int y, int width, int height)Tiles the specified area with colorized version of the image tile.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pushingpixels.substance.api.trait.SubstanceTrait
getDisplayName
-
-
-
-
Field Detail
-
originalTile
protected Image originalTile
Contains the original (not colorized) image of this painter.
-
baseDecorationPainter
protected SubstanceDecorationPainter baseDecorationPainter
The base decoration painter - the colorized image tiles are painted over the painting of this painter. Can benull.
-
colorizedTileMap
protected LinkedHashMap<String,Image> colorizedTileMap
Map of colorized tiles.
-
textureAlpha
protected float textureAlpha
Alpha channel for the texture image (colorized tiles applied on top of thebaseDecorationPainterpainting).
-
-
Method Detail
-
paintDecorationArea
public void paintDecorationArea(Graphics2D graphics, Component comp, DecorationAreaType decorationAreaType, int width, int height, SubstanceSkin skin)
Description copied from interface:SubstanceDecorationPainterPaints the decoration area.- Specified by:
paintDecorationAreain interfaceSubstanceDecorationPainter- Parameters:
graphics- Graphics context.comp- Component.decorationAreaType- Decoration area type. Must not benull.width- Width.height- Height.skin- Skin for painting the decoration area.
-
tileArea
protected void tileArea(Graphics2D g, Component comp, SubstanceColorScheme tileScheme, int offsetTextureX, int offsetTextureY, int x, int y, int width, int height)
Tiles the specified area with colorized version of the image tile. This is called after thebaseDecorationPainterhas painted the area. This method should respect the currenttextureAlphavalue.- Parameters:
g- Graphic context.comp- Component.tileScheme- Scheme for the tile colorization.offsetTextureX- X offset for the tiling.offsetTextureY- Y offset for the tiling.x- X coordinate of the tiling region.y- Y coordinate of the tiling region.width- Width of the tiling region.height- Height of the tiling region.
-
setBaseDecorationPainter
public void setBaseDecorationPainter(SubstanceDecorationPainter baseDecorationPainter)
Sets the base decoration painter.- Parameters:
baseDecorationPainter- Base decoration painter.
-
setTextureAlpha
public void setTextureAlpha(float textureAlpha)
Sets the alpha channel for the image texture.- Parameters:
textureAlpha- Alpha channel for the image texture.
-
getColorizedTile
protected Image getColorizedTile(SubstanceColorScheme scheme)
Returns a colorized image tile.- Parameters:
scheme- Color scheme for the colorization.- Returns:
- Colorized tile.
-
-