Package org.zkoss.stateless.sul

## Interface IImagemap

- All Superinterfaces:
    `IAnyGroup<IImagemap>`, `IChildable<IImagemap,​IArea>`, `IComponent<IImagemap>`, `IHtmlBasedComponent<IImagemap>`, `IImageBase<IImagemap>`, `IXulElement<IImagemap>`

      public interface IImagemap
      extends IImageBase<IImagemap>, IChildable<IImagemap,​IArea>, IAnyGroup<IImagemap>

  Immutable `Imagemap` component

  An `IImagemap` component is a special image. It accepts whatever attribute an `IImage` component accepts. However, unlike `IImage`, it support `IArea` as its children. The `IImagemap` component will translate the mouse pointer coordinates into a logical name, which is the id of the `IArea` that user clicked. For example:

       @RichletMapping("/example")
       public IComponent example() {
           return IImagemap.of(
               IArea.ofId("left").withCoords("0, 0, 45, 80"),
               IArea.ofId("right").withCoords("46, 0, 90, 80")
           ).withSrc("/stateless/ZK-Logo.gif").withAction(this::doClick);
       }

       @Action(type = Events.ON_CLICK)
       public void doClick(MouseData mouseData) {
           Clients.log(mouseData.getArea());
       }

  The above example shows how to use `Imagemap` with `IArea`. The ZK-Logo.gif is a 90x80 image, we divide the image into 2 parts left and right by using `IArea.withCoords(String)`. Once you clicked on the area of `Imagemap`, you can get the id of the `IArea` through `MouseData`. Note: Don't try to use CSS background as your image, the image map need a real image or it won't work.

  Author:
    katherine
  See Also:
    `Imagemap`, `IArea`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IImagemap.Builder` | Builds instances of type `IImagemap`.
    `static class` | `IImagemap.Updater` | Builds an updater of type `IImagemap` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `static <I extends IArea> IImagemap` | `of​(I... areas)` | Returns the instance with the given `areas`.
    `static <I extends IArea> IImagemap` | `of​(java.lang.Iterable<? extends I> areas)` | Returns the instance with the given `areas`.
    `static IImagemap` | `of​(java.lang.String src)` | Returns the instance with the given `src`.
    `static IImagemap` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static IImagemap` | `ofSize​(java.lang.String width, java.lang.String height)` | Returns the instance with the given `width` and `height`.

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

      `getChildren, withChildren, withChildren`

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

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

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

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

      `getContent, getHover, getSrc, isPreloadImage, withContent, withContent, withHover, withPreloadImage, withSrc`

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

      `getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip`

- - ### Field Detail

    - #### DEFAULT

          static final IImagemap 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.Imagemap"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IImagemap>`

    - #### of

          static IImagemap of​(java.lang.String src)

      Returns the instance with the given `src`.
      Parameters:
        `src` - The URI of the image source.

    - #### of

          static <I extends IArea> IImagemap of​(java.lang.Iterable<? extends I> areas)

      Returns the instance with the given `areas`.
      Parameters:
        `areas` - The `IArea` list as the children of this component.

    - #### of

          static <I extends IArea> IImagemap of​(I... areas)

      Returns the instance with the given `areas`.
      Parameters:
        `areas` - The `IArea` as the children of this component.

    - #### ofSize

          static IImagemap ofSize​(java.lang.String width,
                                  java.lang.String height)

      Returns the instance with the given `width` and `height`.
      Parameters:
        `width` - The width of the image.
        `height` - The height of the image.

    - #### ofId

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

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