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:
    com.google.gwt.event.shared.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, readOnly`

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

      `jsObj`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Gradient()`
    `Gradient(com.google.gwt.core.client.JavaScriptObject jsObj)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ColorStop[]` | `getColorStops()` An array of color stops for this gradient.
    `java.lang.String` | `getEndColor()` An end color for the gradient.
    `java.lang.String` | `getId()` Identifier which can be used by one or more DrawItems when gradient is assigned to `DrawPane.gradients`.
    `static Gradient` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `java.lang.String` | `getStartColor()` A start color for the gradient.
    `void` | `setColorStops(ColorStop... colorStops)` An array of color stops for this gradient.
    `void` | `setEndColor(java.lang.String endColor)` An end color for the gradient.
    `void` | `setId(java.lang.String id)` Identifier which can be used by one or more DrawItems when gradient is assigned to `DrawPane.gradients`.
    `void` | `setStartColor(java.lang.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, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getReadOnly, isFactoryCreated, logConfiguration, 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, setReadOnly`

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

    - #### Gradient

          public Gradient()

    - #### Gradient

          public Gradient(com.google.gwt.core.client.JavaScriptObject jsObj)

  - ### Method Detail

    - #### getOrCreateRef

          public static Gradient getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### setColorStops

          public void setColorStops(ColorStop... colorStops)

      An array of color stops for this gradient.
      Parameters:
        `colorStops` - Default value is null

    - #### getColorStops

          public ColorStop[] getColorStops()

      An array of color stops for this gradient.
      Returns:
        ColorStop...

    - #### setEndColor

          public void setEndColor(java.lang.String endColor)

      An end color for the gradient. If both `startColor` and endColor are set then `colorStops` is ignored.
      Parameters:
        `endColor` - See `CSSColor` . Default value is null

    - #### getEndColor

          public java.lang.String getEndColor()

      An end color for the gradient. If both `startColor` and endColor are set then `colorStops` is ignored.
      Returns:
        See `CSSColor`

    - #### setId

          public void setId(java.lang.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` - Default value is null

    - #### getId

          public java.lang.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:
        String

    - #### setStartColor

          public void setStartColor(java.lang.String startColor)

      A start color for the gradient. If both startColor and `endColor` are set then `colorStops` is ignored.
      Parameters:
        `startColor` - See `CSSColor` . Default value is null

    - #### getStartColor

          public java.lang.String getStartColor()

      A start color for the gradient. If both startColor and `endColor` are set then `colorStops` is ignored.
      Returns:
        See `CSSColor`