org.jvnet.substance.api.painter.decoration
Class FractionBasedDecorationPainter
java.lang.Object
org.jvnet.substance.api.painter.FractionBasedPainter
org.jvnet.substance.api.painter.decoration.FractionBasedDecorationPainter
- All Implemented Interfaces:
- SubstanceTrait, SubstanceDecorationPainter
public class FractionBasedDecorationPainter
- extends FractionBasedPainter
- implements SubstanceDecorationPainter
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.
- Author:
- Kirill Grouchnikov
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
.
paintDecorationArea
public void paintDecorationArea(java.awt.Graphics2D graphics,
java.awt.Component comp,
DecorationAreaType decorationAreaType,
int width,
int height,
SubstanceSkin skin)
- Description copied from interface:
SubstanceDecorationPainter
- Paints the decoration area.
- Specified by:
paintDecorationArea
in interface SubstanceDecorationPainter
- 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.