Package com.smartgwt.client.widgets

# Class SCStatefulImgConfig

java.lang.Object
com.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.widgets.SCStatefulImgConfig

All Implemented Interfaces:
  `HasHandlers`

public class SCStatefulImgConfig extends DataClass
A configuration object containing image URLs for a set of possible images to display based on the `state` of some components. See the `stateful images overview` for more information.

Each attribute in this configuration object maps a state to a target URL.
Each URL may be specified in one of three ways

- a standard `SCImgURL` may be used to refer directly to an image file.
- the `"#state:"` prefix may be used to display media from another specified state.
- the `"#modifier:"` prefix may be used to specify a modifier string to apply to the `base image`.
  The modifier will be applied to the base file name before the file type suffix.

For example, consider a stateful image config with the following properties:

      {    _base:"button.png",
           Over:"bright_button.png",
           Focused:"#state:Over",
           Selected:"#state:Over",
           Disabled:"#modifier:_Disabled",
           SelectedDisabled:"#state:Selected"
      }

In this case

- the base image URL and the the "Over" state image URL would be determined using the standard `SCImgURL` rules
- the "Focused" and "Selected" state images would re-use the "Over" state image (`"bright_button.png"`)
- the "Disabled" state image would be the base state image with a `"_Disabled"` suffix applied to the file name (`"button_Disabled.png"`)
- the `"SelectedDisabled"` entry would be used for the combined `"Selected"` and `"Disabled"` states, and would re-use the "Selected" state image (which in turn maps back to the "Over" state, resolving to `"bright_button.png"`)

The default set of standard states are explicitly documented, but this object format is extensible. A developer may specify additional attributes on a SCStatefulImgConfig beyond the standard documented states and they may be picked up if a custom state is applied to a component (via a call to `StatefulCanvas.setState()`, for example).

In some cases, an icon may have only custom states - for example, a tree-folder icon is always either opened or closed. In these cases, a `_base` entry is only required if entries in the object use the #state or #modifier components.

### Combined states and missing entries:

The `focused` and `selected` states may be applied to a component in combination with other states. For example an `ImgButton` marked both Selected and Disabled will look for media to represent this combined state. To provide such media in a SCStatefulImgConfig, use the combined state names (in this case `SelectedDisabled`).
If a component is both Selected and Focused, three-part combined states are also possible (Selected + Focused + Over gives `SelectedFocusedOver` for example).

The SCStatefulImgConfig format may be sparse - developers may skip providing values for certain states (or combined states) in the SCStatefulImgConfig object. In this case the system will back off to using one of the state image entries that has been explicitly provided, according to the following rules:

State(s) | Stateful image attributes to consider (in order of preference)
`Focused` and `Selected` | If both focused and selected states are applied, the system will use the first (populated) value from the following attribute list: "FocusedSelected" "Focused" "Selected"
`Over` or `Down` in combination with `Focused` / `Selected` | System will check for a combined state attribute with the Focused / Selected state first. For example for Focused + Selected + Over, consider the following attributes: "FocusedSelectedOver" "FocusedOver" "SelectedOver" If no combined state entry is specified, back off to considering just the Focused / Selected state: "FocusedSelected" "Focused" "Selected" If no focused / selected state entry is present in the config object, look for an entry for the unmodified state name "Over"
All other states, including `Disabled` (in combination with `Focused` / `Selected`) | Check for a combined state attribute with the Focused / Selected state first. For example for Focused + Selected + "CustomState", consider the following attributes: "FocusedSelectedCustomState" "FocusedCustomState" "SelectedCustomState" If no combined state entry is specified, back off to considering just the unmodified state name "CustomState" If there is no explicit entry for the state name, use the Focused / Selected state without a state name: "FocusedSelected" "Focused" "Selected"

If no entry can be found for the specified state / combined states using the above approach, the `"_base"` attribute will be used.

