// Generated by Haxe 4.3.1
package schema;

import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public class UMLToSVG extends haxe.lang.HxObject
{
	static
	{
		//line 6 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		{
			//line 6 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			java.lang.Object __temp_odecl2 = null;
			//line 6 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			{
				//line 6 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				java.lang.Object __temp_odecl1 = new haxe.lang.DynamicObject(new java.lang.String[]{"SuppressWarnings"}, new java.lang.Object[]{new haxe.root.Array(new java.lang.Object[]{"checkstyle:ParameterNumber"})}, new java.lang.String[]{}, new double[]{});
				//line 6 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				__temp_odecl2 = new haxe.lang.DynamicObject(new java.lang.String[]{"drawLinks"}, new java.lang.Object[]{__temp_odecl1}, new java.lang.String[]{}, new double[]{});
			}
			
			//line 6 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			schema.UMLToSVG.__meta__ = new haxe.lang.DynamicObject(new java.lang.String[]{"statics"}, new java.lang.Object[]{__temp_odecl2}, new java.lang.String[]{}, new double[]{});
		}
		
	}
	
	public UMLToSVG(haxe.lang.EmptyObject empty)
	{
	}
	
	
	public UMLToSVG()
	{
		//line 6 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		schema.UMLToSVG.__hx_ctor_schema_UMLToSVG(this);
	}
	
	
	protected static void __hx_ctor_schema_UMLToSVG(schema.UMLToSVG __hx_this)
	{
	}
	
	
	public static java.lang.Object __meta__;
	
	public static haxe.root.Xml generateSVG(model.Diagram diagram, boolean classDiagram, boolean showPrivate)
	{
		//line 13 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml doc = haxe.root.Xml.createDocument();
		//line 14 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml svg = schema.Svg.initSvg(doc);
		//line 16 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		{
			//line 16 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			java.lang.Object set = diagram.iterator();
			//line 16 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(set, "hasNext", null)) )))
			{
				//line 16 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				model.Set set1 = ((model.Set) (haxe.lang.Runtime.callField(set, "next", null)) );
				//line 17 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (haxe.root.Std.isOfType(set1, model.Association.class)) 
				{
					//line 18 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					model.Association assoc = ((model.Association) (set1) );
					//line 19 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					if (assoc.isClass()) 
					{
						//line 20 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						set1.svg = schema.UMLToSVG.generateAssociationSVG(diagram, assoc, classDiagram, showPrivate);
						//line 21 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						svg.addChild(set1.svg);
					}
					else
					{
						//line 23 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						set1.svg = haxe.root.Xml.createElement("g");
						//line 24 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						set1.svg.addChild(haxe.root.Xml.createElement("g"));
						//line 25 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						haxe.root.Xml _this = set1.svg;
						//line 25 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						if (( ( _this.nodeType != haxe.root.Xml.Document ) && ( _this.nodeType != haxe.root.Xml.Element ) )) 
						{
							//line 25 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( "Bad node type, expected Element or Document but found " + _Xml.XmlType_Impl_.toString(_this.nodeType) ))) );
						}
						
						//line 25 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						_this.children.__get(0).set("height", "0");
						//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						haxe.root.Xml _this1 = set1.svg;
						//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						if (( ( _this1.nodeType != haxe.root.Xml.Document ) && ( _this1.nodeType != haxe.root.Xml.Element ) )) 
						{
							//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( "Bad node type, expected Element or Document but found " + _Xml.XmlType_Impl_.toString(_this1.nodeType) ))) );
						}
						
						//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						_this1.children.__get(0).set("width", "0");
					}
					
				}
				else
				{
					//line 29 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					set1.svg = schema.UMLToSVG.generateSetSVG(set1, classDiagram, showPrivate);
					//line 30 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					svg.addChild(set1.svg);
				}
				
			}
			
		}
		
		//line 34 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		schema.Svg.placeObjects(diagram, svg, diagram.height, diagram.width, ( (classDiagram) ? (((double) (2) )) : (((double) (4) )) ));
		//line 35 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		schema.UMLToSVG.drawInheritance(diagram, svg);
		//line 37 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		schema.UMLToSVG.placeClassAssociations(diagram, svg);
		//line 38 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		{
			//line 38 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			java.lang.Object assoc1 = new haxe.ds._StringMap.StringMapValueIterator<model.Association>(((haxe.ds.StringMap<model.Association>) (diagram.associations) ));
			//line 38 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(assoc1, "hasNext", null)) )))
			{
				//line 38 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				model.Association assoc2 = ((model.Association) (haxe.lang.Runtime.callField(assoc1, "next", null)) );
				//line 39 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if ( ! (assoc2.isClass()) ) 
				{
					//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					haxe.root.Xml _this2 = assoc2.svg;
					//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					if (( ( _this2.nodeType != haxe.root.Xml.Document ) && ( _this2.nodeType != haxe.root.Xml.Element ) )) 
					{
						//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( "Bad node type, expected Element or Document but found " + _Xml.XmlType_Impl_.toString(_this2.nodeType) ))) );
					}
					
					//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int w = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(_this2.children.__get(0).get("width")))) );
					//line 41 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					haxe.root.Xml _this3 = assoc2.svg;
					//line 41 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					if (( ( _this3.nodeType != haxe.root.Xml.Document ) && ( _this3.nodeType != haxe.root.Xml.Element ) )) 
					{
						//line 41 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( "Bad node type, expected Element or Document but found " + _Xml.XmlType_Impl_.toString(_this3.nodeType) ))) );
					}
					
					//line 41 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int h = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(_this3.children.__get(0).get("height")))) );
					//line 42 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					haxe.root.Array<java.lang.String> coords = haxe.lang.StringExt.split(schema.Svg.coordRE.replace(assoc2.svg.get("transform"), "$1"), ",");
					//line 43 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int x = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(coords.__get(0)))) );
					//line 44 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int y = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(coords.__get(1)))) );
					//line 45 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					svg.addChild(schema.UMLToSVG.drawLinks(assoc2, x, y, w, h,  ! (classDiagram) ));
				}
				
			}
			
		}
		
		//line 48 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		return doc;
	}
	
	
	public static boolean useField(model.Field field, boolean classDiagram, boolean showPrivate)
	{
		//line 52 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if ((  ! (field.isStatic)  || classDiagram )) 
		{
			//line 52 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			if (( field.visibility != model.Field.ACCESS_PUBLIC )) 
			{
				//line 52 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				return showPrivate;
			}
			else
			{
				//line 52 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				return true;
			}
			
		}
		else
		{
			//line 52 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			return false;
		}
		
	}
	
	
	public static int getFieldMaxWidth(model.Field field, boolean classDiagram, boolean showPrivate, boolean isKey, int max)
	{
		//line 56 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		int maxWidth = max;
		//line 57 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if (schema.UMLToSVG.useField(field, classDiagram, showPrivate)) 
		{
			//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			int width = ( (classDiagram) ? (field.toUMLString().length()) : (( field.toDomainString().length() + (( (isKey) ? (7) : (0) )) )) );
			//line 59 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			if (( width > maxWidth )) 
			{
				//line 60 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				maxWidth = width;
			}
			
		}
		
		//line 63 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		return maxWidth;
	}
	
	
	public static int getMethodMaxWidth(model.Method method, boolean classDiagram, boolean showPrivate, int max)
	{
		//line 67 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		int maxWidth = max;
		//line 68 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if (schema.UMLToSVG.useField(method, classDiagram, showPrivate)) 
		{
			//line 69 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			int width = method.toUMLString().length();
			//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			if (( width > maxWidth )) 
			{
				//line 71 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				maxWidth = width;
			}
			
		}
		
		//line 74 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		return maxWidth;
	}
	
	
	public static int getFieldsCount(java.lang.Object set, boolean classDiagram, boolean showPrivate)
	{
		//line 78 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		int fieldsCount = 1;
		//line 79 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		fieldsCount += ((int) (haxe.root.Lambda.count(((java.lang.Object) (haxe.lang.Runtime.getField(set, "fields", true)) ), ((haxe.lang.Function) (new schema.UMLToSVG_getFieldsCount_79__Fun(showPrivate, classDiagram)) ))) );
		//line 80 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if (classDiagram) 
		{
			//line 81 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			fieldsCount += ((int) (haxe.root.Lambda.count(((java.lang.Object) (haxe.lang.Runtime.getField(set, "navFields", true)) ), ((haxe.lang.Function) (new schema.UMLToSVG_getFieldsCount_81__Fun(showPrivate, classDiagram)) ))) );
			//line 82 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			fieldsCount += ((int) (haxe.root.Lambda.count(((java.lang.Object) (haxe.lang.Runtime.getField(set, "constructors", true)) ), ((haxe.lang.Function) (new schema.UMLToSVG_getFieldsCount_82__Fun(showPrivate, classDiagram)) ))) );
			//line 83 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			fieldsCount += ((int) (haxe.root.Lambda.count(((java.lang.Object) (haxe.lang.Runtime.getField(set, "accessors", true)) ), ((haxe.lang.Function) (new schema.UMLToSVG_getFieldsCount_83__Fun(showPrivate, classDiagram)) ))) );
			//line 84 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			fieldsCount += ((int) (haxe.root.Lambda.count(((java.lang.Object) (haxe.lang.Runtime.getField(set, "methods", true)) ), ((haxe.lang.Function) (new schema.UMLToSVG_getFieldsCount_84__Fun(showPrivate, classDiagram)) ))) );
		}
		
		//line 86 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		return fieldsCount;
	}
	
	
	public static int getMaxWidth(model.Set set, boolean classDiagram, boolean showPrivate)
	{
		//line 90 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		int[] chrWidth = new int[]{set.className.length()};
		//line 91 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Lambda.iter(((java.lang.Object) (set.fields) ), ((haxe.lang.Function) (new schema.UMLToSVG_getMaxWidth_91__Fun(showPrivate, set, classDiagram, chrWidth)) ));
		//line 91 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		java.lang.Object __temp_expr1 = ((java.lang.Object) (null) );
		//line 92 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Lambda.iter(((java.lang.Object) (set.navFields) ), ((haxe.lang.Function) (new schema.UMLToSVG_getMaxWidth_92__Fun(showPrivate, set, classDiagram, chrWidth)) ));
		//line 92 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		java.lang.Object __temp_expr2 = ((java.lang.Object) (null) );
		//line 93 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if (classDiagram) 
		{
			//line 94 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			haxe.root.Lambda.iter(((java.lang.Object) (set.constructors) ), ((haxe.lang.Function) (new schema.UMLToSVG_getMaxWidth_94__Fun(showPrivate, classDiagram, chrWidth)) ));
			//line 94 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			java.lang.Object __temp_expr3 = ((java.lang.Object) (null) );
			//line 95 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			haxe.root.Lambda.iter(((java.lang.Object) (set.accessors) ), ((haxe.lang.Function) (new schema.UMLToSVG_getMaxWidth_95__Fun(showPrivate, classDiagram, chrWidth)) ));
			//line 95 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			java.lang.Object __temp_expr4 = ((java.lang.Object) (null) );
			//line 96 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			haxe.root.Lambda.iter(((java.lang.Object) (set.methods) ), ((haxe.lang.Function) (new schema.UMLToSVG_getMaxWidth_96__Fun(showPrivate, classDiagram, chrWidth)) ));
			//line 96 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			java.lang.Object __temp_expr5 = ((java.lang.Object) (null) );
		}
		
		//line 98 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		return chrWidth[0];
	}
	
	
	public static haxe.root.Xml generateAssociationSVG(model.Diagram diagram, model.Association assoc, boolean classDiagram, boolean showPrivate)
	{
		//line 102 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		return schema.UMLToSVG.generateSetSVG(assoc, classDiagram, showPrivate);
	}
	
	
	public static haxe.root.Xml generateSetSVG(model.Set set, boolean classDiagram, boolean showPrivate)
	{
		//line 106 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		int fieldsCount = schema.UMLToSVG.getFieldsCount(set, classDiagram, showPrivate);
		//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		int chrWidth = schema.UMLToSVG.getMaxWidth(set, classDiagram, showPrivate);
		//line 109 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml g = haxe.root.Xml.createElement("g");
		//line 110 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml rect = haxe.root.Xml.createElement("rect");
		//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		g.addChild(rect);
		//line 112 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		rect.set("height", haxe.root.Std.string(( ( fieldsCount * 16 ) + ( 5 * (( (classDiagram) ? (3) : (2) )) ) )));
		//line 113 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		rect.set("width", haxe.root.Std.string(( ( chrWidth * 10.0 ) + 10 )));
		//line 114 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		rect.set("style", "fill:white");
		//line 116 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml titleBG = haxe.root.Xml.createElement("rect");
		//line 117 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		g.addChild(titleBG);
		//line 118 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		titleBG.set("height", "21");
		//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		titleBG.set("width", haxe.root.Std.string(( ( chrWidth * 10.0 ) + 10 )));
		//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		titleBG.set("style", ( (classDiagram) ? ("fill:white") : ("fill:lightgrey") ));
		//line 122 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml title = haxe.root.Xml.createElement("text");
		//line 123 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		g.addChild(title);
		//line 124 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		title.addChild(haxe.root.Xml.createPCData(set.className));
		//line 125 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		title.set("x", haxe.root.Std.string(( 5 + ( ( (( chrWidth - set.className.length() )) * 10.0 ) / 2 ) )));
		//line 126 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		title.set("y", "16");
		//line 128 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml text = haxe.root.Xml.createElement("text");
		//line 129 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		g.addChild(text);
		//line 130 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		int offset = 2;
		//line 131 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Array<haxe.root.Array<model.Field>> fieldSets = new haxe.root.Array<haxe.root.Array<model.Field>>(new haxe.root.Array[]{set.fields});
		//line 132 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if (classDiagram) 
		{
			//line 132 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			fieldSets.push(set.navFields);
		}
		
		//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		{
			//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			int _g = 0;
			//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			while (( _g < fieldSets.length ))
			{
				//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Array<model.Field> fieldSet = fieldSets.__get(_g);
				//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				 ++ _g;
				//line 134 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				{
					//line 134 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int _g1 = 0;
					//line 134 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					while (( _g1 < fieldSet.length ))
					{
						//line 134 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						model.Field field = fieldSet.__get(_g1);
						//line 134 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						 ++ _g1;
						//line 135 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						if (schema.UMLToSVG.useField(field, classDiagram, showPrivate)) 
						{
							//line 136 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							haxe.root.Xml tspan = haxe.root.Xml.createElement("tspan");
							//line 137 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							text.addChild(tspan);
							//line 138 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan.set("x", haxe.root.Std.string(2.5));
							//line 139 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan.set("y", haxe.root.Std.string(( ( 16 * offset ) + 5 )));
							//line 140 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							if (field.isStatic) 
							{
								//line 141 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
								tspan.set("style", "text-decoration:underline");
							}
							
							//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							java.lang.String visibility = null;
							//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							{
								//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
								int __temp_switch1 = (field.visibility);
								//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
								if (( __temp_switch1 == model.Field.ACCESS_PRIVATE )) 
								{
									//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
									visibility = "- ";
								}
								else
								{
									//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
									if (( __temp_switch1 == model.Field.ACCESS_PROTECTED )) 
									{
										//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
										visibility = "# ";
									}
									else
									{
										//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
										if (( __temp_switch1 == model.Field.ACCESS_PUBLIC )) 
										{
											//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
											visibility = "+ ";
										}
										else
										{
											//line 143 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
											visibility = "  ";
										}
										
									}
									
								}
								
							}
							
							//line 149 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan.addChild(haxe.root.Xml.createPCData(( (classDiagram) ? (field.toUMLString()) : (( field.toDomainString() + (( (set.id.contains(field.name)) ? (" <<id>>") : ("") )) )) )));
							//line 150 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							 ++ offset;
						}
						
					}
					
				}
				
			}
			
		}
		
		//line 155 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml line = haxe.root.Xml.createElement("line");
		//line 156 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		g.addChild(line);
		//line 157 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		line.set("x1", "0");
		//line 158 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		line.set("x2", haxe.root.Std.string(( 10 + ( chrWidth * 10.0 ) )));
		//line 159 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		line.set("y1", haxe.root.Std.string(( ( 16 * offset ) - 5 )));
		//line 160 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		line.set("y2", haxe.root.Std.string(( ( 16 * offset ) - 5 )));
		//line 161 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if (classDiagram) 
		{
			//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			{
				//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Array<model.Method> methodSet = set.constructors;
				//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				{
					//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int _g2 = 0;
					//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					while (( _g2 < methodSet.length ))
					{
						//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						model.Method method = methodSet.__get(_g2);
						//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						 ++ _g2;
						//line 164 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						if (schema.UMLToSVG.useField(method, classDiagram, showPrivate)) 
						{
							//line 165 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							haxe.root.Xml tspan1 = haxe.root.Xml.createElement("tspan");
							//line 166 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							text.addChild(tspan1);
							//line 167 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan1.set("x", haxe.root.Std.string(2.5));
							//line 168 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan1.set("y", haxe.root.Std.string(( ( 16 * offset ) + 10 )));
							//line 169 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							if (method.isStatic) 
							{
								//line 170 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
								tspan1.set("style", "text-decoration:underline");
							}
							
							//line 172 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan1.addChild(haxe.root.Xml.createPCData(method.toUMLString()));
							//line 173 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							 ++ offset;
						}
						
					}
					
				}
				
			}
			
			//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			{
				//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Array<model.Method> methodSet1 = set.accessors;
				//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				{
					//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int _g3 = 0;
					//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					while (( _g3 < methodSet1.length ))
					{
						//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						model.Method method1 = methodSet1.__get(_g3);
						//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						 ++ _g3;
						//line 164 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						if (schema.UMLToSVG.useField(method1, classDiagram, showPrivate)) 
						{
							//line 165 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							haxe.root.Xml tspan2 = haxe.root.Xml.createElement("tspan");
							//line 166 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							text.addChild(tspan2);
							//line 167 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan2.set("x", haxe.root.Std.string(2.5));
							//line 168 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan2.set("y", haxe.root.Std.string(( ( 16 * offset ) + 10 )));
							//line 169 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							if (method1.isStatic) 
							{
								//line 170 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
								tspan2.set("style", "text-decoration:underline");
							}
							
							//line 172 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan2.addChild(haxe.root.Xml.createPCData(method1.toUMLString()));
							//line 173 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							 ++ offset;
						}
						
					}
					
				}
				
			}
			
			//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			{
				//line 162 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Array<model.Method> methodSet2 = set.methods;
				//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				{
					//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int _g4 = 0;
					//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					while (( _g4 < methodSet2.length ))
					{
						//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						model.Method method2 = methodSet2.__get(_g4);
						//line 163 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						 ++ _g4;
						//line 164 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						if (schema.UMLToSVG.useField(method2, classDiagram, showPrivate)) 
						{
							//line 165 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							haxe.root.Xml tspan3 = haxe.root.Xml.createElement("tspan");
							//line 166 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							text.addChild(tspan3);
							//line 167 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan3.set("x", haxe.root.Std.string(2.5));
							//line 168 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan3.set("y", haxe.root.Std.string(( ( 16 * offset ) + 10 )));
							//line 169 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							if (method2.isStatic) 
							{
								//line 170 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
								tspan3.set("style", "text-decoration:underline");
							}
							
							//line 172 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							tspan3.addChild(haxe.root.Xml.createPCData(method2.toUMLString()));
							//line 173 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							 ++ offset;
						}
						
					}
					
				}
				
			}
			
		}
		
		//line 178 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		return g;
	}
	
	
	public static void drawInheritance(model.Diagram diagram, haxe.root.Xml svg)
	{
		//line 182 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		java.lang.Object set = new haxe.ds._StringMap.StringMapValueIterator<model.Set>(((haxe.ds.StringMap<model.Set>) (diagram.sets) ));
		//line 182 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(set, "hasNext", null)) )))
		{
			//line 182 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			model.Set set1 = ((model.Set) (haxe.lang.Runtime.callField(set, "next", null)) );
			//line 183 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			if (( set1.superset != null )) 
			{
				//line 184 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				svg.addChild(schema.Svg.getSvgLine(schema.Svg.getLine(set1, set1.superset, null, null, null), null, haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(schema.Svg.MARKERS.__get(1), "id", true))));
			}
			
		}
		
	}
	
	
	public static void placeClassAssociations(model.Diagram diagram, haxe.root.Xml svg)
	{
		//line 190 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		java.lang.Object assoc = new haxe.ds._StringMap.StringMapValueIterator<model.Association>(((haxe.ds.StringMap<model.Association>) (diagram.associations) ));
		//line 190 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(assoc, "hasNext", null)) )))
		{
			//line 190 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			model.Association assoc1 = ((model.Association) (haxe.lang.Runtime.callField(assoc, "next", null)) );
			//line 191 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			if (assoc1.isClass()) 
			{
				//line 192 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Xml _this = assoc1.svg;
				//line 192 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (( ( _this.nodeType != haxe.root.Xml.Document ) && ( _this.nodeType != haxe.root.Xml.Element ) )) 
				{
					//line 192 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( "Bad node type, expected Element or Document but found " + _Xml.XmlType_Impl_.toString(_this.nodeType) ))) );
				}
				
				//line 192 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int w = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(_this.children.__get(0).get("width")))) );
				//line 193 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Xml _this1 = assoc1.svg;
				//line 193 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (( ( _this1.nodeType != haxe.root.Xml.Document ) && ( _this1.nodeType != haxe.root.Xml.Element ) )) 
				{
					//line 193 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					throw ((java.lang.RuntimeException) (haxe.Exception.thrown(( "Bad node type, expected Element or Document but found " + _Xml.XmlType_Impl_.toString(_this1.nodeType) ))) );
				}
				
				//line 193 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int h = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(_this1.children.__get(0).get("height")))) );
				//line 194 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Array<java.lang.String> coords = haxe.lang.StringExt.split(schema.Svg.coordRE.replace(assoc1.svg.get("transform"), "$1"), ",");
				//line 195 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int x = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(coords.__get(0)))) );
				//line 196 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int y = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(coords.__get(1)))) );
				//line 197 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Xml g = schema.UMLToSVG.drawLinks(assoc1, x, y, w, h, false);
				//line 198 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int cX = ((int) (( x + ( ((double) (w) ) / 2 ) )) );
				//line 199 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int aCx = cX;
				//line 200 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int cY = ((int) (( y + ( ((double) (h) ) / 2 ) )) );
				//line 201 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int aCy = cY;
				//line 202 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int aX = x;
				//line 203 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int aY = y;
				//line 204 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (( assoc1.links.length == 2 )) 
				{
					//line 205 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					if (( ( assoc1.row == assoc1.links.__get(0).set.row ) && ( assoc1.row == assoc1.links.__get(1).set.row ) )) 
					{
						//line 206 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						aY += ((int) (( ( ((double) (h) ) / 2 ) + 20 )) );
						//line 207 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						aCy = aY;
					}
					else
					{
						//line 208 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						if (( ( assoc1.col == assoc1.links.__get(0).set.col ) && ( assoc1.col == assoc1.links.__get(1).set.col ) )) 
						{
							//line 209 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							aX += ((int) (( ( ((double) (w) ) / 2 ) + 20 )) );
							//line 210 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							aCx = aX;
						}
						
					}
					
					//line 212 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					schema.Line line = schema.Svg.getLine(assoc1.links.__get(0).set, assoc1.links.__get(1).set, null, null, null);
					//line 213 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					cX = ((int) (( ((double) ((( line.x1 + line.x2 ))) ) / 2 )) );
					//line 214 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					cY = ((int) (( ((double) ((( line.y1 + line.y2 ))) ) / 2 )) );
				}
				else
				{
					//line 216 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					aX += ((int) (( ( ((double) (w) ) / 2 ) + 20 )) );
					//line 217 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					aY += ((int) (( ( ((double) (h) ) / 2 ) + 20 )) );
				}
				
				//line 219 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (( assoc1.col == ( diagram.width - 1 ) )) 
				{
					//line 220 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					svg.set("width", haxe.root.Std.string(( ((int) (haxe.lang.Runtime.toInt(haxe.lang.Runtime.plus(haxe.root.Std.parseInt(svg.get("width")), aX))) ) - x )));
				}
				
				//line 222 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (( assoc1.row == ( diagram.height - 1 ) )) 
				{
					//line 223 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					svg.set("height", haxe.root.Std.string(( ((int) (haxe.lang.Runtime.toInt(haxe.lang.Runtime.plus(haxe.root.Std.parseInt(svg.get("height")), aY))) ) - y )));
				}
				
				//line 225 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				assoc1.svg.set("transform", ( ( ( ( "translate(" + aX ) + "," ) + aY ) + ")" ));
				//line 226 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Xml dotted = haxe.root.Xml.createElement("line");
				//line 227 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				dotted.set("x1", haxe.root.Std.string(cX));
				//line 228 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				dotted.set("x2", haxe.root.Std.string(aCx));
				//line 229 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				dotted.set("y1", haxe.root.Std.string(cY));
				//line 230 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				dotted.set("y2", haxe.root.Std.string(aCy));
				//line 231 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				dotted.set("stroke-dasharray", "2,2");
				//line 232 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				g.insertChild(dotted, 0);
				//line 233 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				svg.insertChild(g, 0);
			}
			
		}
		
	}
	
	
	public static haxe.root.Xml drawLinks(model.Association assoc, int x, int y, int w, int h, boolean showNav)
	{
		//line 240 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		haxe.root.Xml g = haxe.root.Xml.createElement("g");
		//line 241 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if (( assoc.links.length > 2 )) 
		{
			//line 242 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			x = ((int) (( x + ( ((double) (w) ) / 2 ) )) );
			//line 243 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			y = ((int) (( y + ( ((double) (h) ) / 2 ) )) );
			//line 244 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			{
				//line 244 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int _g = 0;
				//line 244 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Array<model.Link> _g1 = assoc.links;
				//line 244 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				while (( _g < _g1.length ))
				{
					//line 244 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					model.Link link = _g1.__get(_g);
					//line 244 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					 ++ _g;
					//line 245 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					schema.Line line = schema.Svg.getLine(link.set, assoc, null, null, null);
					//line 246 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					line.x2 = x;
					//line 247 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					line.y2 = y;
					//line 248 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					g.addChild(schema.Svg.getSvgLine(line, null, null));
				}
				
			}
			
			//line 250 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			haxe.root.Xml path = haxe.root.Xml.createElement("path");
			//line 251 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			path.set("transform", ( ( ( ( "translate(" + x ) + "," ) + y ) + ")" ));
			//line 252 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			path.set("style", "fill:white;stroke:black");
			//line 253 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			path.set("d", ( ( ( ( ( ( ( ( "M " + (-10) ) + " 0 L 0 " ) + (-10) ) + " L " ) + 10 ) + " 0 L 0 " ) + 10 ) + " Z" ));
			//line 254 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			g.addChild(path);
		}
		else
		{
			//line 255 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			if (( assoc.links.length == 2 )) 
			{
				//line 256 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				model.Link link1 = assoc.links.__get(0);
				//line 257 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				model.Link link2 = assoc.links.__get(1);
				//line 258 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (( ( link2.isWeak || link2.isAgregate ) || link1.hasArrow )) 
				{
					//line 259 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					link1 = assoc.links.__get(1);
					//line 260 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					link2 = assoc.links.__get(0);
				}
				
				//line 262 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				java.lang.String markerId = ( (link1.isWeak) ? (haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(schema.Svg.MARKERS.__get(3), "id", true))) : (( (link1.isAgregate) ? (haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(schema.Svg.MARKERS.__get(2), "id", true))) : (( (link2.hasArrow) ? (haxe.lang.Runtime.toString(haxe.lang.Runtime.getField(schema.Svg.MARKERS.__get(0), "id", true))) : (null) )) )) );
				//line 263 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Xml mm1 = haxe.root.Xml.createElement("text");
				//line 264 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				mm1.addChild(haxe.root.Xml.createPCData(link2.getUMLCards()));
				//line 265 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				haxe.root.Xml mm2 = haxe.root.Xml.createElement("text");
				//line 266 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				mm2.addChild(haxe.root.Xml.createPCData(( (( link1.isWeak || link1.isAgregate )) ? ("") : (link1.getUMLCards()) )));
				//line 267 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (haxe.lang.Runtime.valEq(link1.set.className, link2.set.className)) 
				{
					//line 268 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					schema.Line line1 = schema.Svg.getLine(assoc, link2.set, "", ( (( link1.isWeak || link1.isAgregate )) ? ("") : (link1.getUMLCards()) ), -1);
					//line 269 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					schema.Line line2 = schema.Svg.getLine(assoc, link1.set, "", link2.getUMLCards(), 1);
					//line 270 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					haxe.root.Xml bezier = haxe.root.Xml.createElement("path");
					//line 271 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int xlq = ( line1.x1 + (( (( line1.x2 == line2.x2 )) ? (( line1.x1 - line1.x2 )) : (0) )) );
					//line 272 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					int ylq = ( line1.y1 + (( (( line1.y2 == line2.y2 )) ? (( line1.y1 - line1.y2 )) : (0) )) );
					//line 273 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					bezier.set("d", ( ( ( ( ( ( ( ( ( ( ( "M " + line2.x2 ) + " " ) + line2.y2 ) + " Q " ) + xlq ) + " " ) + ylq ) + " " ) + line1.x2 ) + " " ) + line1.y2 ));
					//line 274 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					if (( markerId != null )) 
					{
						//line 275 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						bezier.set("marker-end", ( ( "url(#" + markerId ) + ")" ));
					}
					
					//line 277 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					g.addChild(bezier);
					//line 278 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					mm1.set("x", haxe.root.Std.string(line2.cx2));
					//line 279 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					mm1.set("y", haxe.root.Std.string(line2.cy2));
					//line 280 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					mm2.set("x", haxe.root.Std.string(line1.cx2));
					//line 281 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					mm2.set("y", haxe.root.Std.string(line1.cy2));
					//line 282 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					if (showNav) 
					{
						//line 283 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						schema.UMLToSVG.addNavLabel(link1, link2, line1, 2, g);
						//line 284 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						schema.UMLToSVG.addNavLabel(link2, link1, line2, 2, g);
					}
					
				}
				else
				{
					//line 287 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					schema.Line line3 = schema.Svg.getLine(link1.set, link2.set, link2.getUMLCards(), ( (( link1.isWeak || link1.isAgregate )) ? ("") : (link1.getUMLCards()) ), null);
					//line 288 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					g.addChild(schema.Svg.getSvgLine(line3, 0, markerId));
					//line 289 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					mm1.set("x", haxe.root.Std.string(line3.cx1));
					//line 290 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					mm1.set("y", haxe.root.Std.string(line3.cy1));
					//line 291 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					mm2.set("x", haxe.root.Std.string(line3.cx2));
					//line 292 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					mm2.set("y", haxe.root.Std.string(line3.cy2));
					//line 293 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					if (showNav) 
					{
						//line 294 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						schema.UMLToSVG.addNavLabel(link1, link2, line3, 2, g);
						//line 295 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						schema.UMLToSVG.addNavLabel(link2, link1, line3, 1, g);
					}
					
				}
				
				//line 298 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				g.addChild(mm1);
				//line 299 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				g.addChild(mm2);
			}
			
		}
		
		//line 301 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		return g;
	}
	
	
	public static void addNavLabel(model.Link link, model.Link oppositeLink, schema.Line line, int end, haxe.root.Xml g)
	{
		//line 305 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
		if ( ! (link.hasArrow) ) 
		{
			//line 306 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			java.lang.String fName = oppositeLink.classRole;
			//line 307 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			if (haxe.lang.Runtime.valEq(oppositeLink.role, "")) 
			{
				//line 308 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				fName = ( (haxe.lang.Runtime.valEq(link.max, "N")) ? (oppositeLink.set.getPluralClassName()) : (oppositeLink.set.className) );
			}
			
			//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			java.lang.String visibility = null;
			//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			{
				//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				int __temp_switch1 = (oppositeLink.visibility);
				//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				if (( __temp_switch1 == model.Field.ACCESS_PRIVATE )) 
				{
					//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					visibility = "-";
				}
				else
				{
					//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
					if (( __temp_switch1 == model.Field.ACCESS_PROTECTED )) 
					{
						//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						visibility = "#";
					}
					else
					{
						//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
						if (( __temp_switch1 == model.Field.ACCESS_PUBLIC )) 
						{
							//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							visibility = "+";
						}
						else
						{
							//line 310 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
							visibility = "";
						}
						
					}
					
				}
				
			}
			
			//line 316 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			fName = ( ( visibility + haxe.lang.StringExt.charAt(fName, 0).toLowerCase() ) + haxe.lang.StringExt.substr(fName, 1, null) );
			//line 317 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			haxe.root.Xml text = haxe.root.Xml.createElement("text");
			//line 318 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			text.addChild(haxe.root.Xml.createPCData(fName));
			//line 319 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			int x = ( (( end == 1 )) ? (line.x1) : (line.x2) );
			//line 320 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			int y = ( (( end == 1 )) ? (line.y1) : (line.y2) );
			//line 321 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			int cx = ( (( end == 1 )) ? (line.cx1) : (line.cx2) );
			//line 322 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			int cy = ( (( end == 1 )) ? (line.cy1) : (line.cy2) );
			//line 323 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			text.set("x", haxe.root.Std.string(( (( x < cx )) ? (cx) : (( cx - ( 10.0 * (( fName.length() - link.getUMLCards().length() )) ) )) )));
			//line 324 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			if (( link.isWeak || link.isAgregate )) 
			{
				//line 325 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				text.set("y", haxe.root.Std.string(cy));
			}
			else
			{
				//line 327 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
				text.set("y", haxe.root.Std.string(( (( y < cy )) ? (( cy + 16 )) : (( cy - 16 )) )));
			}
			
			//line 329 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/schema/UMLToSVG.hx"
			g.addChild(text);
		}
		
	}
	
	
}


