Class ClientSideImageMap

    • Constructor Detail

      • ClientSideImageMap

        public ClientSideImageMap​(String id,
                                  Image image)
        Constructs a client-side image map which is "attached" to the given Image component.
        Parameters:
        id - the component id
        image - the image component
    • Method Detail

      • onComponentTag

        protected void onComponentTag​(ComponentTag tag)
        Description copied from class: Component
        Processes the component tag. Overrides of this method most likely should call the super implementation.
        Overrides:
        onComponentTag in class Component
        Parameters:
        tag - Tag to modify
      • newChildId

        public String newChildId()
        Generates a unique id string. This makes it easy to add items to be rendered w/out having to worry about generating unique id strings in your code.
        Returns:
        unique child id
      • addCircleArea

        public ClientSideImageMap addCircleArea​(AbstractLink link,
                                                int x,
                                                int y,
                                                int radius)
        Adds a circle-shaped area centered at (x,y) with radius r.
        Parameters:
        link - the link
        x - x coordinate of the center of the circle
        y - y coordinate of center
        radius - the radius
        Returns:
        this
      • addPolygonArea

        public ClientSideImageMap addPolygonArea​(AbstractLink link,
                                                 int... coordinates)
        Adds a polygon-shaped area defined by coordinates.
        Parameters:
        link - the link
        coordinates - the coordinates for the polygon
        Returns:
        This
      • addRectangleArea

        public ClientSideImageMap addRectangleArea​(AbstractLink link,
                                                   int x1,
                                                   int y1,
                                                   int x2,
                                                   int y2)
        Adds a rectangular-shaped area.
        Parameters:
        link - the link
        x1 - top left x
        y1 - top left y
        x2 - bottom right x
        y2 - bottom right y
        Returns:
        this