Class SVGMultipleGradientPaint
- java.lang.Object
-
- com.github.weisj.jsvg.renderer.jdk.SVGMultipleGradientPaint
-
- All Implemented Interfaces:
java.awt.Paint
,java.awt.Transparency
- Direct Known Subclasses:
SVGRadialGradientPaint
public abstract class SVGMultipleGradientPaint extends java.lang.Object implements java.awt.Paint
This is the superclass for Paints which use a multiple color gradient to fill in their raster. It provides storage for variables and enumerated values common toLinearGradientPaint
andRadialGradientPaint
.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description (package private) @NotNull java.awt.Color @NotNull []
colors
Gradient colors.(package private) java.awt.MultipleGradientPaint.ColorSpaceType
colorSpace
The color space in which to perform the gradient interpolation.(package private) java.awt.MultipleGradientPaint.CycleMethod
cycleMethod
The method to use when painting outside the gradient bounds.(package private) int
fastGradientArraySize
(package private) float @NotNull []
fractions
Gradient keyframe values in the range 0 to 1.(package private) java.lang.ref.SoftReference<int[]>
gradient
(package private) java.lang.ref.SoftReference<int[][]>
gradients
(package private) @NotNull java.awt.geom.AffineTransform
gradientTransform
Transform to apply to gradient.(package private) boolean
isSimpleLookup
(package private) java.awt.image.ColorModel
model
The following fields are used only by MultipleGradientPaintContext to cache certain values that remain constant and do not need to be recalculated for each context created from this paint instance.(package private) float[]
normalizedIntervals
(package private) int
transparency
The transparency of this paint object.
-
Constructor Summary
Constructors Constructor Description SVGMultipleGradientPaint(float @NotNull [] fractions, @NotNull java.awt.Color @NotNull [] colors, java.awt.MultipleGradientPaint.CycleMethod cycleMethod, java.awt.MultipleGradientPaint.ColorSpaceType colorSpace, @NotNull java.awt.geom.AffineTransform gradientTransform)
Package-private constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getTransparency()
-
-
-
Field Detail
-
transparency
final int transparency
The transparency of this paint object.
-
fractions
final float @NotNull [] fractions
Gradient keyframe values in the range 0 to 1.
-
colors
@NotNull final @NotNull java.awt.Color @NotNull [] colors
Gradient colors.
-
gradientTransform
@NotNull final @NotNull java.awt.geom.AffineTransform gradientTransform
Transform to apply to gradient.
-
cycleMethod
@NotNull final java.awt.MultipleGradientPaint.CycleMethod cycleMethod
The method to use when painting outside the gradient bounds.
-
colorSpace
@NotNull final java.awt.MultipleGradientPaint.ColorSpaceType colorSpace
The color space in which to perform the gradient interpolation.
-
model
java.awt.image.ColorModel model
The following fields are used only by MultipleGradientPaintContext to cache certain values that remain constant and do not need to be recalculated for each context created from this paint instance.
-
normalizedIntervals
float[] normalizedIntervals
-
isSimpleLookup
boolean isSimpleLookup
-
gradients
java.lang.ref.SoftReference<int[][]> gradients
-
gradient
java.lang.ref.SoftReference<int[]> gradient
-
fastGradientArraySize
int fastGradientArraySize
-
-
Constructor Detail
-
SVGMultipleGradientPaint
SVGMultipleGradientPaint(float @NotNull [] fractions, @NotNull @NotNull java.awt.Color @NotNull [] colors, @NotNull java.awt.MultipleGradientPaint.CycleMethod cycleMethod, @NotNull java.awt.MultipleGradientPaint.ColorSpaceType colorSpace, @NotNull @NotNull java.awt.geom.AffineTransform gradientTransform)
Package-private constructor.- Parameters:
fractions
- numbers ranging from 0.0 to 1.0 specifying the distribution of colors along the gradientcolors
- array of colors corresponding to each fractional valuecycleMethod
- eitherNO_CYCLE
,REFLECT
, orREPEAT
colorSpace
- which color space to use for interpolation, eitherSRGB
orLINEAR_RGB
gradientTransform
- transform to apply to the gradient- Throws:
java.lang.NullPointerException
- iffractions
array is null, orcolors
array is null, orgradientTransform
is null, orcycleMethod
is null, orcolorSpace
is nulljava.lang.IllegalArgumentException
- iffractions.length != colors.length
, orcolors
is less than 2 in size, or afractions
value is less than 0.0 or greater than 1.0, or thefractions
are not provided in strictly increasing order
-
-