protected Dimension getElementPixelSize(Element e) {
int w=0, h=0;
String s;
s = e.getAttributeNS(null,BATIK_EXT_PIXEL_WIDTH_ATTRIBUTE);
if (s.length() == 0) throw new BridgeException
(e, ERR_ATTRIBUTE_MISSING,
new Object[] {BATIK_EXT_PIXEL_WIDTH_ATTRIBUTE});
try {
w = (int)SVGUtilities.convertSVGNumber(s);
} catch (NumberFormatException ex) {
throw new BridgeException
(e, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {BATIK_EXT_PIXEL_WIDTH_ATTRIBUTE, s});
}
s = e.getAttributeNS(null,BATIK_EXT_PIXEL_HEIGHT_ATTRIBUTE);
if (s.length() == 0) throw new BridgeException
(e, ERR_ATTRIBUTE_MISSING,
new Object[] {BATIK_EXT_PIXEL_HEIGHT_ATTRIBUTE});
try {
h = (int)SVGUtilities.convertSVGNumber(s);
} catch (NumberFormatException ex) {
throw new BridgeException
(e, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {BATIK_EXT_PIXEL_HEIGHT_ATTRIBUTE, s});
}
return new Dimension(w, h);