tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r1166477 - in /tuscany/collaboration/GSoC-2011-Nirmal: CompositeDiagramGeneratorUsingBatik/ CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/generator/ CompositeDiagramGeneratorUsingBatik/src/main/java/org/ap...
Date Thu, 08 Sep 2011 00:45:19 GMT
Author: rfeng
Date: Thu Sep  8 00:45:19 2011
New Revision: 1166477

URL: http://svn.apache.org/viewvc?rev=1166477&view=rev
Log:
Further clean-up of the code

Added:
    tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
  (with props)
Modified:
    tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/pom.xml
    tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java
    tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/io/
    tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java
    tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/pom.xml
    tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java

Modified: tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/pom.xml?rev=1166477&r1=1166476&r2=1166477&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/pom.xml (original)
+++ tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/pom.xml Thu
Sep  8 00:45:19 2011
@@ -21,11 +21,16 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-composite-diagram</artifactId>
-    <version>0.0.1</version>
+    <version>2.0-SNAPSHOT</version>
     <name>Apache Tuscany SCA Composite Diagram Generator Application</name>
 
     <dependencies>
         <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
+            <version>1.2</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.xmlgraphics</groupId>
             <artifactId>batik-anim</artifactId>
             <version>1.7</version>
@@ -110,11 +115,12 @@
     <build>
         <defaultGoal>install</defaultGoal>
         <directory>${basedir}/target</directory>
-        <finalName>${artifactId}-${version}</finalName>
+        <finalName>${project.artifactId}-${project.version}</finalName>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
                 <configuration>
                     <source>1.5</source>
                     <target>1.5</target>
@@ -122,7 +128,9 @@
             </plugin>
 
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
+                <version>2.1</version>
                 <executions>
                     <execution>
                         <id>${project.artifactId}-fetch-deps</id>

