Class RadialGradient
java.lang.Object
com.github.tadukoo.view.paint.gradient.RadialGradient
- All Implemented Interfaces:
Gradient
,SizablePaint
Linear Gradient is used to build a
Gradient
object to use for RadialGradientPaint
.- Since:
- Alpha v.0.2
- Version:
- Alpha v.0.2.1
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Radial Gradient Builder is a builder forRadialGradient
. -
Field Summary
Modifier and TypeFieldDescriptionA function taking in the dimension of the space to determine the center, radius, and focus of the circleprotected final Color[]
TheColor
s involved in this LinearGradientprotected final MultipleGradientPaint.ColorSpaceType
Thecolor space
involved in this LinearGradientprotected final MultipleGradientPaint.CycleMethod
Thecycle method
involved in this LinearGradientprotected final float[]
The fractions involved in this LinearGradientprotected final AffineTransform
TheAffineTransform
involved in this LinearGradient -
Constructor Summary
ModifierConstructorDescriptionprivate
RadialGradient
(Function<Dimension, com.github.tadukoo.util.tuple.Triple<Point2D, Float, Point2D>> circleFunc, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, AffineTransform gradientTransform) Constructs a new Radial Gradient using the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Color[]
float[]
Creates aRadialGradientPaint
using thecircleFunc
to determine the center, radius, and focus of the circle, and sending the other parameters as specified.
-
Field Details
-
circleFunc
protected final Function<Dimension,com.github.tadukoo.util.tuple.Triple<Point2D, circleFuncFloat, Point2D>> A function taking in the dimension of the space to determine the center, radius, and focus of the circle -
fractions
protected final float[] fractionsThe fractions involved in this LinearGradient -
colors
TheColor
s involved in this LinearGradient -
cycleMethod
Thecycle method
involved in this LinearGradient -
colorSpace
Thecolor space
involved in this LinearGradient -
gradientTransform
TheAffineTransform
involved in this LinearGradient
-
-
Constructor Details
-
RadialGradient
private RadialGradient(Function<Dimension, com.github.tadukoo.util.tuple.Triple<Point2D, Float, Point2D>> circleFunc, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, AffineTransform gradientTransform) Constructs a new Radial Gradient using the given parameters.- Parameters:
circleFunc
- A function taking in the dimension of the space to determine the center, radius, and focus of the circlefractions
- The fractions involved in this LinearGradientcolors
- TheColor
s involved in this LinearGradientcycleMethod
- Thecycle method
involved in this LinearGradientcolorSpace
- Thecolor space
involved in this LinearGradientgradientTransform
- TheAffineTransform
involved in this LinearGradient
-
-
Method Details
-
builder
- Returns:
- A
RadialGradient.RadialGradientBuilder
to use in building a RadialGradient
-
getFractions
public float[] getFractions()- Specified by:
getFractions
in interfaceGradient
- Returns:
- The fractions involved in this Gradient
-
getColors
-
getCycleMethod
- Specified by:
getCycleMethod
in interfaceGradient
- Returns:
- The
cycle method
involved in the Gradient
-
getColorSpace
- Specified by:
getColorSpace
in interfaceGradient
- Returns:
- The
color space
involved in the Gradient
-
getGradientTransform
- Specified by:
getGradientTransform
in interfaceGradient
- Returns:
- The
AffineTransform
involved in the Gradient
-
getCircleFunc
public Function<Dimension,com.github.tadukoo.util.tuple.Triple<Point2D, getCircleFunc()Float, Point2D>> - Returns:
- A function taking in the dimension of the space to determine the center, radius, and focus of the circle
-
getPaint
Creates aRadialGradientPaint
using thecircleFunc
to determine the center, radius, and focus of the circle, and sending the other parameters as specified.- Specified by:
getPaint
in interfaceSizablePaint
- Parameters:
size
- The dimensions of the object the Gradient will go on- Returns:
- A new
RadialGradientPaint
using the parameters of this RadialGradient
-