mirror of https://github.com/dspinellis/UMLGraph
progress on implementing rendering a la UmlGraph
added missing copyright notices
This commit is contained in:
parent
f1f4b334e5
commit
ebad078264
|
|
@ -2,9 +2,15 @@
|
|||
<uml:Package xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_Qs0f4MJKEdyYwNdUIscG9w" name="payment">
|
||||
<packagedElement xmi:type="uml:Class" xmi:id="_VMrWYMJKEdyYwNdUIscG9w" name="PaymentMethod"/>
|
||||
<packagedElement xmi:type="uml:Class" xmi:id="_YjVwMMJKEdyYwNdUIscG9w" name="Cheque">
|
||||
<generalization xmi:id="_rb_4QMJKEdyYwNdUIscG9w"/>
|
||||
<generalization xmi:id="_rb_4QMJKEdyYwNdUIscG9w" general="_VMrWYMJKEdyYwNdUIscG9w"/>
|
||||
</packagedElement>
|
||||
<packagedElement xmi:type="uml:Class" xmi:id="_bvgxQMJKEdyYwNdUIscG9w" name="CreditCard">
|
||||
<generalization xmi:id="_usexkMJKEdyYwNdUIscG9w" general="_VMrWYMJKEdyYwNdUIscG9w"/>
|
||||
</packagedElement>
|
||||
<packagedElement xmi:type="uml:Interface" xmi:id="_YjPrkMmHEdyQbq_kJZDGSw" name="Auditable"/>
|
||||
<packagedElement xmi:type="uml:Class" xmi:id="_mz3RgMmHEdyQbq_kJZDGSw" name="Account" clientDependency="_sIt2UMmHEdyQbq_kJZDGSw">
|
||||
<interfaceRealization xmi:id="_sIt2UMmHEdyQbq_kJZDGSw" name="" supplier="_YjPrkMmHEdyQbq_kJZDGSw" client="_mz3RgMmHEdyQbq_kJZDGSw" contract="_YjPrkMmHEdyQbq_kJZDGSw"/>
|
||||
</packagedElement>
|
||||
<packagedElement xmi:type="uml:Dependency" xmi:id="_NCWT4MmKEdyQbq_kJZDGSw" supplier="_VMrWYMJKEdyYwNdUIscG9w" client="_TGBtkMmKEdyQbq_kJZDGSw"/>
|
||||
<packagedElement xmi:type="uml:Class" xmi:id="_TGBtkMmKEdyQbq_kJZDGSw" name="ShoppingCart" clientDependency="_NCWT4MmKEdyQbq_kJZDGSw"/>
|
||||
</uml:Package>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<? extends ElementRenderer<?>> findRenderer(EClass elementClass) {
|
||||
if (!ELEMENT_CLASS.isSuperTypeOf(elementClass))
|
||||
return null;
|
||||
String className = elementClass.getName();
|
||||
String rendererClassName = getClass().getPackage().getName() + '.' + className + "Renderer";
|
||||
try {
|
||||
return (Class<? extends ElementRenderer<?>>) Class.forName(rendererClassName);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// try parent
|
||||
EList<EClass> superTypes = elementClass.getESuperTypes();
|
||||
for (EClass superType : superTypes) {
|
||||
Class<? extends ElementRenderer<?>> renderer = findRenderer(superType);
|
||||
if (renderer != null && !Modifier.isAbstract(renderer.getModifiers()))
|
||||
return renderer;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private Class<? extends ElementRenderer<?>> 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<? extends ElementRenderer<?>>) Class
|
||||
.forName(rendererClassName);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// try parent
|
||||
EList<EClass> superTypes = elementClass.getESuperTypes();
|
||||
for (EClass superType : superTypes) {
|
||||
Class<? extends ElementRenderer<?>> 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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<ClassDiagram,
|
|||
}
|
||||
|
||||
private void printPrologue(String modelName, IndentedPrintWriter w) {
|
||||
w.println("graph " + modelName + " {"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
w.println("digraph " + modelName + " {"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
w.enterLevel();
|
||||
DOTRenderingUtils.addAttribute(w, "ranksep", "0.5");
|
||||
DOTRenderingUtils.addAttribute(w, "nodesep", "0.85");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* (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.Dependency;
|
||||
import org.umlgraph.engine.classdiagram.ElementRenderer;
|
||||
import org.umlgraph.engine.classdiagram.RenderingSession;
|
||||
|
||||
public class DependencyRenderer implements ElementRenderer<Dependency> {
|
||||
|
||||
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]");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<Generalization> {
|
|||
* 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]");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<InterfaceRealization> {
|
||||
public class InterfaceRealizationRenderer implements
|
||||
ElementRenderer<InterfaceRealization> {
|
||||
|
||||
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];");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue