void (final Dimension dimension, @NonNls final String elementName) { if (dimension.width == -1 && dimension.height == -1) { return; } startElement(elementName); try { addAttribute("width", dimension.width); addAttribute("height", dimension.height); } finally { endElement(); } }