Author: komal
Date: 2011-07-12 08:20:24 -0700 (Tue, 12 Jul 2011)
New Revision: 26146

Added:
   
csplugins/trunk/soc/komal/ExportToCWPlugin/src/main/java/org/cytoscape/komal/STNew.java
Log:


Added: 
csplugins/trunk/soc/komal/ExportToCWPlugin/src/main/java/org/cytoscape/komal/STNew.java
===================================================================
--- 
csplugins/trunk/soc/komal/ExportToCWPlugin/src/main/java/org/cytoscape/komal/STNew.java
                             (rev 0)
+++ 
csplugins/trunk/soc/komal/ExportToCWPlugin/src/main/java/org/cytoscape/komal/STNew.java
     2011-07-12 15:20:24 UTC (rev 26146)
@@ -0,0 +1,79 @@
+package main.java.org.cytoscape.komal;
+
+import java.io.*;
+import cytoscape.logger.CyLogger;
+
+import org.antlr.stringtemplate.*;
+import org.stringtemplate.v4.*;
+import org.antlr.stringtemplate.language.*;
+
+public class STNew extends ExportToCWPlugin {
+
+    public static String result;
+    public static String indexhtml;
+
+    public void STMake() {
+
+        CyLogger.getLogger().info("STNew.java called");
+
+        String currentdir = System.getProperty("user.dir");
+        File dir = new File(currentdir);
+        CyLogger.getLogger().info("Current Working Directory : " + dir);
+
+        InputStream is = 
ClassLoader.getSystemClassLoader().getResourceAsStream("main/resources/org/cytoscape/komal/page3.st");
+        StringBuffer sb = new StringBuffer();
+        BufferedReader bf = null;
+
+        try {
+            bf = new BufferedReader(new InputStreamReader(is));
+
+            while (bf.ready()) {
+                sb.append(bf.readLine() + "\n");
+            }
+        } catch (IOException e) {
+// TODO Auto-generated catch block
+            e.printStackTrace();
+        } finally {
+            try {
+                bf.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        STGroupString group = new STGroupString("");
+        group.delimiterStartChar = '$';
+        group.delimiterStopChar = '$';
+
+        ST st = new ST(group, sb.toString());
+
+        st.add("titleofhtml", htmlname);
+        st.add("title", titleofpage);
+        st.add("network", urlofxgmml);
+        st.add("description", descriptionofnetwork);
+        st.add("logo", urloflogo);
+
+        result = st.render();
+
+        CyLogger.getLogger().info("Attributes added");
+
+        BuildHtml o = new BuildHtml();
+        o.openFile();
+        o.addRecords(result);
+        indexhtml = o.completeurl();
+
+        o.closeFile();
+        CyLogger.getLogger().info("HTML CLOSED");
+
+        STNew t = new STNew();
+        t.openthehtmlfile();
+
+    }
+
+    void openthehtmlfile() {
+        String x[] = {indexhtml};
+        OpenBrowser.main(x);
+    }
+}
+
+

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to