summaryrefslogtreecommitdiffstats
path: root/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/html/HTMLWrapper.java
diff options
context:
space:
mode:
Diffstat (limited to 'collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/html/HTMLWrapper.java')
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/html/HTMLWrapper.java43
1 files changed, 8 insertions, 35 deletions
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/html/HTMLWrapper.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/html/HTMLWrapper.java
index 076e28fd70..e53c9ff90f 100755
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/html/HTMLWrapper.java
+++ b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/html/HTMLWrapper.java
@@ -37,33 +37,23 @@ public class HTMLWrapper {
private File htmlFilePath;
private String compositeName;
- private String svgFileName;
- private int compositeHeight, compositeWidth;
- private Document svg;
- private static final String CANVG_LIB_DIR = System.getProperty("user.dir")+"/resources/";
- private static final String CANVG_FILE = "canvg-1.0.js";
- private static final String RGB_FILE = "rgbcolor.js";
+ private String svg;
+
/**
*
+ * @param svg
* @param compositeName
- * @param svgFileName
- * @param compositeHeight
- * @param compositeWidth
* @param htmlFilePath
*/
- public HTMLWrapper(Document svg, String compositeName, String svgFileName,
- int compositeHeight, int compositeWidth, File htmlFilePath) {
+ public HTMLWrapper(String svg, String compositeName, File htmlFilePath) {
this.svg = svg;
this.compositeName = compositeName;
- this.svgFileName = svgFileName;
- this.compositeHeight = compositeHeight;
- this.compositeWidth = compositeWidth;
this.htmlFilePath = htmlFilePath;
}
- public void buildHTML() throws Exception{
+ public String buildHTML() throws Exception{
String content = "" +
"<html>\n" +
"<head>\n" +
@@ -83,7 +73,7 @@ public class HTMLWrapper {
// "</script>\n" +
"</head>\n" +
"<body>\n" +
- extractSvg()+"\n"+
+ svg+"\n"+
// "<canvas id=\"canvas\" width=\""+compositeWidth+"px\" height=\""+compositeHeight+"px\">\n" +
// "</canvas>\n" +
"</body>\n" +
@@ -91,25 +81,8 @@ public class HTMLWrapper {
fileWriter(content);
- }
-
- public String extractSvg() throws Exception{
-
- // Set up the output transformer
- TransformerFactory transfac = TransformerFactory.newInstance();
- Transformer trans = transfac.newTransformer();
-
- // Print the DOM node
-
- StringWriter sw = new StringWriter();
- StreamResult result = new StreamResult(sw);
- DOMSource source = new DOMSource(svg);
- trans.transform(source, result);
- String svgString = sw.toString();
-
- System.out.println(svgString);
-
- return svgString;
+ return content;
+
}