JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

Profile: desktop, common

Overview

The RadialGradient class provides a way to fill a shape with a circular radial color gradient pattern. The user may specify 2 or more gradient colors, and this paint will provide an interpolation between each color.

The user must specify the circle controlling the gradient pattern, which is defined by a center point and a radius. The user can also specify a separate focus point within that circle, which controls the location of the first color of the gradient. By default the focus is set to be the center of the circle.

The center, radius, and focus point should be specified relative to a unit square, unless the proportional attribute is false. By default proportional is true, and the gradient will be scaled to fill whatever shape it is applied to.

This paint will map the first color of the gradient to the focus point, and the last color to the perimeter of the circle, interpolating smoothly for any in-between colors specified by the user. Any line drawn from the focus point to the circumference will thus span all the gradient colors.

Specifying a focus point outside of the circle's radius will result in the focus being set to the intersection point of the focus-center line and the perimeter of the circle.

The user must provide an array of floats specifying how to distribute the colors along the gradient. These values should range from 0.0 to 1.0 and act like keyframes along the gradient (they mark where the gradient should be exactly a particular color).

Profile: common

Attribute Summary

nametypedescription
Public
centerXNumber

Defines the X coordinate of the center point of the circle defining the gradient.

More: [+]

Defines the X coordinate of the center point of the circle defining the gradient. If proportional is true (the default), this value specifies a point on a unit square that will be scaled to match the size of the the shape that the gradient fills. The last color of the gradient is mapped to the perimeter of this circle.

Profile: common

centerYNumber

Defines the X coordinate of the center point of the circle defining the gradient.

More: [+]

Defines the X coordinate of the center point of the circle defining the gradient. If proportional is true (the default), this value specifies a point on a unit square that will be scaled to match the size of the the shape that the gradient fills. The last color of the gradient is mapped to the perimeter of this circle.

Profile: common

cycleMethodCycleMethod

Defines which of the follwing cycle method is applied to the LinearGradient: CycleMethod.NO, CycleMethod.REFLECT, or CycleMethod.REPEAT.

More: [+]

Defines which of the follwing cycle method is applied to the LinearGradient: CycleMethod.NO, CycleMethod.REFLECT, or CycleMethod.REPEAT.

Profile: common conditional multigradient

focusXNumber

Defines the X coordinate of the point to which the first color is mapped.

More: [+]

Defines the X coordinate of the point to which the first color is mapped. If proportional is true (the default), this value specifies a point on a unit square that will be scaled to match the size of the the shape that the gradient fills.

Profile: common

focusYNumber

Defines the Y coordinate of the point to which the first color is mapped.

More: [+]

Defines the Y coordinate of the point to which the first color is mapped. If proportional is true (the default), this value specifies a point on a unit square that will be scaled to match the size of the the shape that the gradient fills.

Profile: common

proportionalBoolean More: [+]

Profile: common

radiusNumber

Specifies the radius of the circle defining the extents of the color gradient.

More: [+]

Specifies the radius of the circle defining the extents of the color gradient. If proportional is true (the default), this value specifies a size relative to unit square that will be scaled to match the size of the the shape that the gradient fills.

Profile: common

stopsStop[] More: [+]

Profile: common

Protected

Inherited Attributes

Function Summary

public getAWTPaint() : java.awt.Paint

Returns the {java.awt.Paint} delegate for this RadialGradient.

More: [+]

Returns the {java.awt.Paint} delegate for this RadialGradient.

Returns
Paint

Inherited Functions

javafx.scene.paint.Paint

public abstract getAWTPaint() : java.awt.Paint

Creates and returns a paint context used to generate the color pattern.

More: [+]

Creates and returns a paint context used to generate the color pattern.

Returns
Paint
the paint context for generating color patterns