diff options
6 files changed, 0 insertions, 415 deletions
diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Component.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Component.java deleted file mode 100644 index 6b69c488f1..0000000000 --- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Component.java +++ /dev/null @@ -1,65 +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 Component extends Artifact{ - - public static final int DEFAULT_WIDTH = 200 ; - public static final int DEFAULT_HEIGHT = 130 ; - public static final int TEXT_SPACING = 20 ; - - - /** - * 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, DEFAULT_HEIGHT, DEFAULT_WIDTH); - - } - -} diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Composite.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Composite.java deleted file mode 100644 index e42baa68ee..0000000000 --- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Composite.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; - -/** - * Structure of a "Composite" element in SCA, as a SVG element - * - */ -public class Composite 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", "central"); - - 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/Property.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Property.java deleted file mode 100644 index 0b437ecb1c..0000000000 --- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Property.java +++ /dev/null @@ -1,68 +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 Property extends Artifact{ - - public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPONENT = 20 ; - public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPOSITE = 60 ; - public static final int SPACING_FOR_COMPONENT = 20 ; - public static final int SPACING_FOR_COMPOSITE = 60 ; - - - /** - * 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/Reference.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Reference.java deleted file mode 100644 index 6538dd0caa..0000000000 --- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Reference.java +++ /dev/null @@ -1,76 +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 Reference extends Artifact { - - public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPONENT = 30 ; - public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPOSITE = 90 ; - public static final int SPACING_FOR_COMPONENT = 10 ; - public static final int SPACING_FOR_COMPOSITE = 30 ; - - - - /** - * 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/Service.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Service.java deleted file mode 100644 index 0faf5fd789..0000000000 --- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Service.java +++ /dev/null @@ -1,83 +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 Service extends Artifact{ - - public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPONENT = 30 ; - public static final int DEFAULT_MAXIMUM_HEIGHT_FOR_COMPOSITE = 90 ; - public static final int SPACING_FOR_COMPONENT = 10 ; - public static final int SPACING_FOR_COMPOSITE = 30 ; - - - /** - * 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/Wire.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Wire.java deleted file mode 100644 index e173365f4a..0000000000 --- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/artifacts/Wire.java +++ /dev/null @@ -1,64 +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 Wire { - - 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; - } - - -} |