summaryrefslogtreecommitdiffstats
path: root/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-09-01 16:22:37 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-09-01 16:22:37 +0000
commit30cc7a1752f630f7e0a333da0194f627ee8d4b13 (patch)
tree9a6363a078fe388558fc3b0f335f2d852060e310 /collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts
parentab1cab29895c4cf841af608eef7d56bc61a413a8 (diff)
Rename packages to reflect the functions
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1164133 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts')
-rw-r--r--collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Artifact.java120
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ComponentArtifact.java59
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/CompositeArtifact.java57
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Constant.java26
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/DashedWire.java81
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Layer.java60
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Link.java41
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/NormalWire.java45
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/PropertyArtifact.java58
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ReferenceArtifact.java86
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ServiceArtifact.java95
-rw-r--r--collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java38
-rwxr-xr-xcollaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/WireArtifact.java86
13 files changed, 0 insertions, 852 deletions
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Artifact.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Artifact.java
deleted file mode 100644
index 691d9da8d6..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Artifact.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public abstract class Artifact {
-
- private String name;
- private String containerName;
- private int height;
- private int width;
- private int xCoordinate;
- private int yCoordinate;
- private Document doc;
- private String svgNs;
- private static final String ROUND_CORNER = "20";
-
- /**
- * Abstract method
- * @param document DOM document
- * @param svgNs namespace URI
- * @param x x-coordinate
- * @param y y-coordinate
- * @param height height of the shape
- * @param width width of the shape
- * @return DOM Element
- */
- public abstract Element addElement(Document document, String svgNs, int x, int y, int height, int width);
-
- // public abstract Element addElement(Document document, String svgNs,
- // int x, int y);
-
- public int getHeight() {
- return height;
- }
-
- public void setHeight(int height) {
- this.height = height;
- }
-
- public int getWidth() {
- return width;
- }
-
- public void setWidth(int width) {
- this.width = width;
- }
-
- public int getxCoordinate() {
- return xCoordinate;
- }
-
- public void setxCoordinate(int xCoordinate) {
- this.xCoordinate = xCoordinate;
- }
-
- public int getyCoordinate() {
- return yCoordinate;
- }
-
- public void setyCoordinate(int yCoordinate) {
- this.yCoordinate = yCoordinate;
- }
-
- public Document getDoc() {
- return doc;
- }
-
- public void setDoc(Document doc) {
- this.doc = doc;
- }
-
- public String getSvgNs() {
- return svgNs;
- }
-
- public void setSvgNs(String svgNs) {
- this.svgNs = svgNs;
- }
-
- public static String getRoundCorner() {
- return ROUND_CORNER;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setContainerName(String containerName) {
- this.containerName = containerName;
- }
-
- public String getContainerName() {
- return containerName;
- }
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ComponentArtifact.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ComponentArtifact.java
deleted file mode 100755
index e2373cf1f5..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ComponentArtifact.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class ComponentArtifact extends Artifact {
-
- /**
- * Create an element with specified height and width
- */
- public Element addElement(Document document, String svgNs, int x, int y, int height, int width) {
-
- this.setHeight(height);
- this.setWidth(width);
- this.setxCoordinate(x);
- this.setyCoordinate(y);
-
- Element rectangle = document.createElementNS(svgNs, "rect");
- rectangle.setAttributeNS(null, "x", x + "");
- rectangle.setAttributeNS(null, "y", y + "");
- rectangle.setAttributeNS(null, "rx", getRoundCorner());
- rectangle.setAttributeNS(null, "ry", getRoundCorner());
- rectangle.setAttributeNS(null, "width", width + "");
- rectangle.setAttributeNS(null, "height", height + "");
- rectangle.setAttributeNS(null, "fill", "#3D59AB");
- rectangle.setAttributeNS(null, "stroke", "#104E8B");
- rectangle.setAttributeNS(null, "fill-opacity", "0.75");
- return rectangle;
- }
-
- /**
- * Create an element with default height and width
- */
- public Element addElement(Document document, String svgNs, int x, int y) {
-
- return addElement(document, svgNs, x, y, Constant.COMPONENT_DEFAULT_HEIGHT, Constant.COMPONENT_DEFAULT_WIDTH);
-
- }
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/CompositeArtifact.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/CompositeArtifact.java
deleted file mode 100755
index 0496f7c6cc..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/CompositeArtifact.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Structure of a "Composite" element in SCA, as a SVG element
- *
- */
-public class CompositeArtifact extends Artifact {
-
- public Element addElement(Document document, String svgNs, int x, int y, int height, int width) {
-
- this.setHeight(height);
- this.setWidth(width);
- this.setxCoordinate(x);
- this.setyCoordinate(y);
-
- Element rectangle = document.createElementNS(svgNs, "rect");
- rectangle.setAttributeNS(null, "x", x + "");
- rectangle.setAttributeNS(null, "y", y + "");
- rectangle.setAttributeNS(null, "rx", getRoundCorner());
- rectangle.setAttributeNS(null, "ry", getRoundCorner());
- rectangle.setAttributeNS(null, "width", width + "");
- rectangle.setAttributeNS(null, "height", height + "");
- rectangle.setAttributeNS(null, "fill", "#E5E5E5");
- rectangle.setAttributeNS(null, "stroke", "#919191");
- rectangle.setAttributeNS(null, "alignment-baseline", "middle");
-
- return rectangle;
- }
-
- // //OBSOLETE
- // public Element addElement(Document document, String svgNs, int x, int y) {
- // return null;
- // }
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Constant.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Constant.java
deleted file mode 100755
index a2b2a93647..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Constant.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.apache.tuscany.sca.impl.artifacts;
-
-public final class Constant {
-
- public static final int COMPONENT_DEFAULT_WIDTH = 200;
- public static final int COMPONENT_DEFAULT_HEIGHT = 130;
- public static final int COMPONENT_TEXT_SPACING = 20;
-
- public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPONENT_OF_PROPERTY = 20;
- public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPOSITE_OF_PROPERTY = 60;
- public static final int SPACING_FOR_COMPONENT_OF_PROPERTY = 20;
- public static final int SPACING_FOR_COMPOSITE_OF_PROPERTY = 60;
-
- public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPONENT_OF_REFERENCE = 30;
- public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPOSITE_OF_REFERENCE = 90;
- public static final int SPACING_FOR_COMPONENT_OF_REFERENCE = 10;
- public static final int SPACING_FOR_COMPOSITE_OF_REFERENCE = 50;
-
- public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPONENT_OF_SERVICE = 30;
- public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPOSITE_OF_SERVICE = 90;
- public static final int SPACING_FOR_COMPONENT_OF_SERVICE = 10;
- public static final int SPACING_FOR_COMPOSITE_OF_SERVICE = 50;
-
- public static final int SPACING_FOR_TEXT = 1;
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/DashedWire.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/DashedWire.java
deleted file mode 100755
index 0169cf9936..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/DashedWire.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class DashedWire extends WireArtifact {
-
- @Override
- public Element addElement(Document document, String svgNs, Object a, Object b, int changingFactor, String color) {
-
- Element polyline = document.createElementNS(svgNs, "polyline");
- int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
-
- if (a instanceof ServiceArtifact && b instanceof ServiceArtifact) {
-
- ServiceArtifact aService1 = (ServiceArtifact)a;
- ServiceArtifact aService2 = (ServiceArtifact)b;
-
- x1 = aService1.getxCoordinate() + aService1.getHeight() * 3 / 2;
- y1 = aService1.getyCoordinate() + aService1.getHeight() / 2;
-
- x2 = aService2.getxCoordinate() + aService2.getHeight() / 2;
- y2 = aService2.getyCoordinate() + aService2.getHeight() / 2;
-
- }
-
- else if (a instanceof ReferenceArtifact && b instanceof ReferenceArtifact) {
-
- ReferenceArtifact aReference1 = (ReferenceArtifact)a;
- ReferenceArtifact aReference2 = (ReferenceArtifact)b;
-
- x1 = aReference1.getxCoordinate() + aReference1.getHeight() * 3 / 2;
- y1 = aReference1.getyCoordinate() + aReference1.getHeight() / 2;
-
- x2 = aReference2.getxCoordinate() + aReference2.getHeight() / 2;
- y2 = aReference2.getyCoordinate() + aReference2.getHeight() / 2;
-
- }
-
- polyline = setWireAttributes(x1, y1, x2, y2, polyline, changingFactor, color);
-
- polyline.setAttributeNS(null, "stroke-dasharray", "3 3");
-
- return polyline;
- }
-
- /**
- * <script type="text/ecmascript"><![CDATA[
- <SCRIPT LANGUAGE="JavaScript">
-
- var test = document.open("store_diagram.svg");
-
- </SCRIPT>
- ]]></script>
-
- <!--rect x="0" y="0" alignment-baseline="central" fill="#E5E5D0" width="1400" rx="20" ry="20" height="560" stroke="#919191"/><rect x="200" y="100" alignment-baseline="central" fill="#E5E5E5" width="1000" rx="20" ry="20" height="360" stroke="#919191"/><text x="700" font-size="20" dominant-baseline="mathematical" y="120" text-anchor="middle">
-
- <a xlink:href="store_diagram.svg" xlink:show="new">MyValueComposite2</a></text-->
-
- */
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Layer.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Layer.java
deleted file mode 100755
index c3a41140f8..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Layer.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Structure of a "Outermost layer" : not a SCA artifact
- *
- */
-public class Layer extends Artifact {
-
- public Element addElement(Document document, String svgNs, int x, int y, int height, int width) {
-
- this.setHeight(height);
- this.setWidth(width);
- this.setxCoordinate(x);
- this.setyCoordinate(y);
-
- Element rectangle = document.createElementNS(svgNs, "rect");
- rectangle.setAttributeNS(null, "x", x + "");
- rectangle.setAttributeNS(null, "y", y + "");
- rectangle.setAttributeNS(null, "rx", getRoundCorner());
- rectangle.setAttributeNS(null, "ry", getRoundCorner());
- rectangle.setAttributeNS(null, "width", width + "");
- rectangle.setAttributeNS(null, "height", height + "");
- rectangle.setAttributeNS(null, "fill", "#E5E5D0");
- rectangle.setAttributeNS(null, "stroke", "#919191");
- rectangle.setAttributeNS(null, "alignment-baseline", "middle");
-
- return rectangle;
- }
-
- public Element addElement(Document document, String svgNs, int x, int y, int height, int width, String fillColor) {
-
- Element rect = addElement(document, svgNs, x, y, height, width);
- rect.setAttributeNS(null, "fill", fillColor);
-
- return rect;
- }
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Link.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Link.java
deleted file mode 100755
index 533c718595..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Link.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * An "a" element to link two SVG diagrams: not a SCA artifact
- *
- */
-public class Link {
-
- public Element addElement(Document document, String svgNs, String fileName, String compName) {
-
- Element link = document.createElementNS(svgNs, "a");
- link.setAttributeNS(null, "xlink:href", fileName);
- link.setAttributeNS(null, "xlink:show", "new");
- link.setTextContent(" " + compName + " ,");
-
- return link;
- }
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/NormalWire.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/NormalWire.java
deleted file mode 100755
index 69d7bb4a60..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/NormalWire.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class NormalWire extends WireArtifact {
-
- @Override
- public Element addElement(Document document, String svgNs, Object a, Object b, int changingFactor, String color) {
-
- ReferenceArtifact aReference = (ReferenceArtifact)a;
- ServiceArtifact aService = (ServiceArtifact)b;
-
- Element polyline = document.createElementNS(svgNs, "polyline");
- int x1 = aReference.getxCoordinate() + aReference.getHeight() * 3 / 2;
- int y1 = aReference.getyCoordinate() + aReference.getHeight() / 2;
-
- int x2 = aService.getxCoordinate() + aService.getHeight() / 2;
- int y2 = aService.getyCoordinate() + aService.getHeight() / 2;
-
- polyline = setWireAttributes(x1, y1, x2, y2, polyline, changingFactor, color);
-
- return polyline;
- }
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/PropertyArtifact.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/PropertyArtifact.java
deleted file mode 100755
index d9bad6e017..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/PropertyArtifact.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class PropertyArtifact extends Artifact {
-
- /**
- * Property is a square.
- * ___
- * | |
- * |___|
- *
- */
- public Element addElement(Document document, String svgNs, int x, int y, int height, int width) {
-
- this.setHeight(height);
- this.setWidth(width);
- this.setxCoordinate(x);
- this.setyCoordinate(y);
-
- Element rectangle = document.createElementNS(svgNs, "rect");
- rectangle.setAttributeNS(null, "x", x + "");
- rectangle.setAttributeNS(null, "y", y + "");
- rectangle.setAttributeNS(null, "width", height + "");
- rectangle.setAttributeNS(null, "height", height + "");
- rectangle.setAttributeNS(null, "fill", "#EEEE00");
- rectangle.setAttributeNS(null, "stroke", "#EEC900");
- //rectangle.setAttributeNS(null, "fill-opacity", "0.75");
-
- return rectangle;
- }
-
- public Element addElement(Document document, String svgNs, int x, int y, int height) {
-
- return addElement(document, svgNs, x, y, height, height);
- }
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ReferenceArtifact.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ReferenceArtifact.java
deleted file mode 100755
index 27a5a426ee..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ReferenceArtifact.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class ReferenceArtifact extends Artifact {
-
- /**
- * In a Reference the (x,y) coordinates refers to the top corner edge of the polygon
- * (x,y)______
- * \ \
- * \ \
- * / /
- * /____ /
- */
- public Element addElement(Document document, String svgNs, int x, int y, int height, int width) {
-
- this.setHeight(height);
- this.setWidth(width);
- this.setxCoordinate(x);
- this.setyCoordinate(y);
-
- int halfOfHeight = height / 2;
-
- Element polygon = document.createElementNS(svgNs, "polygon");
- polygon.setAttributeNS(null, "points", "" + x
- + ","
- + y
- + " "
- + ""
- + (x + 2 * halfOfHeight)
- + ","
- + (y)
- + " "
- + ""
- + (x + 3 * halfOfHeight)
- + ","
- + (y + halfOfHeight)
- + " "
- + ""
- + (x + 2 * halfOfHeight)
- + ","
- + (y + 2 * halfOfHeight)
- + " "
- + ""
- + (x)
- + ","
- + (y + 2 * halfOfHeight)
- + " "
- + ""
- + (x + halfOfHeight)
- + ","
- + (y + halfOfHeight)
- + " ");
-
- polygon.setAttributeNS(null, "fill", "#BF3EFF");
- polygon.setAttributeNS(null, "stroke", "#68228B");
-
- return polygon;
- }
-
- public Element addElement(Document document, String svgNs, int x, int y, int height) {
-
- return this.addElement(document, svgNs, x, y, height, height * 3 / 2);
- }
-
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ServiceArtifact.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ServiceArtifact.java
deleted file mode 100755
index f92b5cab08..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/ServiceArtifact.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class ServiceArtifact extends Artifact {
-
- /**
- * In a Service the (x,y) coordinates refers to the top corner edge of the polygon
- * (x,y)______
- * \ \
- * \ \
- * / /
- * /____ /
- */
- public Element addElement(Document document, String svgNs, int x, int y, int height, int width) {
-
- this.setHeight(height);
- this.setWidth(width);
- this.setxCoordinate(x);
- this.setyCoordinate(y);
-
- int halfOfHeight = height / 2;
-
- Element polygon = document.createElementNS(svgNs, "polygon");
- polygon.setAttributeNS(null, "points", "" + x
- + ","
- + y
- + " "
- + ""
- + (x + 2 * halfOfHeight)
- + ","
- + (y)
- + " "
- + ""
- + (x + 3 * halfOfHeight)
- + ","
- + (y + halfOfHeight)
- + " "
- + ""
- + (x + 2 * halfOfHeight)
- + ","
- + (y + 2 * halfOfHeight)
- + " "
- + ""
- + (x)
- + ","
- + (y + 2 * halfOfHeight)
- + " "
- + ""
- + (x + halfOfHeight)
- + ","
- + (y + halfOfHeight)
- + " ");
-
- polygon.setAttributeNS(null, "fill", "#00CD66");
- polygon.setAttributeNS(null, "stroke", "#008B45");
-
- return polygon;
- }
-
- /**
- * Width is 3/2 times of the height
- * @param document
- * @param svgNs
- * @param x
- * @param y
- * @param height
- * @return
- */
- public Element addElement(Document document, String svgNs, int x, int y, int height) {
-
- return this.addElement(document, svgNs, x, y, height, height * 3 / 2);
- }
-
-}
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
deleted file mode 100644
index 976ccb547f..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Text.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.
- */
-
-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", "15");
- text.setTextContent(content);
-
- return text;
- }
-}
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/WireArtifact.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/WireArtifact.java
deleted file mode 100755
index 4703abb80d..0000000000
--- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/WireArtifact.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.impl.artifacts;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public abstract class WireArtifact {
-
- public abstract Element addElement(Document document,
- String svgNs,
- Object a,
- Object b,
- int changingFactor,
- String color);
-
- public Element setWireAttributes(int x1, int y1, int x2, int y2, Element polyline, int changingFactor, String color) {
-
- if (y1 == y2 && x2 > x1) {
- polyline.setAttributeNS(null, "points", x1 + "," + y1 + " " + x2 + "," + y2);
- } else if (y1 == y2 && x1 > x2) {
- polyline.setAttributeNS(null, "points", x1 + ","
- + y1
- + " "
- + (x1 + changingFactor)
- + ","
- + y1
- + " "
- + (x1 + changingFactor)
- + ","
- + (y1 - (changingFactor * 2))
- + " "
- + (x2 - changingFactor)
- + ","
- + (y1 - (changingFactor * 2))
- + " "
- + (x2 - changingFactor)
- + ","
- + (y1)
- + " "
- + (x2)
- + ","
- + (y1));
-
- } else {
- polyline.setAttributeNS(null, "points", x1 + ","
- + y1
- + " "
- + (x1 + changingFactor)
- + ","
- + y1
- + " "
- + (x1 + changingFactor)
- + ","
- + y2
- + " "
- + x2
- + ","
- + y2);
- }
-
- polyline.setAttributeNS(null, "stroke", color);
- polyline.setAttributeNS(null, "stroke-width", "2");
- polyline.setAttributeNS(null, "fill", "none");
-
- return polyline;
- }
-
-}