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 are specified relative to a unit square, unless the proportional variable 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 application provides an array of Stops specifying how to distribute the colors along the gradient. The Stop#offset variable must be the range 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

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
public-initcenterXNumber0.0

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

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.

0.0

Profile: common

 
public-initcenterYNumber0.0

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

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.

0.0

Profile: common

 
public-initcycleMethodCycleMethodNO_CYCLE

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

public-initfocusXNumber

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

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

 
public-initfocusYNumber

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

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

 
public-initproportionalBooleantrue

Indicates whether start and end values are proportional or absolute.

Indicates whether start and end values are proportional or absolute. If this flag is true, start and end values are defined in a [0..1] space and will be scaled to match the size of the shape that the gradient fills. If this flag is false, then start and end values are absolute coordinates.

true

Profile: common

 
public-initradiusNumber1.0

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

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.

1.0

Profile: common

 
public-initstopsStop[]empty

A sequence of 2 or more Stop values specifying how to distribute the colors along the gradient.

A sequence of 2 or more Stop values specifying how to distribute the colors along the gradient. These values must be in the range 0.0 to 1.0. They act like keyframes along the gradient: they mark where the gradient should be exactly a particular color.

Each stop in the sequence must have an offset that is greater than the previous stop in the sequence.

empty

Profile: common

 

Inherited Variables

Function Summary

public impl_getPlatformPaint() : java.lang.Object
Returns
Object
 

Inherited Functions

javafx.scene.paint.Paint

public abstract impl_getPlatformPaint() : java.lang.Object
Returns
Object
 



Spec-Zone.ru - all specs in one place