Package com.smartgwt.client.widgets.drawing

# 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`

public class Gradient extends DataClass
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`

  ### Fields inherited from class com.smartgwt.client.core.JsObject

  `jsObj`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Gradient()`
  `Gradient(JavaScriptObject jsObj)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ColorStop[]`
  `getColorStops()`
  An array of color stops for this gradient.
  `String`
  `getEndColor()`
  An end color for the gradient.
  `String`
  `getId()`
  Identifier which can be used by one or more DrawItems when gradient is assigned to `DrawPane.gradients`.
  `static Gradient`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `String`
  `getStartColor()`
  A start color for the gradient.
  `Gradient`
  `setColorStops(ColorStop... colorStops)`
  An array of color stops for this gradient.
  `Gradient`
  `setEndColor(String endColor)`
  An end color for the gradient.
  `Gradient`
  `setId(String id)`
  Identifier which can be used by one or more DrawItems when gradient is assigned to `DrawPane.gradients`.
  `Gradient`
  `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`

  ### Methods inherited from class com.smartgwt.client.core.JsObject

  `equals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObj`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Gradient

    public Gradient()

  - ### Gradient

    public Gradient(JavaScriptObject jsObj)

- ## Method Details

  - ### getOrCreateRef

    public static Gradient getOrCreateRef(JavaScriptObject jsObj)

  - ### setColorStops

    public Gradient setColorStops(ColorStop... colorStops)
    An array of color stops for this gradient.
    Parameters:
      `colorStops` - New colorStops value. Default value is null
    Returns:
      `Gradient` instance, for chaining setter calls

  - ### getColorStops

    public ColorStop[] getColorStops()
    An array of color stops for this gradient.
    Returns:
      Current colorStops value. Default value is null

  - ### setEndColor

    public Gradient setEndColor(String endColor)
    An end color for the gradient. If both `startColor` and endColor are set then `colorStops` is ignored.
    Parameters:
      `endColor` - New endColor value. Default value is null
    Returns:
      `Gradient` instance, for chaining setter calls
    See Also:
      - `CSSColor`

  - ### getEndColor

    public String getEndColor()
    An end color for the gradient. If both `startColor` and endColor are set then `colorStops` is ignored.
    Returns:
      Current endColor value. Default value is null
    See Also:
      - `CSSColor`

  - ### setId

    public Gradient setId(String id)
    Identifier which can be used by one or more DrawItems when gradient is assigned to `DrawPane.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:
      `Gradient` instance, for chaining setter calls
    See Also:
      - `Identifier`

  - ### getId

    public String getId()
    Identifier which can be used by one or more DrawItems when gradient is assigned to `DrawPane.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:
      - `Identifier`

  - ### setStartColor

    public Gradient setStartColor(String startColor)
    A start color for the gradient. If both startColor and `endColor` are set then `colorStops` is ignored.
    Parameters:
      `startColor` - New startColor value. Default value is null
    Returns:
      `Gradient` instance, for chaining setter calls
    See Also:
      - `CSSColor`

  - ### getStartColor

    public String getStartColor()
    A start color for the gradient. If both startColor and `endColor` are set then `colorStops` is ignored.
    Returns:
      Current startColor value. Default value is null
    See Also:
      - `CSSColor`