Class FractionBasedOutlinePainter

java.lang.Object
org.pushingpixels.radiance.theming.api.painter.FractionBasedPainter
org.pushingpixels.radiance.theming.api.painter.outline.FractionBasedOutlinePainter
All Implemented Interfaces:
RadianceOutlinePainter, RadianceTrait
Direct Known Subclasses:
FlatOutlinePainter, FlatVariantOutlinePainter, RadianceTabbedPaneUI.TabOutlinePainterDark, RadianceTabbedPaneUI.TabOutlinePainterLight

public class FractionBasedOutlinePainter extends FractionBasedPainter implements RadianceOutlinePainter
Outline painter with fraction-based stops and a color query associated with each stop. This class allows creating multi-gradient borders with exact control over which color is used at every gradient control point.
  • Constructor Details

    • FractionBasedOutlinePainter

      public FractionBasedOutlinePainter(String displayName, float[] fractions, ContainerColorTokensSingleColorQuery[] colorQueries)
      Creates a new fraction-based outline painter.
      Parameters:
      displayName - The display name of this painter.
      fractions - The fractions of this painter. Must be strictly increasing, starting from 0.0 and ending at 1.0.
      colorQueries - The color queries of this painter. Must have the same size as the fractions array, and all entries must be non- null.
    • FractionBasedOutlinePainter

      public FractionBasedOutlinePainter(String displayName, float[] fractions, int[] alphas, ContainerColorTokensSingleColorQuery[] colorQueries)
      Creates a new fraction-based outline painter.
      Parameters:
      displayName - The display name of this painter.
      fractions - The fractions of this painter. Must be strictly increasing, starting from 0.0 and ending at 1.0.
      alphas - Alpha channels of this painter. Must have the same size as fractions.
      colorQueries - The color queries of this painter. Must have the same size as the fractions array, and all entries must be non- null.
  • Method Details

    • paintOutline

      public void paintOutline(Graphics g, Component c, float width, float height, Shape outline, Shape innerOutline, ContainerColorTokens colorTokens)
      Description copied from interface: RadianceOutlinePainter
      Paints the outline.
      Specified by:
      paintOutline in interface RadianceOutlinePainter
      Parameters:
      g - Graphics.
      c - Component.
      width - Width of a UI component.
      height - Height of a UI component.
      outline - Primary outline to paint.
      innerOutline - Optional inner outline to paint. May be ignored if the specific implementation paints only the primary outline.
      colorTokens - The color tokens.
    • isPaintingInnerOutline

      public boolean isPaintingInnerOutline()
      Description copied from interface: RadianceOutlinePainter
      Returns boolean indication whether this outline painter is painting the inner outlines.
      Specified by:
      isPaintingInnerOutline in interface RadianceOutlinePainter
      Returns:
      true if this outline painter is painting the inner outlines, false otherwise.