Class FractionBasedDecorationPainter
- java.lang.Object
-
- org.pushingpixels.radiance.theming.api.painter.FractionBasedPainter
-
- org.pushingpixels.radiance.theming.api.painter.decoration.FractionBasedDecorationPainter
-
- All Implemented Interfaces:
RadianceDecorationPainter
,RadianceTrait
public class FractionBasedDecorationPainter extends FractionBasedPainter implements RadianceDecorationPainter
Decoration painter with fraction-based stops and a color query associated with each stop. This class allows creating multi-gradient decorations with exact control over which color is used at every gradient control point.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<RadianceThemingSlices.DecorationAreaType>
decoratedAreas
-
Fields inherited from class org.pushingpixels.radiance.theming.api.painter.FractionBasedPainter
colorQueries, fractions
-
-
Constructor Summary
Constructors Constructor Description FractionBasedDecorationPainter(java.lang.String displayName, float[] fractions, ColorSchemeSingleColorQuery[] colorQueries)
Creates a new fraction-based decoration painter.FractionBasedDecorationPainter(java.lang.String displayName, float[] fractions, ColorSchemeSingleColorQuery[] colorQueries, RadianceThemingSlices.DecorationAreaType... decorationAreas)
Creates a new fraction-based decoration painter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
paintDecoratedBackground(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceColorScheme scheme)
private void
paintDecoratedBackground(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, java.awt.Shape contour, RadianceColorScheme scheme)
void
paintDecorationArea(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceSkin skin)
Paints the decoration area as a fully filled rectangle.void
paintDecorationArea(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, java.awt.Shape contour, RadianceColorScheme colorScheme)
Paints the decoration area as a specified shape.private void
paintSolidBackground(java.awt.Graphics2D graphics, int width, int height, RadianceColorScheme scheme)
private void
paintSolidBackground(java.awt.Graphics2D graphics, java.awt.Shape contour, RadianceColorScheme scheme)
-
Methods inherited from class org.pushingpixels.radiance.theming.api.painter.FractionBasedPainter
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
-
-
-
-
Field Detail
-
decoratedAreas
private java.util.Set<RadianceThemingSlices.DecorationAreaType> decoratedAreas
-
-
Constructor Detail
-
FractionBasedDecorationPainter
public FractionBasedDecorationPainter(java.lang.String displayName, float[] fractions, ColorSchemeSingleColorQuery[] colorQueries)
Creates a new fraction-based decoration 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
.
-
FractionBasedDecorationPainter
public FractionBasedDecorationPainter(java.lang.String displayName, float[] fractions, ColorSchemeSingleColorQuery[] colorQueries, RadianceThemingSlices.DecorationAreaType... decorationAreas)
Creates a new fraction-based decoration 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
.decorationAreas
- Decoration areas that should be painted based on the color queries. All the rest will be filled with a solid color from the background color scheme of the matching decoration area.
-
-
Method Detail
-
paintDecorationArea
public void paintDecorationArea(java.awt.Graphics2D graphics, java.awt.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 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(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, java.awt.Shape contour, RadianceColorScheme colorScheme)
Description copied from interface:RadianceDecorationPainter
Paints the decoration area as a specified shape.- Specified by:
paintDecorationArea
in interfaceRadianceDecorationPainter
- Parameters:
graphics
- Graphics context.comp
- Component.decorationAreaType
- Decoration area type. Must not benull
.contour
- Contour to fill.colorScheme
- Color scheme for painting the decoration area.
-
paintDecoratedBackground
private void paintDecoratedBackground(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceColorScheme scheme)
-
paintDecoratedBackground
private void paintDecoratedBackground(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, java.awt.Shape contour, RadianceColorScheme scheme)
-
paintSolidBackground
private void paintSolidBackground(java.awt.Graphics2D graphics, int width, int height, RadianceColorScheme scheme)
-
paintSolidBackground
private void paintSolidBackground(java.awt.Graphics2D graphics, java.awt.Shape contour, RadianceColorScheme scheme)
-
-