use of net.sf.latexdraw.parsers.svg.SVGImageElement in project latexdraw by arnobl.
the class SVGPicture method toSVG.
@Override
public SVGElement toSVG(final SVGDocument doc) {
if (doc == null)
return null;
final SVGElement root = new SVGGElement(doc);
final SVGElement img;
root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE + ':' + LNamespace.XML_TYPE, LNamespace.XML_TYPE_PICTURE);
root.setAttribute(SVGAttributes.SVG_ID, getSVGID());
img = new SVGImageElement(doc, shape.getPathSource());
img.setAttribute(SVGAttributes.SVG_X, String.valueOf(shape.getPosition().getX()));
img.setAttribute(SVGAttributes.SVG_Y, String.valueOf(shape.getPosition().getY()));
img.setAttribute(SVGAttributes.SVG_HEIGHT, String.valueOf(shape.getImage().getHeight()));
img.setAttribute(SVGAttributes.SVG_WIDTH, String.valueOf(shape.getImage().getWidth()));
setSVGRotationAttribute(root);
root.appendChild(img);
return root;
}
Aggregations