Class ImageWrapperDecorationPainter
java.lang.Object
org.pushingpixels.radiance.theming.api.painter.decoration.ImageWrapperDecorationPainter
- All Implemented Interfaces:
RadianceDecorationPainter, RadianceTrait
- Direct Known Subclasses:
BrushedMetalDecorationPainter, MarbleNoiseDecorationPainter
public abstract class ImageWrapperDecorationPainter
extends Object
implements RadianceDecorationPainter
Implementation of
RadianceDecorationPainter that uses an image source to paint on
decoration areas.- Author:
- Kirill Grouchnikov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RadianceDecorationPainterThe base decoration painter - the colorized image tiles are painted over the painting of this painter.protected LinkedHashMap<String, BufferedImage> Map of colorized tiles.protected ImageContains the original (not colorized) image of this painter.protected floatAlpha channel for the texture image (colorized tiles applied on top of thebaseDecorationPainterpainting). -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new image wrapper decoration painter. -
Method Summary
Modifier and TypeMethodDescriptionprotected BufferedImagegetColorizedTile(double scale, ContainerColorTokens colorTokens) Returns a colorized image tile.voidpaintDecorationArea(Graphics2D graphics, Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceSkin skin) Paints the decoration area as a fully filled rectangle.voidpaintDecorationArea(Graphics2D graphics, Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, Shape outline, ContainerColorTokens colorTokens) Paints the decoration area as a specified shape.voidsetBaseDecorationPainter(RadianceDecorationPainter baseDecorationPainter) Sets the base decoration painter.voidsetTextureAlpha(float textureAlpha) Sets the alpha channel for the image texture.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RadianceTrait
getDisplayName
-
Field Details
-
originalTile
Contains the original (not colorized) image of this painter. -
baseDecorationPainter
The base decoration painter - the colorized image tiles are painted over the painting of this painter. Can benull. -
colorizedTileMap
Map of colorized tiles. -
textureAlpha
protected float textureAlphaAlpha channel for the texture image (colorized tiles applied on top of thebaseDecorationPainterpainting).
-
-
Constructor Details
-
ImageWrapperDecorationPainter
public ImageWrapperDecorationPainter()Creates a new image wrapper decoration painter.
-
-
Method Details
-
paintDecorationArea
public void paintDecorationArea(Graphics2D graphics, Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceSkin skin) Description copied from interface:RadianceDecorationPainterPaints the decoration area as a fully filled rectangle.- Specified by:
paintDecorationAreain interfaceRadianceDecorationPainter- 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(Graphics2D graphics, Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, Shape outline, ContainerColorTokens colorTokens) Description copied from interface:RadianceDecorationPainterPaints the decoration area as a specified shape.- Specified by:
paintDecorationAreain interfaceRadianceDecorationPainter- Parameters:
graphics- Graphics context.comp- Component.decorationAreaType- Decoration area type. Must not benull.outline- Outline to paint.colorTokens- Color tokens for painting the outline.
-
setBaseDecorationPainter
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
Returns a colorized image tile.- Parameters:
colorTokens- Color tokens for the colorization.- Returns:
- Colorized tile.
-