summaryrefslogtreecommitdiffstats
path: root/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-05-13 06:03:58 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-05-13 06:03:58 +0000
commita8bf783d679577a3bfdf14e09dc9251c4ee258a5 (patch)
treea5751c88ec7fcf0de2fa3bfaad7579acf5040639 /collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java
parente5e2ec296c123604eae67c0763d8ab3b91f692f1 (diff)
TUSCANY-3496: Add Nirmal's prototype code for the composite diagram GSoC project to the collaboration area
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1102569 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java')
-rw-r--r--collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java
new file mode 100644
index 0000000000..72d3aea69c
--- /dev/null
+++ b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java
@@ -0,0 +1,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;
+ }
+}