1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package org.apache.tuscany.sca.impl.artifacts;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class Text {
public static Element addTextElement(Document document,
String svgNs, int x, int y, String content) {
Element text = document.createElementNS(svgNs, "text");
text.setAttributeNS(null, "x", x+"");
text.setAttributeNS(null, "y", y+"");
text.setAttributeNS(null, "text-anchor", "middle");
text.setAttributeNS(null, "dominant-baseline", "mathematical");
text.setAttributeNS(null, "font-size", "20");
text.setTextContent(content);
return text;
}
}
|