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.
  • Field Details

    • originalTile

      protected Image originalTile
      Contains the original (not colorized) image of this painter.
    • baseDecorationPainter

      protected RadianceDecorationPainter baseDecorationPainter
      The base decoration painter - the colorized image tiles are painted over the painting of this painter. Can be null.
    • colorizedTileMap

      protected LinkedHashMap<String, BufferedImage> colorizedTileMap
      Map of colorized tiles.
    • textureAlpha

      protected float textureAlpha
      Alpha channel for the texture image (colorized tiles applied on top of the baseDecorationPainter painting).
  • 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: RadianceDecorationPainter
      Paints the decoration area as a fully filled rectangle.
      Specified by:
      paintDecorationArea in interface RadianceDecorationPainter
      Parameters:
      graphics - Graphics context.
      comp - Component.
      decorationAreaType - Decoration area type. Must not be null.
      width - Width.
      height - Height.
      skin - Skin for painting the decoration area.
    • paintTitleBackground

      private void paintTitleBackground(Graphics2D graphics, Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceSkin skin)
      Paints the title background.
      Parameters:
      graphics - Graphics context.
      comp - Component.
      decorationAreaType - Decoration area type. Must not be null.
      width - Width.
      height - Height.
      skin - Skin for painting the title background.
    • paintExtraBackground

      private void paintExtraBackground(Graphics2D graphics, Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceSkin skin)
      Paints the background of non-title decoration areas.
      Parameters:
      graphics - Graphics context.
      comp - Component.
      decorationAreaType - Decoration area type. Must not be null.
      width - Width.
      height - Height.
      skin - Skin for painting the background of non-title decoration areas.
    • paintDecorationArea

      public void paintDecorationArea(Graphics2D graphics, Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, Shape outline, ContainerColorTokens colorTokens)
      Description copied from interface: RadianceDecorationPainter
      Paints the decoration area as a specified shape.
      Specified by:
      paintDecorationArea in interface RadianceDecorationPainter
      Parameters:
      graphics - Graphics context.
      comp - Component.
      decorationAreaType - Decoration area type. Must not be null.
      outline - Outline to paint.
      colorTokens - Color tokens for painting the outline.
    • tileArea

      private void tileArea(Graphics2D g, Component comp, ContainerColorTokens tileContainerTokens, int offsetTextureX, int offsetTextureY, int width, int height)
    • setBaseDecorationPainter

      public void setBaseDecorationPainter(RadianceDecorationPainter 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 BufferedImage getColorizedTile(double scale, ContainerColorTokens colorTokens)
      Returns a colorized image tile.
      Parameters:
      colorTokens - Color tokens for the colorization.
      Returns:
      Colorized tile.