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
  • Field Details

    • DEFAULT

      static final IArea DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.wgt.Area"

      Specified by:
      getWidgetClass in interface IComponent<IArea>
      Returns:
    • getCoords

      @Nullable String getCoords()
      Returns the coordination of this area.
    • withCoords

      IArea withCoords(@Nullable 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 String getShape()
      Returns the shape of this area.

      Default: null (means rectangle).

    • withShape

      IArea withShape(@Nullable 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 String getTooltiptext()
      Returns the text as the tooltip.

      Default: null.

    • withTooltiptext

      IArea withTooltiptext(@Nullable 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 Integer getTabindex()
      Returns null if not set.
      Returns:
      the tab order of this component
    • withTabindex

      IArea withTabindex(@Nullable 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(String coords)
      Returns the instance with the given coordinates.
      Parameters:
      coords - The coordinates of this area.
    • ofId

      static IArea ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component