Skip to main content

GradientStop Class

A gradient stop that defines a color and its position in a GradientFill.

Declaration

public class GradientStop extends OfficeObject

Remarks

The following code snippet creates gradient stops and adds them to a linear gradient fill:

import com.devexpress.docs.presentation.*;
import com.devexpress.docs.office.*;
import com.devexpress.system.drawing.*;
//...
// Build a gradient from orange to royal blue.
GradientFill fill = new GradientFill(GradientType.LINEAR);
fill.getGradientStops().add(new GradientStop(Color.getOrange(), 0.0f));
fill.getGradientStops().add(new GradientStop(Color.getRoyalBlue(), 100.0f));
shape.setFill(fill);

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
OfficeObject
GradientStop

Constructors

GradientStop(Color color, float position) Constructor

Initializes a new instance of the GradientStop class with specified settings.

Declaration

public GradientStop(Color color, float position)

Parameters

Name Type Description
color Color

Specifies the gradient stop color.

position float

A value between 0 and 100 that specifies the gradient stop position.

GradientStop(OfficeColor color, float position) Constructor

Initializes a new instance of the GradientStop class with specified settings.

Declaration

public GradientStop(OfficeColor color, float position)

Parameters

Name Type Description
color OfficeColor

Specifies the gradient stop color.

position float

A value between 0 and 100 that specifies the gradient stop position.

GradientStop(SchemeColors color, float position) Constructor

Initializes a new instance of the GradientStop class with specified settings.

Declaration

public GradientStop(SchemeColors color, float position)

Parameters

Name Type Description
color SchemeColors

Specifies the gradient stop color.

position float

A value between 0 and 100 that specifies the gradient stop position.

GradientStop(SystemColors color, float position) Constructor

Initializes a new instance of the GradientStop class with specified settings.

Declaration

public GradientStop(SystemColors color, float position)

Parameters

Name Type Description
color SystemColors

Specifies the gradient stop color.

position float

A value between 0 and 100 that specifies the gradient stop position.

Methods

getColor() Method

Returns gradient stop color.

Declaration

public OfficeColor getColor()

Returns

Type Description
OfficeColor

Gradient stop color.

getPosition() Method

Returns the gradient stop position.

Declaration

public float getPosition()

Returns

Type Description
float

A value between 0 and 100 that specifies the gradient stop’s start position.

setColor(OfficeColor value) Method

Sets gradient stop color.

Declaration

public void setColor(OfficeColor value)

Parameters

Name Type Description
value OfficeColor

Gradient stop color.

setPosition(float value) Method

Sets the gradient stop position.

Declaration

public void setPosition(float value)

Parameters

Name Type Description
value float

A value between 0 and 100 that specifies the gradient stop’s start position.