@Override protected void onComponentTag(ComponentTag tag) { // Must be attached to an map tag checkComponentTag(tag, "map"); super.onComponentTag(tag); }
@Override public String getObject() { return "#" + getMarkupId(); } }
/** * Constructs a client-side image map which is "attached" to the given {@link Image} component. * * @param id * the component id * @param image * the image component */ public ClientSideImageMap(String id, Image image) { super(id); setOutputMarkupId(true); add(AttributeModifier.replace("name", new PropertyModel<String>(this, "markupId"))); image.add(AttributeModifier.replace("usemap", new UsemapModel())); areas = new RepeatingView("area"); add(areas); }
/** * Adds an area defined by a shape object. * * @param link * the link * @param shape * the shape * @return this */ public ClientSideImageMap addShapeArea(AbstractLink link, Shape shape) { areas.add(link); link.add(new Area(shapeCoordinates(shape), POLYGON)); return this; }
/** * Adds a polygon-shaped area defined by coordinates. * * @param link * the link * @param coordinates * the coordinates for the polygon * @return This */ public ClientSideImageMap addPolygonArea(AbstractLink link, int... coordinates) { areas.add(link); link.add(new Area(polygonCoordinates(coordinates), POLYGON)); return this; }
/** * Adds a circle-shaped area centered at (x,y) with radius r. * * @param link * the link * @param x * x coordinate of the center of the circle * @param y * y coordinate of center * @param radius * the radius * @return this */ public ClientSideImageMap addCircleArea(AbstractLink link, int x, int y, int radius) { areas.add(link); link.add(new Area(circleCoordinates(x, y, radius), CIRCLE)); return this; }
/** * Adds a rectangular-shaped area. * * @param link * the link * @param x1 * top left x * @param y1 * top left y * @param x2 * bottom right x * @param y2 * bottom right y * @return this */ public ClientSideImageMap addRectangleArea(AbstractLink link, int x1, int y1, int x2, int y2) { areas.add(link); link.add(new Area(rectangleCoordinates(x1, y1, x2, y2), RECTANGLE)); return this; }
/** * Constructs a client-side image map which is "attached" to the given {@link Image} component. * * @param id * the component id * @param image * the image component */ public ClientSideImageMap(String id, Image image) { super(id); setOutputMarkupId(true); add(AttributeModifier.replace("name", new PropertyModel<String>(this, "markupId"))); image.add(AttributeModifier.replace("usemap", new UsemapModel())); areas = new RepeatingView("area"); add(areas); }
/** * Adds an area defined by a shape object. * * @param link * the link * @param shape * the shape * @return this */ public ClientSideImageMap addShapeArea(AbstractLink link, Shape shape) { areas.add(link); link.add(new Area(shapeCoordinates(shape), POLYGON)); return this; }
/** * Adds a polygon-shaped area defined by coordinates. * * @param link * the link * @param coordinates * the coordinates for the polygon * @return This */ public ClientSideImageMap addPolygonArea(AbstractLink link, int... coordinates) { areas.add(link); link.add(new Area(polygonCoordinates(coordinates), POLYGON)); return this; }
/** * Adds a circle-shaped area centered at (x,y) with radius r. * * @param link * the link * @param x * x coordinate of the center of the circle * @param y * y coordinate of center * @param radius * the radius * @return this */ public ClientSideImageMap addCircleArea(AbstractLink link, int x, int y, int radius) { areas.add(link); link.add(new Area(circleCoordinates(x, y, radius), CIRCLE)); return this; }
/** * Adds a rectangular-shaped area. * * @param link * the link * @param x1 * top left x * @param y1 * top left y * @param x2 * bottom right x * @param y2 * bottom right y * @return this */ public ClientSideImageMap addRectangleArea(AbstractLink link, int x1, int y1, int x2, int y2) { areas.add(link); link.add(new Area(rectangleCoordinates(x1, y1, x2, y2), RECTANGLE)); return this; }
/** * Constructs a client-side image map which is "attached" to the given {@link Image} component. * * @param id * the component id * @param image * the image component */ public ClientSideImageMap(String id, Image image) { super(id); setOutputMarkupId(true); add(new AttributeModifier("name", true, new PropertyModel<String>(this, "markupId"))); image.add(new AttributeModifier("usemap", true, new UsemapModel())); areas = new RepeatingView("area"); add(areas); }
@Override public String getObject() { return "#" + getMarkupId(); } }
@Override protected void onComponentTag(ComponentTag tag) { // Must be attached to an map tag checkComponentTag(tag, "map"); super.onComponentTag(tag); }
/** * Adds an area defined by a shape object. * * @param link * the link * @param shape * the shape * @return this */ public ClientSideImageMap addShapeArea(AbstractLink link, Shape shape) { areas.add(link); link.add(new Area(shapeCoordinates(shape), POLYGON)); return this; }
/** * Adds a polygon-shaped area defined by coordinates. * * @param link * the link * @param coordinates * the coordinates for the polygon * @return This */ public ClientSideImageMap addPolygonArea(AbstractLink link, int... coordinates) { areas.add(link); link.add(new Area(polygonCoordinates(coordinates), POLYGON)); return this; }
/** * Adds a circle-shaped area centered at (x,y) with radius r. * * @param link * the link * @param x * x coordinate of the center of the circle * @param y * y coordinate of center * @param radius * the radius * @return this */ public ClientSideImageMap addCircleArea(AbstractLink link, int x, int y, int radius) { areas.add(link); link.add(new Area(circleCoordinates(x, y, radius), CIRCLE)); return this; }
/** * Adds a rectangular-shaped area. * * @param link * the link * @param x1 * top left x * @param y1 * top left y * @param x2 * bottom right x * @param y2 * bottom right y * @return this */ public ClientSideImageMap addRectangleArea(AbstractLink link, int x1, int y1, int x2, int y2) { areas.add(link); link.add(new Area(rectangleCoordinates(x1, y1, x2, y2), RECTANGLE)); return this; }
@Override public String getObject() { return "#" + getMarkupId(); } }