Modified: tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java?rev=1166477&r1=1166476&r2=1166477&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java
(original)
+++ tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java
Thu Sep  8 00:45:19 2011
@@ -139,10 +139,11 @@ public class DiagramGenerator {
 
     private void addReferencePromotion() {
 
-        for (Iterator it = comp.getPromoteAReference().entrySet().iterator(); it.hasNext();)
{
-            Entry entry = (Entry)it.next();
-            String compositeRef = (String)entry.getKey();
-            ArrayList<String> componentRef = (ArrayList<String>)entry.getValue();
+        for (Iterator<Entry<String, ArrayList<String>>> it = comp.getPromoteAReference().entrySet().iterator();
it
+            .hasNext();) {
+            Entry<String, ArrayList<String>> entry = it.next();
+            String compositeRef = entry.getKey();
+            ArrayList<String> componentRef = entry.getValue();
 
             ReferenceArtifact r1 = getRef(compositeRef);
 
@@ -160,10 +161,10 @@ public class DiagramGenerator {
 
     private void addServicePromotion() {
 
-        for (Iterator it = comp.getPromoteAService().entrySet().iterator(); it.hasNext();)
{
-            Entry entry = (Entry)it.next();
-            String compositeSer = (String)entry.getKey();
-            String componentSer = (String)entry.getValue();
+        for (Iterator<Entry<String, String>> it = comp.getPromoteAService().entrySet().iterator();
it.hasNext();) {
+            Entry<String, String> entry = it.next();
+            String compositeSer = entry.getKey();
+            String componentSer = entry.getValue();
 
             ServiceArtifact s1 = getSer(compositeSer);
             ServiceArtifact s2 = getSer(componentSer);
@@ -222,10 +223,11 @@ public class DiagramGenerator {
         for (Entity ent : comp.getComponentList()) {
             //if(ent instanceof ComponentEntity){
 
-            for (Iterator it = ((ComponentEntity)ent).getReferenceToServiceMap().entrySet().iterator();
it.hasNext();) {
-                Entry entry = (Entry)it.next();
-                String ref = (String)entry.getKey();
-                String ser = (String)entry.getValue();
+            for (Iterator<Entry<String, String>> it =
+                ((ComponentEntity)ent).getReferenceToServiceMap().entrySet().iterator();
it.hasNext();) {
+                Entry<String, String> entry = it.next();
+                String ref = entry.getKey();
+                String ser = entry.getValue();
 
                 ReferenceArtifact r = getRef(ref);
                 ServiceArtifact s = getSer(ser);
@@ -415,11 +417,11 @@ public class DiagramGenerator {
             sers.add(i, "");
         }
 
-        for (Iterator it = e.getReferenceToServiceMap().entrySet().iterator(); it.hasNext();)
{
+        for (Iterator<Entry<String, String>> it = e.getReferenceToServiceMap().entrySet().iterator();
it.hasNext();) {
 
-            Entry entry = (Entry)it.next();
-            String ref = (String)entry.getKey();
-            String ser = (String)entry.getValue();
+            Entry<String, String> entry = it.next();
+            String ref = entry.getKey();
+            String ser = entry.getValue();
             //System.out.println("---------"+ref);
             int idx = refs.indexOf(ref);
             //System.out.println("---------"+sers.get(idx));

Modified: tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java?rev=1166477&r1=1166476&r2=1166477&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java
(original)
+++ tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java
Thu Sep  8 00:45:19 2011
@@ -20,103 +20,124 @@
 package org.apache.tuscany.sca.diagram.main;
 
 import java.io.File;
+import java.io.FileWriter;
 import java.io.StringWriter;
 
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
 import org.apache.tuscany.sca.diagram.generator.DiagramGenerator;
 import org.apache.tuscany.sca.diagram.html.HTMLWrapper;
-import org.apache.tuscany.sca.diagram.io.XMLReader;
-import org.apache.tuscany.sca.diagram.io.XMLWriter;
 import org.apache.tuscany.sca.diagram.layout.CompositeEntity;
 import org.apache.tuscany.sca.diagram.layout.EntityBuilder;
 import org.w3c.dom.Document;
 
 public class Main {
-    private static String outFileDir; //= System.getProperty("user.dir")+"/output/";
-    private static boolean isHtml = false;
-    private static boolean isSvg = false;
+
+    static Options getCommandLineOptions() {
+        Options options = new Options();
+        Option opt1 = new Option("s", "svg", false, "Generate SVG diagrams");
+        options.addOption(opt1);
+        Option opt2 = new Option("h", "html", false, "Generate HTML documents");
+        options.addOption(opt2);
+
+        Option opt3 = new Option("o", "output", true, "Output directory");
+        options.addOption(opt3);
+
+        return options;
+    }
 
     /**
      * @param args
      * @throws Exception 
      */
     public static void main(String[] args) throws Exception {
+        CommandLineParser parser = new PosixParser();
+        Options options = getCommandLineOptions();
+        CommandLine cli = null;
+        boolean help = false;
+        try {
+            cli = parser.parse(options, args);
+            if (cli.getArgList().size() == 0) {
+                help = true;
+            }
+        } catch (ParseException e) {
+            System.out.println(e);
+            help = true;
+        }
 
-        if (args.length == 0) {
+        // Print out the options and quit
+        if (help) {
+            HelpFormatter formatter = new HelpFormatter();
+            formatter.printHelp("<-h> <-s> <-o outputDirectory> file1 file2
...: ", options);
+            return;
+        }
 
-            String help =
-                "" + "----------Apache Tuscany Composite Diagram Generator----------\n"
-                    + "\n"
-                    + "Error: You have not specified an input \"Composite XML\" file.\n"
-                    + "\n"
-                    + "-----------------------------Help-----------------------------\n"
-                    + "You have 3 options:\n"
-                    + "---1) Default: Specify \"Composite XML\" file paths separated \n"
-                    + "---            by a space, with no arguments. This will"
-                    + "---            generate SVG and HTML output.\n"
-                    + "---     Eg: java -jar tuscany-composite-diagram-0.0.1.jar \n"
-                    + "---         //a//aa//a.composite //b//bb//b.composite \n"
-                    + "---\n"
-                    + "---2) SVG Only: Specify \"Composite XML\" file paths separated\n"
-                    + "---            by a space, with '-svg' argument.\n"
-                    + "---     Eg: java -jar tuscany-composite-diagram-0.0.1.jar -svg\n"
-                    + "---          //a//aa//a.composite //b//bb//b.composite \n"
-                    + "---\n"
-                    + "---3) HTML Only: Specify \"Composite XML\" file paths separated\n"
-                    + "---            by a space, with '-html' argument.\n"
-                    + "---     Eg: java -jar tuscany-composite-diagram-0.0.1.jar -html\n"
-                    + "---          //a//aa//a.composite //b//bb//b.composite \n"
-                    + "---\n";
-            System.out.println(help);
-        } else {
+        boolean isHtml = false;
+        boolean isSvg = false;
+        isSvg = cli.hasOption('s');
+        isHtml = cli.hasOption('h');
+
+        if (!isSvg && !isHtml) {
+            isSvg = true;
+            isHtml = true;
+        }
 
-            if (args[0].equalsIgnoreCase("-svg")) {
-                isSvg = true;
-                args[0] = null;
-            } else if (args[0].equalsIgnoreCase("-html")) {
-                isHtml = true;
-                args[0] = null;
-            } else {
-                isSvg = true;
-                isHtml = true;
-            }
+        String outFileDir;
+
+        if (cli.hasOption('o')) {
+            outFileDir = cli.getOptionValue('o');
+        } else {
+            outFileDir = ".";
+        }
+        File dir = new File(outFileDir);
+        String[] compositeFiles = cli.getArgs();
+        generate(dir, isSvg, isHtml, compositeFiles);
+    }
 
-            for (String str : args) {
+    public static void generate(File dir, boolean isSvg, boolean isHtml, String... compositeFiles)
throws Exception {
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        for (String str : compositeFiles) {
 
-                if (str != null) {
+            if (str != null) {
 
-                    File in = new File(str);
-                    outFileDir = in.getParent() + "//";
-                    XMLReader reader = new XMLReader();
-                    Document doc = reader.parseXMLFile(str);//composite1.xml composite_with_compositeService.xml");
-                    EntityBuilder eb = new EntityBuilder(doc);
-                    CompositeEntity comp = eb.buildCompositeEntity();
+                DocumentBuilder db = dbf.newDocumentBuilder();
+                Document doc = db.parse(str);
 
-                    DiagramGenerator dg = new DiagramGenerator(comp, isHtml);
-                    Document svg = dg.buildSVGDocument();
+                EntityBuilder eb = new EntityBuilder(doc);
+                CompositeEntity comp = eb.buildCompositeEntity();
 
-                    String svgContent = extractSvg(svg);
+                DiagramGenerator dg = new DiagramGenerator(comp, isHtml);
+                Document svg = dg.buildSVGDocument();
 
-                    if (isSvg) {
-                        writeSVG(svgContent, comp);
-                    }
+                String svgContent = extractSvg(svg);
 
-                    if (isHtml) {
-                        writeHTML(svgContent, comp);
-                    }
+                if (isSvg) {
+                    writeSVG(dir, svgContent, comp);
+                }
 
+                if (isHtml) {
+                    writeHTML(dir, svgContent, comp);
                 }
+
             }
         }
     }
 
-    private static void writeHTML(String svg, CompositeEntity comp) throws Exception {
+    private static void writeHTML(File dir, String svg, CompositeEntity comp) throws Exception
{
 
-        File htmlFile = new File(outFileDir + comp.getName() + comp.getFileNameSuffix() +
".html");
+        File htmlFile = new File(dir, comp.getName() + comp.getFileNameSuffix() + ".html");
         HTMLWrapper html = new HTMLWrapper(svg, comp.getName(), htmlFile);
         String content = html.buildHTML();
 
@@ -126,16 +147,14 @@ public class Main {
 
     }
 
-    private static void writeSVG(String svg, CompositeEntity comp) throws Exception {
+    private static File writeSVG(File dir, String svg, CompositeEntity comp) throws Exception
{
 
         String svgFileName = comp.getName() + comp.getFileNameSuffix() + ".svg";
-        File svgFile = new File(outFileDir + svgFileName);
-        XMLWriter writer = new XMLWriter();
-        writer.fileWriter(svg, svgFile);
-
-        System.err.println("--------------SVG Output for " + comp.getName() + "--------------\n");
-        System.out.println(svg);
-        System.err.println("-------------------------------------------------------------\n");
+        File svgFile = new File(dir, svgFileName);
+        FileWriter fw = new FileWriter(svgFile);
+        fw.write(svg);
+        fw.close();
+        return svgFile;
     }
 
     private static String extractSvg(Document svg) throws Exception {

Added: tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java?rev=1166477&view=auto
==============================================================================
--- tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
(added)
+++ tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
Thu Sep  8 00:45:19 2011
@@ -0,0 +1,33 @@
+/**********************************************************************
+ * NAME:
+ *   DiagramGeneratorTestCase
+ *
+ * AUTHOR:
+ *   rfeng
+ *
+ * DESCRIPTION:
+ *   
+ *
+ * Copyright (c) Shutterfly, Inc. 2010. All Rights reserved.
+ **********************************************************************/
+
+package org.apache.tuscany.sca.diagram.layout;
+
+import java.io.File;
+
+import org.apache.tuscany.sca.diagram.main.Main;
+import org.junit.Test;
+
+public class DiagramGeneratorTestCase {
+
+    @Test
+    public final void test() throws Exception {
+        for (File xml : new File("input").listFiles()) {
+            if (xml.getName().endsWith(".xml")) {
+                System.out.println(xml);
+                Main.generate(new File("target"), true, false, xml.toString());
+            }
+        }
+    }
+
+}

Propchange: tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/pom.xml?rev=1166477&r1=1166476&r2=1166477&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/pom.xml (original)
+++ tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/pom.xml Thu Sep  8
00:45:19 2011
@@ -1,21 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- * Licensed to the Apache Software Foundation (ASF) under one * or more 
-	contributor license agreements. See the NOTICE file * distributed with this 
-	work for additional information * regarding copyright ownership. The ASF 
-	licenses this file * to you under the Apache License, Version 2.0 (the * 
-	"License"); you may not use this file except in compliance * with the License. 
-	You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 
-	* * Unless required by applicable law or agreed to in writing, * software 
-	distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT 
-	WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the 
-	License for the * specific language governing permissions and limitations 
-	* under the License. <groupId>org.apache.tuscany.sca</groupId> -->
+<!--
+    * Licensed to the Apache Software Foundation (ASF) under one
+    * or more contributor license agreements.  See the NOTICE file
+    * distributed with this work for additional information
+    * regarding copyright ownership.  The ASF licenses this file
+    * to you under the Apache License, Version 2.0 (the
+    * "License"); you may not use this file except in compliance
+    * with the License.  You may obtain a copy of the License at
+    * 
+    *   http://www.apache.org/licenses/LICENSE-2.0
+    * 
+    * Unless required by applicable law or agreed to in writing,
+    * software distributed under the License is distributed on an
+    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    * KIND, either express or implied.  See the License for the
+    * specific language governing permissions and limitations
+    * under the License.    <groupId>org.apache.tuscany.sca</groupId>
+-->
 <project>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.apache.tuscany.sca</groupId>
-	<artifactId>tuscany-composite-diagram-shell-plugin</artifactId>
-	<version>0.0.1</version>
-	<name>Apache Tuscany SCA Composite Diagram Generator Shell Plugin
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.tuscany.sca</groupId>
+    <artifactId>tuscany-composite-diagram-shell-plugin</artifactId>
+    <version>2.0-SNAPSHOT</version>
+    <name>Apache Tuscany SCA Composite Diagram Generator Shell Plugin
 	</name>
 
     <repositories>
@@ -33,71 +40,71 @@
         </repository>
     </repositories>
 
-	<dependencies>
+    <dependencies>
 
-		<dependency>
-			<groupId>org.apache.tuscany.sca</groupId>
-			<artifactId>tuscany-composite-diagram</artifactId>
-			<version>0.0.1</version>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.xmlgraphics</groupId>
-			<artifactId>batik-swing</artifactId>
-			<version>1.7</version>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.tuscany.sca</groupId>
-			<artifactId>tuscany-base-runtime</artifactId>
-			<version>2.0-Beta3</version>
-		</dependency>
-
-		<dependency>
-			<groupId>jline</groupId>
-			<artifactId>jline</artifactId>
-			<version>0.9.95-huynhjl</version>
-		</dependency>
-
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>4.5</version>
-			<scope>test</scope>
-		</dependency>
-
-	</dependencies>
-
-	<build>
-		<defaultGoal>install</defaultGoal>
-		<directory>${basedir}/target</directory>
-		<finalName>${artifactId}-${version}</finalName>
-		<plugins>
-
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<configuration>
-					<source>1.5</source>
-					<target>1.5</target>
-				</configuration>
-			</plugin>
-
-			<plugin>
-				<groupId>org.apache.tuscany.sca</groupId>
-				<artifactId>tuscany-maven-plugin</artifactId>
-				<version>2.0-Beta3</version>
-		<dependencies>
-		<dependency>
-			<groupId>org.apache.tuscany.sca</groupId>
-			<artifactId>tuscany-composite-diagram-shell-plugin</artifactId>
-			<version>0.0.1</version>
-		</dependency>
-		</dependencies>
-			</plugin>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-composite-diagram</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.xmlgraphics</groupId>
+            <artifactId>batik-swing</artifactId>
+            <version>1.7</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-base-runtime</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>jline</groupId>
+            <artifactId>jline</artifactId>
+            <version>0.9.95-huynhjl</version>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <defaultGoal>install</defaultGoal>
+        <directory>${basedir}/target</directory>
+        <finalName>${artifactId}-${version}</finalName>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.tuscany.sca</groupId>
+                <artifactId>tuscany-maven-plugin</artifactId>
+                <version>2.0-SNAPSHOT</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.tuscany.sca</groupId>
+                        <artifactId>tuscany-composite-diagram-shell-plugin</artifactId>
+                        <version>2.0-SNAPSHOT</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
 
-		</plugins>
+        </plugins>
 
-	</build>
+    </build>
 
 </project>

Modified: tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java?rev=1166477&r1=1166476&r2=1166477&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java
(original)
+++ tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java
Thu Sep  8 00:45:19 2011
@@ -23,9 +23,9 @@ import jline.Completor;
 import jline.NullCompletor;
 
 import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.impl.diagram.DiagramGenerator;
-import org.apache.tuscany.sca.impl.layout.CompositeEntity;
-import org.apache.tuscany.sca.impl.layout.TuscanyCompositeEntityBuilder;
+import org.apache.tuscany.sca.diagram.generator.DiagramGenerator;
+import org.apache.tuscany.sca.diagram.layout.CompositeEntity;
+import org.apache.tuscany.sca.diagram.layout.TuscanyCompositeEntityBuilder;
 import org.apache.tuscany.sca.shell.Command;
 import org.apache.tuscany.sca.shell.Shell;
 import org.apache.tuscany.sca.shell.jline.CompositeURICompletor;
@@ -69,7 +69,7 @@ public class DrawShellCommand implements
         }
         TuscanyCompositeEntityBuilder eb = new TuscanyCompositeEntityBuilder(composite);
         CompositeEntity comp = eb.buildCompositeEntity();
-        DiagramGenerator dg = new DiagramGenerator(comp);
+        DiagramGenerator dg = new DiagramGenerator(comp, false);
         Document svg = dg.buildSVGDocument();
 
         new SVGViewer(svg);



Mime
View raw message