diff --git a/umlgraph_ng/org.umlgraph.engine.tests/test-resources/test-models/payment.uml b/umlgraph_ng/org.umlgraph.engine.tests/test-resources/test-models/payment.uml index 223110a..f3b0da1 100644 --- a/umlgraph_ng/org.umlgraph.engine.tests/test-resources/test-models/payment.uml +++ b/umlgraph_ng/org.umlgraph.engine.tests/test-resources/test-models/payment.uml @@ -2,9 +2,15 @@ - + + + + + + + diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/AbstractDiagramRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/AbstractDiagramRenderer.java index 7fc076e..b5ee4b9 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/AbstractDiagramRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/AbstractDiagramRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine; import org.eclipse.emf.ecore.resource.ResourceSet; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Activator.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Activator.java index c86b5cc..22c12b5 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Activator.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Activator.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine; import org.osgi.framework.BundleActivator; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/DOTRenderingUtils.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/DOTRenderingUtils.java index ed4fb3f..c5a3374 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/DOTRenderingUtils.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/DOTRenderingUtils.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine; import java.io.PrintWriter; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Diagram.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Diagram.java index ddd8008..2d7ec59 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Diagram.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Diagram.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine; import org.umlgraph.engine.matching.AnyMatcher; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/DiagramRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/DiagramRenderer.java index 6788ca8..fdc86f9 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/DiagramRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/DiagramRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine; import org.eclipse.emf.ecore.resource.ResourceSet; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/RelationType.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/RelationType.java index 09808c8..f72faf4 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/RelationType.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/RelationType.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2002-2008 Diomidis Spinellis + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine; /** diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Util.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Util.java index cc66b08..03085a1 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Util.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/Util.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine; import java.net.MalformedURLException; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ClassDiagram.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ClassDiagram.java index 071381a..491f25c 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ClassDiagram.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ClassDiagram.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram; import org.umlgraph.engine.Diagram; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ElementRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ElementRenderer.java index 0a98894..7a1bdc0 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ElementRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ElementRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram; import org.eclipse.uml2.uml.Element; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ElementRendererSelector.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ElementRendererSelector.java index 5277563..cd6d895 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ElementRendererSelector.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/ElementRendererSelector.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram; import java.lang.reflect.Modifier; @@ -6,41 +22,46 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.uml2.uml.Element; import org.eclipse.uml2.uml.UMLPackage; +import org.umlgraph.engine.classdiagram.dot.ClassDiagramRenderer; class ElementRendererSelector { - private static final EClass ELEMENT_CLASS = UMLPackage.eINSTANCE.getElement(); + private static final EClass ELEMENT_CLASS = UMLPackage.eINSTANCE + .getElement(); - private Class> findRenderer(EClass elementClass) { - if (!ELEMENT_CLASS.isSuperTypeOf(elementClass)) - return null; - String className = elementClass.getName(); - String rendererClassName = getClass().getPackage().getName() + '.' + className + "Renderer"; - try { - return (Class>) Class.forName(rendererClassName); - } catch (ClassNotFoundException e) { - // try parent - EList superTypes = elementClass.getESuperTypes(); - for (EClass superType : superTypes) { - Class> renderer = findRenderer(superType); - if (renderer != null && !Modifier.isAbstract(renderer.getModifiers())) - return renderer; - } - return null; - } - } + private Class> findRenderer(EClass elementClass) { + if (!ELEMENT_CLASS.isSuperTypeOf(elementClass)) + return null; + String className = elementClass.getName(); + String rendererClassName = ClassDiagramRenderer.class.getPackage().getName() + '.' + + className + "Renderer"; + try { + return (Class>) Class + .forName(rendererClassName); + } catch (ClassNotFoundException e) { + // try parent + EList superTypes = elementClass.getESuperTypes(); + for (EClass superType : superTypes) { + Class> renderer = findRenderer(superType); + if (renderer != null + && !Modifier.isAbstract(renderer.getModifiers())) + return renderer; + } + return null; + } + } - public ElementRenderer select(Element element) { - Class rendererClass = findRenderer(element.eClass()); - if (rendererClass == null) - return null; - try { - return (ElementRenderer) rendererClass.newInstance(); - } catch (InstantiationException e) { - UMLRenderingUtils.logUnexpected(rendererClass.getName(), e); - } catch (IllegalAccessException e) { - UMLRenderingUtils.logUnexpected(rendererClass.getName(), e); - } - return null; - } + public ElementRenderer select(Element element) { + Class rendererClass = findRenderer(element.eClass()); + if (rendererClass == null) + return null; + try { + return (ElementRenderer) rendererClass.newInstance(); + } catch (InstantiationException e) { + UMLRenderingUtils.logUnexpected(rendererClass.getName(), e); + } catch (IllegalAccessException e) { + UMLRenderingUtils.logUnexpected(rendererClass.getName(), e); + } + return null; + } } diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/RenderingSession.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/RenderingSession.java index 639404c..8f57a5c 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/RenderingSession.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/RenderingSession.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram; import java.util.Collection; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/UMLRenderingUtils.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/UMLRenderingUtils.java index 63e338e..6b51769 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/UMLRenderingUtils.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/UMLRenderingUtils.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram; import org.eclipse.uml2.uml.MultiplicityElement; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/AssociationRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/AssociationRenderer.java index 4742b98..585e626 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/AssociationRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/AssociationRenderer.java @@ -1,5 +1,18 @@ -/** - * Copyright (c) Abstratt Technologies 2007. All rights reserved. +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * */ package org.umlgraph.engine.classdiagram.dot; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ClassDiagramRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ClassDiagramRenderer.java index ea16143..d2a9624 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ClassDiagramRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ClassDiagramRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import java.io.OutputStream; @@ -38,7 +54,7 @@ public class ClassDiagramRenderer extends AbstractDiagramRenderer { + + public void renderObject(Dependency element, RenderingSession context) { + //TODO ClassInfo + //TODO we do no support multiple clients/suppliers at this point + if (element.getSuppliers().get(0).getNearestPackage() != element.getClients().get(0).getNearestPackage()) + return; + IndentedPrintWriter pw = context.getOutput(); + pw.println("//" + element.getClients().get(0).getName() + " depends upon " + element.getSuppliers().get(0).getName()); + pw.println(element.getSuppliers().get(0).getName() + " -> " + element.getClients().get(0).getName() + "[arrowhead=open, style=dashed]"); + } + +} diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/EnumerationLiteralRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/EnumerationLiteralRenderer.java index ecbab45..829befa 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/EnumerationLiteralRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/EnumerationLiteralRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import org.eclipse.uml2.uml.EnumerationLiteral; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/EnumerationRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/EnumerationRenderer.java index 3dda6af..3b9ead2 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/EnumerationRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/EnumerationRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import java.util.List; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ExtensionRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ExtensionRenderer.java index 3ddf836..4b1776a 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ExtensionRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ExtensionRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import org.eclipse.uml2.uml.Extension; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/GeneralizationRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/GeneralizationRenderer.java index 6f93c5e..9ff9b4f 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/GeneralizationRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/GeneralizationRenderer.java @@ -1,6 +1,20 @@ -/** - * Copyright (c) Abstratt Technologies 2007. All rights reserved. +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * */ + package org.umlgraph.engine.classdiagram.dot; import org.eclipse.uml2.uml.Generalization; @@ -21,23 +35,12 @@ public class GeneralizationRenderer implements ElementRenderer { * com.abstratt.modelviewer.render.IRenderingSession) */ public void renderObject(Generalization element, RenderingSession context) { + //TODO ClassInfo if (element.getGeneral().getNearestPackage() != element.getSpecific().getNearestPackage()) return; - IndentedPrintWriter pw = context.getOutput(); - pw.print("edge "); - // if (element.getName() != null) - // pw.print("\"" + element.getName() + "\" "); - pw.println("["); - pw.enterLevel(); - pw.println("arrowtail = \"empty\""); - pw.println("arrowhead = \"none\""); - pw.println("taillabel = \"\""); - pw.println("headlabel = \"\""); - DOTRenderingUtils.addAttribute(pw, "constraint", "true"); - pw.println("style = \"none\""); - pw.exitLevel(); - pw.println("]"); - pw.println(element.getGeneral().getName() + " -- " + element.getSpecific().getName()); + IndentedPrintWriter pw = context.getOutput(); + pw.println("//" + element.getSpecific().getName() + " extends " + element.getGeneral().getName()); + pw.println(element.getGeneral().getName() + " -> " + element.getSpecific().getName() + "[dir=back,arrowtail=empty]"); } } diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/IndentedPrintWriter.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/IndentedPrintWriter.java index c7abd4c..4e25ba3 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/IndentedPrintWriter.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/IndentedPrintWriter.java @@ -1,13 +1,19 @@ -/******************************************************************************* - * Copyright (c) 2007 Abstratt Technologies and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html +/* + * (C) Copyright 2007-2008 Abstratt Technologies * - * Contributors: - * Abstratt Technologies - initial API and implementation - *******************************************************************************/ + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import java.io.OutputStream; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/InterfaceRealizationRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/InterfaceRealizationRenderer.java index 581285b..c274567 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/InterfaceRealizationRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/InterfaceRealizationRenderer.java @@ -1,26 +1,40 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import org.eclipse.uml2.uml.InterfaceRealization; -import org.umlgraph.engine.DOTRenderingUtils; import org.umlgraph.engine.classdiagram.ElementRenderer; import org.umlgraph.engine.classdiagram.RenderingSession; -public class InterfaceRealizationRenderer implements ElementRenderer { +public class InterfaceRealizationRenderer implements + ElementRenderer { - public void renderObject(InterfaceRealization element, RenderingSession context) { - if (element.getImplementingClassifier().getNearestPackage() != element.getContract().getNearestPackage()) - return; - IndentedPrintWriter pw = context.getOutput(); - pw.print("edge "); - pw.println("["); - pw.enterLevel(); - DOTRenderingUtils.addAttribute(pw, "arrowtail", "empty"); - DOTRenderingUtils.addAttribute(pw, "arrowhead", "none"); - DOTRenderingUtils.addAttribute(pw, "taillabel", ""); - DOTRenderingUtils.addAttribute(pw, "headlabel", ""); - DOTRenderingUtils.addAttribute(pw, "syle", "dashed"); - pw.exitLevel(); - pw.println("]"); - pw.println(element.getContract().getName() + " -> " + element.getImplementingClassifier().getName()); - } + public void renderObject(InterfaceRealization element, + RenderingSession context) { + //TODO ClassInfo + if (element.getImplementingClassifier().getNearestPackage() != element + .getContract().getNearestPackage()) + return; + IndentedPrintWriter pw = context.getOutput(); + pw.println("//" + element.getImplementingClassifier().getName() + " extends " + + element.getContract().getName()); + pw.println(element.getContract().getName() + " -> " + + element.getImplementingClassifier().getName() + + "[dir=back,arrowtail=empty,style=dashed];"); + + } } diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/InterfaceRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/InterfaceRenderer.java index 85a28b3..94e591c 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/InterfaceRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/InterfaceRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import java.util.List; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/OperationRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/OperationRenderer.java index c772997..47e8a7e 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/OperationRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/OperationRenderer.java @@ -1,5 +1,18 @@ -/** - * Copyright (c) Abstratt Technologies 2007. All rights reserved. +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * */ package org.umlgraph.engine.classdiagram.dot; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/PackageRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/PackageRenderer.java index 0501fd5..7f488d8 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/PackageRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/PackageRenderer.java @@ -1,6 +1,20 @@ -/** - * Copyright (c) Abstratt Technologies 2007. All rights reserved. +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * */ + package org.umlgraph.engine.classdiagram.dot; import org.eclipse.uml2.uml.Package; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ParameterRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ParameterRenderer.java index 3b577c7..c5c167e 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ParameterRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/ParameterRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import org.eclipse.uml2.uml.Parameter; diff --git a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/PropertyRenderer.java b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/PropertyRenderer.java index 95a415c..b9bbb8a 100644 --- a/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/PropertyRenderer.java +++ b/umlgraph_ng/org.umlgraph.engine/src/org/umlgraph/engine/classdiagram/dot/PropertyRenderer.java @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2007-2008 Abstratt Technologies + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * $Id$ + * + */ package org.umlgraph.engine.classdiagram.dot; import org.eclipse.uml2.uml.Property;