buf.append("<map name=\"generated_map\">\n");
// we need to find out the source rect that was taken
// to construct the image, so we can base the bounds
// on this minimal bound
Rectangle rect = partRectangleMap.get(root);
// for all the saved children
for (RenderedChildInformation child : partChildrenListMap.get(root)) {
// do any edit parts link up to this one?
DiagramEditPart found = null;
for (DiagramEditPart target : partEObjectMap.keySet()) {
if (EcoreUtil.equals(partEObjectMap.get(target), child.getResolvedObject())) {
found = target;
break;
}
}
if (found != null) {
// found a link
// assume the link is square
Rectangle bounds = child.getBounds();
IPath dest = partDestinationMap.get(found);
buf.append("<area shape=\"rect\" coords=\"")
.append(bounds.x-rect.x).append(",")
.append(bounds.y-rect.y).append(",")
.append(bounds.width+bounds.x-rect.x).append(",")
.append(bounds.height+bounds.y-rect.y)
.append("\" href=\"")
.append(escapeHTML(getHTMLDestinationFor(dest).lastSegment()))
.append("\" alt=\"")
.append(escapeHTML(child.getTooltip()))
.append("\" title=\"")
.append(escapeHTML(child.getTooltip()))
.append("\" />\n");
} else {
// we can still add tooltip information anyway
Rectangle bounds = child.getBounds();
buf.append("<area shape=\"rect\" coords=\"")
.append(bounds.x-rect.x).append(",")
.append(bounds.y-rect.y).append(",")
.append(bounds.width+bounds.x-rect.x).append(",")