try {
for(final IShape sh : shapes) {
// For each shape an SVG element is created.
elt = SVGShapesFactory.INSTANCE.createSVGElement(sh, doc);
if(elt!=null)
g.appendChild(elt);
setProgress((int)Math.min(100., getProgress()+incr));
}
}catch(final Exception ex) { BadaboomCollector.INSTANCE.add(ex); }
// Setting SVG attributes to the created document.
root.setAttribute(SVGAttributes.SVG_VERSION, "1.1");//$NON-NLS-1$