Class Area
The area element defines a clickable region within an image map. It is used in conjunction with the map element to create interactive images with multiple clickable areas, each linking to different destinations.
Examples:
The following convenience methods are provided for constructing instances of this bean:
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionArea()Creates an emptyAreaelement.Creates anAreaelement with the specifiedshape(String),coords(String), andhref(Object)attributes. -
Method Summary
Methods inherited from class org.apache.juneau.bean.html5.HtmlElement
accesskey, attr, attrUri, class_, contenteditable, deminimize, dir, getAttr, getAttr, getAttrs, hidden, id, lang, onabort, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, oncuechange, ondblclick, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting, self, setAttrs, spellcheck, style, tabindex, title, toString, translate
-
Constructor Details
-
Area
public Area()Creates an emptyAreaelement. -
Area
Creates anAreaelement with the specifiedshape(String),coords(String), andhref(Object)attributes.- Parameters:
shape- Theshape(String)attribute. Can benull to unset the attribute.coords- Thecoords(String)attribute. Can benull to unset the attribute.href- Thehref(Object)attribute. Can benull , in which case the attribute is stored with anull value (not removed).
-
-
Method Details
-
alt
alt attribute.Specifies alternative text for the area. This text is displayed when the image map cannot be loaded and is used by screen readers for accessibility.
The alt text should be descriptive and convey the same information as the clickable area.
- Parameters:
value- Alternative text for the area. Can benull to unset the attribute.- Returns:
- This object.
-
coords
coords attribute.Specifies the coordinates of the clickable area within the image map. The format depends on the shape:
Coordinate formats:
"rect" - x1,y1,x2,y2 (top-left and bottom-right corners)"circle" - x,y,radius (center point and radius)"poly" - x1,y1,x2,y2,x3,y3,... (polygon vertices)"default" - No coordinates needed
- Parameters:
value- The coordinates defining the clickable area. Can benull to unset the attribute.- Returns:
- This object.
-
download
download attribute.Whether to download the resource instead of navigating to it, and its file name if so.
-
href
href attribute.Address of the hyperlink.
The value can be of any of the following types:
URI,URL,String. Strings must be valid URIs.URIs defined by
UriResolvercan be used for values. -
hreflang
hreflang attribute.Specifies the language of the linked resource. Used for SEO and accessibility purposes.
Examples:
"en" - English"es" - Spanish"fr" - French"de" - German"zh" - Chinese"ja" - Japanese
- Parameters:
value- The language code of the linked resource. Can benull to unset the attribute.- Returns:
- This object.
-
rel
rel attribute.Specifies the relationship between the current document and the linked resource.
Common values:
"alternate" - Alternative version of the page"author" - Link to the author of the page"bookmark" - Permalink for bookmarking"external" - External link"help" - Link to help documentation"license" - Link to license information"next" - Next page in a sequence"nofollow" - Don't follow this link for SEO"noreferrer" - Don't send referrer information"prev" - Previous page in a sequence"search" - Link to search functionality"tag" - Tag for the current page
- Parameters:
value- The relationship between the document and linked resource. Can benull to unset the attribute.- Returns:
- This object.
-
shape
shape attribute.Specifies the shape of the clickable area in an image map.
Possible values:
"rect" - Rectangular area (default)"circle" - Circular area"poly" - Polygonal area"default" - Entire image area
- Parameters:
value- The shape of the clickable area. Can benull to unset the attribute.- Returns:
- This object.
-
target
target attribute.Specifies where to open the linked resource when the area is clicked.
Common values:
"_blank" - Open in a new window/tab"_self" - Open in the same frame (default)"_parent" - Open in the parent frame"_top" - Open in the full body of the window"framename" - Open in a named frame
- Parameters:
value- Where to open the linked resource. Can benull to unset the attribute.- Returns:
- This object.
-
type
type attribute.Specifies the MIME type of the linked resource. Helps browsers determine how to handle the resource.
Common values:
"text/html" - HTML document"text/css" - CSS stylesheet"application/pdf" - PDF document"image/png" - PNG image"application/zip" - ZIP archive
- Parameters:
value- The MIME type of the linked resource. Can benull to unset the attribute.- Returns:
- This object.
-