Class RadialGradient.RadialGradientBuilder
java.lang.Object
com.github.tadukoo.view.paint.gradient.GradientBuilder<RadialGradient>
com.github.tadukoo.view.paint.gradient.RadialGradient.RadialGradientBuilder
- Enclosing class:
- RadialGradient
Radial Gradient Builder is a builder for
RadialGradient
.
The only required parameters to specify are the color points
. You must specify
at least two, so that it's an actual gradient.
The following parameters are optional:
cycleMethod
- defaults toMultipleGradientPaint.CycleMethod.NO_CYCLE
colorSpace
- defaults toMultipleGradientPaint.ColorSpaceType.SRGB
gradientTransform
- defaults to new AffineTransform()circleFunc
- defaults to calculating a circle centered in the given space with focus in the center
- Since:
- Alpha v.0.2
- Version:
- Alpha v.0.2.1
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Modifier and TypeFieldDescriptionA function taking in the dimension of the space to determine the center, radius, and focus of the circleFields inherited from class com.github.tadukoo.view.paint.gradient.GradientBuilder
colors, colorSpace, cycleMethod, fractions, gradientTransform
-
Constructor Summary
ModifierConstructorDescriptionprivate
Not allowed to create outside of RadialGradient -
Method Summary
Modifier and TypeMethodDescriptionprotected RadialGradient
Builds the actualGradient
.Checks thatcircleFunc
is not nullcircleFunc
(Function<Dimension, com.github.tadukoo.util.tuple.Triple<Point2D, Float, Point2D>> circleFunc) colorPoint
(float fraction, Color color) colorSpace
(MultipleGradientPaint.ColorSpaceType colorSpace) cycleMethod
(MultipleGradientPaint.CycleMethod cycleMethod) gradientTransform
(AffineTransform gradientTransform) Methods inherited from class com.github.tadukoo.view.paint.gradient.GradientBuilder
build, checkForErrors
-
Field Details
-
circleFunc
A function taking in the dimension of the space to determine the center, radius, and focus of the circle
-
-
Constructor Details
-
RadialGradientBuilder
private RadialGradientBuilder()Not allowed to create outside of RadialGradient
-
-
Method Details
-
circleFunc
public RadialGradient.RadialGradientBuilder circleFunc(Function<Dimension, com.github.tadukoo.util.tuple.Triple<Point2D, Float, Point2D>> circleFunc) - Parameters:
circleFunc
- A function taking in the dimension of the space to determine the center, radius, and focus of the circle- Returns:
- this, to continue building
-
colorPoint
- Overrides:
colorPoint
in classGradientBuilder<RadialGradient>
- Parameters:
fraction
- The fraction to use for this color pointcolor
- TheColor
to use for this color point- Returns:
- this, to continue building
-
cycleMethod
public RadialGradient.RadialGradientBuilder cycleMethod(MultipleGradientPaint.CycleMethod cycleMethod) - Overrides:
cycleMethod
in classGradientBuilder<RadialGradient>
- Parameters:
cycleMethod
- Thecycle method
involved in the Gradient- Returns:
- this, to continue building
-
colorSpace
public RadialGradient.RadialGradientBuilder colorSpace(MultipleGradientPaint.ColorSpaceType colorSpace) - Overrides:
colorSpace
in classGradientBuilder<RadialGradient>
- Parameters:
colorSpace
- Thecolor space
involved in the Gradient- Returns:
- this, to continue building
-
gradientTransform
- Overrides:
gradientTransform
in classGradientBuilder<RadialGradient>
- Parameters:
gradientTransform
- TheAffineTransform
involved in the Gradient- Returns:
- this, to continue building
-
checkForSubclassErrors
Checks thatcircleFunc
is not null- Specified by:
checkForSubclassErrors
in classGradientBuilder<RadialGradient>
- Returns:
- An ArrayList of any errors found
-
buildGradient
Builds the actualGradient
. This is implemented by the specific subclass.- Specified by:
buildGradient
in classGradientBuilder<RadialGradient>
- Returns:
- The newly built
Gradient
-