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.
-
-
Field Summary
-
Fields inherited from class org.pushingpixels.radiance.theming.api.painter.FractionBasedPainter
alphas, colorQueries, fractions
-
-
Constructor Summary
Constructors Constructor Description FractionBasedOutlinePainter(java.lang.String displayName, float[] fractions, int[] alphas, ContainerColorTokensSingleColorQuery[] colorQueries)Creates a new fraction-based outline painter.FractionBasedOutlinePainter(java.lang.String displayName, float[] fractions, ContainerColorTokensSingleColorQuery[] colorQueries)Creates a new fraction-based outline painter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisPaintingInnerOutline()Returns boolean indication whether this outline painter is painting the inner outlines.voidpaintOutline(java.awt.Graphics g, java.awt.Component c, float width, float height, java.awt.Shape outline, java.awt.Shape innerOutline, ContainerColorTokens colorTokens)Paints the outline.-
Methods inherited from class org.pushingpixels.radiance.theming.api.painter.FractionBasedPainter
getAlphas, getColorQueries, getDisplayName, getFractions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pushingpixels.radiance.theming.api.trait.RadianceTrait
getDisplayName
-
-
-
-
Constructor Detail
-
FractionBasedOutlinePainter
public FractionBasedOutlinePainter(java.lang.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(java.lang.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 Detail
-
paintOutline
public void paintOutline(java.awt.Graphics g, java.awt.Component c, float width, float height, java.awt.Shape outline, java.awt.Shape innerOutline, ContainerColorTokens colorTokens)Description copied from interface:RadianceOutlinePainterPaints the outline.- Specified by:
paintOutlinein interfaceRadianceOutlinePainter- 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:RadianceOutlinePainterReturns boolean indication whether this outline painter is painting the inner outlines.- Specified by:
isPaintingInnerOutlinein interfaceRadianceOutlinePainter- Returns:
trueif this outline painter is painting the inner outlines,falseotherwise.
-
-