- ## 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
  `SCStatefulImgConfig()`
  `SCStatefulImgConfig(JavaScriptObject jsObj)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `get_base()`
  The base filename for the image.
  `String`
  `getDisabled()`
  Image to display when the component is `disabled`.
  `String`
  `getDown()`
  Image to display on `mouseDown`.
  `String`
  `getFocused()`
  Image to display when the component is `focused`.
  `String`
  `getFocusedDown()`
  Image to display when the component is `focused` on `mouse down`.
  `String`
  `getFocusedOver()`
  Image to display when the component is `focused` on `roll over`.
  `static SCStatefulImgConfig`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `String`
  `getOver()`
  Image to display on `roll over`.
  `String`
  `getSelected()`
  Image to display when the component is `selected`.
  `String`
  `getSelectedDisabled()`
  Image to display when the component is `selected` and `disabled`.
  `String`
  `getSelectedDown()`
  Image to display when the component is `selected` on `mouse down`.
  `String`
  `getSelectedFocused()`
  Image to display when the component is `selected` and `focused`.
  `String`
  `getSelectedFocusedDown()`
  Image to display when the component is `selected` and `focused` on `mouse down`.
  `String`
  `getSelectedFocusedOver()`
  Image to display when the component is `selected` and `focused` on `roll over`.
  `String`
  `getSelectedOver()`
  Image to display when the component is `selected` on `roll over`.
  `SCStatefulImgConfig`
  `set_base(String _base)`
  The base filename for the image.
  `SCStatefulImgConfig`
  `setDisabled(String Disabled)`
  Image to display when the component is `disabled`.
  `SCStatefulImgConfig`
  `setDown(String Down)`
  Image to display on `mouseDown`.
  `SCStatefulImgConfig`
  `setFocused(String Focused)`
  Image to display when the component is `focused`.
  `SCStatefulImgConfig`
  `setFocusedDown(String FocusedDown)`
  Image to display when the component is `focused` on `mouse down`.
  `SCStatefulImgConfig`
  `setFocusedOver(String FocusedOver)`
  Image to display when the component is `focused` on `roll over`.
  `SCStatefulImgConfig`
  `setOver(String Over)`
  Image to display on `roll over`.
  `SCStatefulImgConfig`
  `setSelected(String Selected)`
  Image to display when the component is `selected`.
  `SCStatefulImgConfig`
  `setSelectedDisabled(String SelectedDisabled)`
  Image to display when the component is `selected` and `disabled`.
  `SCStatefulImgConfig`
  `setSelectedDown(String SelectedDown)`
  Image to display when the component is `selected` on `mouse down`.
  `SCStatefulImgConfig`
  `setSelectedFocused(String SelectedFocused)`
  Image to display when the component is `selected` and `focused`.
  `SCStatefulImgConfig`
  `setSelectedFocusedDown(String SelectedFocusedDown)`
  Image to display when the component is `selected` and `focused` on `mouse down`.
  `SCStatefulImgConfig`
  `setSelectedFocusedOver(String SelectedFocusedOver)`
  Image to display when the component is `selected` and `focused` on `roll over`.
  `SCStatefulImgConfig`
  `setSelectedOver(String SelectedOver)`
  Image to display when the component is `selected` on `roll over`.

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

  - ### SCStatefulImgConfig

    public SCStatefulImgConfig()

  - ### SCStatefulImgConfig

    public SCStatefulImgConfig(JavaScriptObject jsObj)

- ## Method Details

  - ### getOrCreateRef

    public static SCStatefulImgConfig getOrCreateRef(JavaScriptObject jsObj)

  - ### set_base

    public SCStatefulImgConfig set_base(String _base)
    The base filename for the image. This will be used if no state is applied to the stateful component displaying this image, or if no explicit entry exists for a state that is applied.
    It will also be used as a base file name for entries specified using the `"#modifier:some_value"` format.

    In some cases, an icon may have only custom states - for example, a tree-folder icon is always either opened or closed, so a `_base` entry is not required unless entries in the object use the #state or #modifier components - in this case, a warning will be logged if no `_base` is set.

    See `SCStatefulImgConfig overview` for further information.

    Parameters:
      `_base` - New _base value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls
    See Also:
      - `SCImgURL`

  - ### get_base

    public String get_base()
    The base filename for the image. This will be used if no state is applied to the stateful component displaying this image, or if no explicit entry exists for a state that is applied.
    It will also be used as a base file name for entries specified using the `"#modifier:some_value"` format.

    In some cases, an icon may have only custom states - for example, a tree-folder icon is always either opened or closed, so a `_base` entry is not required unless entries in the object use the #state or #modifier components - in this case, a warning will be logged if no `_base` is set.

    See `SCStatefulImgConfig overview` for further information.

    Returns:
      Current _base value. Default value is null
    See Also:
      - `SCImgURL`

  - ### setDisabled

    public SCStatefulImgConfig setDisabled(String Disabled)
    Image to display when the component is `disabled`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `Disabled` - New Disabled value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getDisabled

    public String getDisabled()
    Image to display when the component is `disabled`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current Disabled value. Default value is null

  - ### setDown

    public SCStatefulImgConfig setDown(String Down)
    Image to display on `mouseDown`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `Down` - New Down value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getDown

    public String getDown()
    Image to display on `mouseDown`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current Down value. Default value is null

  - ### setFocused

    public SCStatefulImgConfig setFocused(String Focused)
    Image to display when the component is `focused`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `Focused` - New Focused value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getFocused

    public String getFocused()
    Image to display when the component is `focused`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current Focused value. Default value is null

  - ### setFocusedDown

    public SCStatefulImgConfig setFocusedDown(String FocusedDown)
    Image to display when the component is `focused` on `mouse down`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `FocusedDown` - New FocusedDown value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getFocusedDown

    public String getFocusedDown()
    Image to display when the component is `focused` on `mouse down`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current FocusedDown value. Default value is null

  - ### setFocusedOver

    public SCStatefulImgConfig setFocusedOver(String FocusedOver)
    Image to display when the component is `focused` on `roll over`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `FocusedOver` - New FocusedOver value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getFocusedOver

    public String getFocusedOver()
    Image to display when the component is `focused` on `roll over`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current FocusedOver value. Default value is null

  - ### setOver

    public SCStatefulImgConfig setOver(String Over)
    Image to display on `roll over`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `Over` - New Over value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getOver

    public String getOver()
    Image to display on `roll over`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current Over value. Default value is null

  - ### setSelected

    public SCStatefulImgConfig setSelected(String Selected)
    Image to display when the component is `selected`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `Selected` - New Selected value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getSelected

    public String getSelected()
    Image to display when the component is `selected`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current Selected value. Default value is null

  - ### setSelectedDisabled

    public SCStatefulImgConfig setSelectedDisabled(String SelectedDisabled)
    Image to display when the component is `selected` and `disabled`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `SelectedDisabled` - New SelectedDisabled value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getSelectedDisabled

    public String getSelectedDisabled()
    Image to display when the component is `selected` and `disabled`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current SelectedDisabled value. Default value is null

  - ### setSelectedDown

    public SCStatefulImgConfig setSelectedDown(String SelectedDown)
    Image to display when the component is `selected` on `mouse down`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `SelectedDown` - New SelectedDown value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getSelectedDown

    public String getSelectedDown()
    Image to display when the component is `selected` on `mouse down`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current SelectedDown value. Default value is null

  - ### setSelectedFocused

    public SCStatefulImgConfig setSelectedFocused(String SelectedFocused)
    Image to display when the component is `selected` and `focused`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `SelectedFocused` - New SelectedFocused value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getSelectedFocused

    public String getSelectedFocused()
    Image to display when the component is `selected` and `focused`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current SelectedFocused value. Default value is null

  - ### setSelectedFocusedDown

    public SCStatefulImgConfig setSelectedFocusedDown(String SelectedFocusedDown)
    Image to display when the component is `selected` and `focused` on `mouse down`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `SelectedFocusedDown` - New SelectedFocusedDown value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getSelectedFocusedDown

    public String getSelectedFocusedDown()
    Image to display when the component is `selected` and `focused` on `mouse down`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current SelectedFocusedDown value. Default value is null

  - ### setSelectedFocusedOver

    public SCStatefulImgConfig setSelectedFocusedOver(String SelectedFocusedOver)
    Image to display when the component is `selected` and `focused` on `roll over`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `SelectedFocusedOver` - New SelectedFocusedOver value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getSelectedFocusedOver

    public String getSelectedFocusedOver()
    Image to display when the component is `selected` and `focused` on `roll over`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current SelectedFocusedOver value. Default value is null

  - ### setSelectedOver

    public SCStatefulImgConfig setSelectedOver(String SelectedOver)
    Image to display when the component is `selected` on `roll over`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Parameters:
      `SelectedOver` - New SelectedOver value. Default value is null
    Returns:
      `SCStatefulImgConfig` instance, for chaining setter calls

  - ### getSelectedOver

    public String getSelectedOver()
    Image to display when the component is `selected` on `roll over`.

    May be specified as

    - A `SCImgURL` indicating the media to load
    - A reference to another entry in this SCStatefulImgConfig via the format `"#state:otherStateName"`
    - A modifier to apply to the `_base` media via the format `"#modifier:modifierString"`
    See `SCStatefulImgConfig overview` for further information.
    Returns:
      Current SelectedOver value. Default value is null