return;
}
//xmlWriter.writeComment("Drawable content:" + source);
// Write image reference ..
final ImageMap imageMap;
final AttributeList attrList = new AttributeList();
attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, SRC_ATTR, name);
attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, "border", "0");
final Object imageMapNameOverride = attributes.getAttribute
(AttributeNames.Html.NAMESPACE, AttributeNames.Html.IMAGE_MAP_OVERRIDE);
if (imageMapNameOverride != null)
{
attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, String.valueOf(imageMapNameOverride));
imageMap = null;
}
else
{
// only generate a image map, if the user does not specify their own onw via the override.
// Of course, they would have to provide the map by other means as well.
imageMap = RenderUtility.extractImageMap(node);
if (imageMap != null)
{
final String mapName = imageMap.getAttribute(HtmlPrinter.XHTML_NAMESPACE, "name");
if (mapName != null)
{
attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, "#" + mapName);
}
else
{
final String generatedName = "generated_" + name + "_map"; //NON-NLS
imageMap.setAttribute(HtmlPrinter.XHTML_NAMESPACE, "name", generatedName);
//noinspection MagicCharacter
attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, '#' + generatedName);//NON-NLS
}
}
}