Package org.zkoss.stateless.sul

## Interface IArea

- All Superinterfaces:
    `IComponent<IArea>`

      public interface IArea
      extends IComponent<IArea>

  Immutable `Area` component

  An area of an `IImagemap`. Instead of the application processing the coordinates, developers can add the `IArea` components as children of a `IImagemap` component thus defining a target. The `IImagemap` component will translate the mouse pointer coordinates into a logical name e.g. The id of the area the user clicked. If the coordinates in one area component overlap with another, the first one takes precedence.

  Author:
    katherine
  See Also:
    `Area`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IArea.Builder` | Builds instances of type `IArea`.
    `static class` | `IArea.Shape` | Insert Adjacent `direction` for `withShape(Shape)`}
    `static class` | `IArea.Updater` | Builds an updater of type `IArea` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IArea` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getCoords()` | Returns the coordination of this area.
    `java.lang.String` | `getShape()` | Returns the shape of this area.
    `java.lang.Integer` | `getTabindex()` | Returns `null` if not set.
    `java.lang.String` | `getTooltiptext()` | Returns the text as the tooltip.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `static IArea` | `of​(java.lang.String coords)` | Returns the instance with the given coordinates.
    `static IArea` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `IArea` | `withCoords​(java.lang.String coords)` | Returns a copy of `this` immutable component with the specified `coords`.
    `IArea` | `withShape​(java.lang.String shape)` | Returns a copy of `this` immutable component with the specified `shape`.
    `default IArea` | `withShape​(IArea.Shape shape)` | Returns a copy of `this` immutable component with the specified `shape`.
    `IArea` | `withTabindex​(java.lang.Integer tabindex)` | Returns a copy of `this` immutable component with the specified `tabindex`.
    `IArea` | `withTooltiptext​(java.lang.String tooltiptext)` | Returns a copy of `this` immutable component with the specified `tooltiptext`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides`

- - ### Field Detail

    - #### DEFAULT

          static final IArea DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zul.wgt.Area"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IArea>`
      Returns:

    - #### getCoords

          @Nullable
          java.lang.String getCoords()

      Returns the coordination of this area.

    - #### withCoords

          IArea withCoords​(@Nullable
                           java.lang.String coords)

      Returns a copy of `this` immutable component with the specified `coords`.

      Sets the `coords` of this area. Its content depends on `getShape()`:

      circle
        coords="x,y,r"
      polygon
        coords="x1,y1,x2,y2,x3,y3..."
        The polygon is automatically closed, so it is not necessary to repeat the first coordination.
      rectangle
        coords="x1,y1,x2,y2"

      Note: (0, 0) is the upper-left corner. If the coordinates in one IArea component overlap with another, the first one takes precedence.

      Returns:
        A modified copy of the `this` object

    - #### getShape

          @Nullable
          java.lang.String getShape()

      Returns the shape of this area.

      Default: `null` (means rectangle).

    - #### withShape

          IArea withShape​(@Nullable
                          java.lang.String shape)

      Returns a copy of `this` immutable component with the specified `shape`.

      Sets the `shape` of this IArea.

      Parameters:
        `shape` - `"rectangle"`, `"rect"`, `"circle"`, `"cric"`, `"polygon"`, `"poly"` or `null`.
      Returns:
        A modified copy of the `this` object

    - #### withShape

          default IArea withShape​(IArea.Shape shape)

      Returns a copy of `this` immutable component with the specified `shape`.

      Sets the `shape` of this IArea.

      Parameters:
        `shape` - `IArea.Shape.RECTANGLE`, `IArea.Shape.CIRCLE` or `IArea.Shape.POLYGON`.
      Returns:
        A modified copy of the `this` object

    - #### getTooltiptext

          @Nullable
          java.lang.String getTooltiptext()

      Returns the text as the tooltip.

      Default: `null`.

    - #### withTooltiptext

          IArea withTooltiptext​(@Nullable
                                java.lang.String tooltiptext)

      Returns a copy of `this` immutable component with the specified `tooltiptext`.

      Sets the text as the tooltip.

      Parameters:
        `tooltiptext` - The text as the tooltip.
      Returns:
        A modified copy of the `this` object

    - #### getTabindex

          @Nullable
          java.lang.Integer getTabindex()

      Returns `null` if not set.
      Returns:
        the tab order of this component

    - #### withTabindex

          IArea withTabindex​(@Nullable
                             java.lang.Integer tabindex)

      Returns a copy of `this` immutable component with the specified `tabindex`.

      Sets the tab order of this component. Removes the tabindex attribute if it's set to `null`.

      Parameters:
        `tabindex` - The tab order of this component.
      Returns:
        A modified copy of the `this` object

    - #### of

          static IArea of​(java.lang.String coords)

      Returns the instance with the given coordinates.
      Parameters:
        `coords` - The coordinates of this area.

    - #### ofId

          static IArea ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component