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>
ImmutableImagemapcomponentAn
IImagemapcomponent is a special image. It accepts whatever attribute anIImagecomponent accepts. However, unlikeIImage, it supportIAreaas its children. TheIImagemapcomponent will translate the mouse pointer coordinates into a logical name, which is the id of theIAreathat 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
ImagemapwithIArea. The ZK-Logo.gif is a 90x80 image, we divide the image into 2 parts left and right by usingIArea.withCoords(String). Once you clicked on the area ofImagemap, you can get the id of theIAreathroughMouseData. 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 classIImagemap.BuilderBuilds instances of typeIImagemap.static classIImagemap.UpdaterBuilds an updater of typeIImagemapforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default java.lang.StringgetWidgetClass()Returns the client widget class.static <I extends IArea>
IImagemapof(I... areas)Returns the instance with the givenareas.static <I extends IArea>
IImagemapof(java.lang.Iterable<? extends I> areas)Returns the instance with the givenareas.static IImagemapof(java.lang.String src)Returns the instance with the givensrc.static IImagemapofId(java.lang.String id)Returns the instance with the given id.static IImagemapofSize(java.lang.String width, java.lang.String height)Returns the instance with the givenwidthandheight.-
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:
getWidgetClassin interfaceIComponent<IImagemap>
-
of
static IImagemap of(java.lang.String src)
Returns the instance with the givensrc.- 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 givenareas.- Parameters:
areas- TheIArealist as the children of this component.
-
of
static <I extends IArea> IImagemap of(I... areas)
Returns the instance with the givenareas.- Parameters:
areas- TheIAreaas the children of this component.
-
ofSize
static IImagemap ofSize(java.lang.String width, java.lang.String height)
Returns the instance with the givenwidthandheight.- 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
-
-