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 FractionBasedPainter
alphas, colorQueries, fractions -
Constructor Summary
ConstructorsConstructorDescriptionFractionBasedOutlinePainter(String displayName, float[] fractions, int[] alphas, ContainerColorTokensSingleColorQuery[] colorQueries) Creates a new fraction-based outline painter.FractionBasedOutlinePainter(String displayName, float[] fractions, ContainerColorTokensSingleColorQuery[] colorQueries) Creates a new fraction-based outline painter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns boolean indication whether this outline painter is painting the inner outlines.voidpaintOutline(Graphics g, Component c, float width, float height, Shape outline, Shape innerOutline, ContainerColorTokens colorTokens) Paints the outline.Methods inherited from class FractionBasedPainter
getAlphas, getColorQueries, getDisplayName, getFractionsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RadianceTrait
getDisplayName
-
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: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.
-