private static void writeMapEntry(final XmlWriter writer,
final ImageMapEntry mapEntry,
final double scale) throws IOException
{
final AttributeList attrs = new AttributeList();
final String[] mapNamespaces = mapEntry.getNameSpaces();
for (int i = 0; i < mapNamespaces.length; i++)
{
final String namespace = mapNamespaces[i];
final String[] names = mapEntry.getNames(namespace);
for (int j = 0; j < names.length; j++)
{
final String name = names[j];
final String value = mapEntry.getAttribute(namespace, name);
attrs.setAttribute(namespace, name, value);
}
}
final String areaType = mapEntry.getAreaType();
attrs.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "shape", areaType);
if ("default".equals(areaType) == false)
{
final float[] coordinates = mapEntry.getAreaCoordinates();
attrs.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "coords", convertCoordinates(coordinates, scale));
}
writer.writeTag(LibXmlInfo.XHTML_NAMESPACE, "area", attrs, XmlWriter.CLOSE);
}