Class Gradient
java.lang.Object
com.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.widgets.drawing.Gradient
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
LinearGradient,RadialGradient,SimpleGradient
Defines a simple gradient vertical gradient between
two colors, or using colorStops. See SimpleGradient, LinearGradient and
RadialGradient for further properties to define more advanced gradients.-
Field Summary
Fields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAn array of color stops for this gradient.doubleFor aSimpleGradient, the angle of the direction vector in degrees.An end color for the gradient.getId()Identifier which can be used by one or more DrawItems when gradient is assigned toDrawPane.gradients.static GradientgetOrCreateRef(JavaScriptObject jsObj) A start color for the gradient.setColorStops(ColorStop... colorStops) An array of color stops for this gradient.setDirection(double direction) For aSimpleGradient, the angle of the direction vector in degrees.setEndColor(String endColor) An end color for the gradient.Identifier which can be used by one or more DrawItems when gradient is assigned toDrawPane.gradients.setStartColor(String startColor) A start color for the gradient.Methods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
-
Constructor Details
-
Gradient
public Gradient() -
Gradient
-
-
Method Details
-
getOrCreateRef
-
setColorStops
An array of color stops for this gradient.- Parameters:
colorStops- New colorStops value. Default value is null- Returns:
Gradientinstance, for chaining setter calls
-
getColorStops
An array of color stops for this gradient.- Returns:
- Current colorStops value. Default value is null
-
setDirection
For aSimpleGradient, the angle of the direction vector in degrees. The default of 0.0 causes the gradient to sweep from the start color on the left to the end color on the right. Positive direction angles correspond to clockwise rotations of the default gradient.This property is only applicable when using
startColorandendColor(notcolorStops).- Parameters:
direction- New direction value. Default value is 0.0- Returns:
Gradientinstance, for chaining setter calls
-
getDirection
public double getDirection()For aSimpleGradient, the angle of the direction vector in degrees. The default of 0.0 causes the gradient to sweep from the start color on the left to the end color on the right. Positive direction angles correspond to clockwise rotations of the default gradient.This property is only applicable when using
startColorandendColor(notcolorStops).- Returns:
- Current direction value. Default value is 0.0
-
setEndColor
An end color for the gradient. If bothstartColorand endColor are set thencolorStopsis ignored. -
getEndColor
An end color for the gradient. If bothstartColorand endColor are set thencolorStopsis ignored.- Returns:
- Current endColor value. Default value is null
- See Also:
-
setId
Identifier which can be used by one or more DrawItems when gradient is assigned toDrawPane.gradients. The ID property is optional when gradient is assigned directly to a DrawItem.The ID must be unique within DrawPane.gradients if defined.
- Parameters:
id- New id value. Default value is null- Returns:
Gradientinstance, for chaining setter calls- See Also:
-
getId
Identifier which can be used by one or more DrawItems when gradient is assigned toDrawPane.gradients. The ID property is optional when gradient is assigned directly to a DrawItem.The ID must be unique within DrawPane.gradients if defined.
- Returns:
- Current id value. Default value is null
- See Also:
-
setStartColor
A start color for the gradient. If both startColor andendColorare set thencolorStopsis ignored. -
getStartColor
A start color for the gradient. If both startColor andendColorare set thencolorStopsis ignored.- Returns:
- Current startColor value. Default value is null
- See Also:
-