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 java.lang.Object implements SubstanceDecorationPainter
Implementation ofSubstanceDecorationPainterthat uses an image source to paint on decoration areas.
-
-
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 java.util.LinkedHashMap<java.lang.String,java.awt.image.BufferedImage>colorizedTileMapMap of colorized tiles.protected java.awt.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 java.awt.image.BufferedImagegetColorizedTile(double scale, SubstanceColorScheme scheme)Returns a colorized image tile.voidpaintDecorationArea(java.awt.Graphics2D graphics, java.awt.Component comp, SubstanceSlices.DecorationAreaType decorationAreaType, int width, int height, SubstanceSkin skin)Paints the decoration area as a fully filled rectangle.voidpaintDecorationArea(java.awt.Graphics2D graphics, java.awt.Component comp, SubstanceSlices.DecorationAreaType decorationAreaType, java.awt.Shape contour, SubstanceColorScheme colorScheme)Paints the decoration area as a specified shape.voidsetBaseDecorationPainter(SubstanceDecorationPainter baseDecorationPainter)Sets the base decoration painter.voidsetTextureAlpha(float textureAlpha)Sets the alpha channel for the image texture.-
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 java.awt.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 java.util.LinkedHashMap<java.lang.String,java.awt.image.BufferedImage> 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(java.awt.Graphics2D graphics, java.awt.Component comp, SubstanceSlices.DecorationAreaType decorationAreaType, int width, int height, SubstanceSkin skin)Description copied from interface:SubstanceDecorationPainterPaints the decoration area as a fully filled rectangle.- 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.
-
paintDecorationArea
public void paintDecorationArea(java.awt.Graphics2D graphics, java.awt.Component comp, SubstanceSlices.DecorationAreaType decorationAreaType, java.awt.Shape contour, SubstanceColorScheme colorScheme)Description copied from interface:SubstanceDecorationPainterPaints the decoration area as a specified shape.- Specified by:
paintDecorationAreain interfaceSubstanceDecorationPainter- Parameters:
graphics- Graphics context.comp- Component.decorationAreaType- Decoration area type. Must not benull.contour- Contour to fill.colorScheme- Color scheme for painting the decoration area.
-
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 java.awt.image.BufferedImage getColorizedTile(double scale, SubstanceColorScheme scheme)Returns a colorized image tile.- Parameters:
scheme- Color scheme for the colorization.- Returns:
- Colorized tile.
-
-