use of net.sf.latexdraw.parser.svg.SVGImageElement in project latexdraw by arnobl.
the class SVGPicture method toSVG.
@Override
SVGElement toSVG(@NotNull final SVGDocument doc) {
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