1/**
2 * $Id: mxArchiMate3.js,v 1.0 2016/08/18 07:05:39 mate Exp $
3 * Copyright (c) 2006-2016, JGraph Ltd
4 */
5
6//**********************************************************************************************************************************************************
7//Application
8//**********************************************************************************************************************************************************
9/**
10* Extends mxShape.
11*/
12function mxArchiMate3Application(bounds, fill, stroke, strokewidth)
13{
14	mxShape.call(this);
15	this.bounds = bounds;
16	this.fill = fill;
17	this.stroke = stroke;
18	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
19};
20
21/**
22* Extends mxShape.
23*/
24mxUtils.extend(mxArchiMate3Application, mxShape);
25
26mxArchiMate3Application.prototype.cst = {
27		APPLICATION : 'mxgraph.archimate3.application',
28		TYPE : 'appType',
29		COMPONENT : 'comp',
30		COLLABORATION : 'collab',
31		INTERFACE : 'interface',
32		INTERFACE2 : 'interface2',
33		LOCATION : 'location',
34		FUNCTION : 'func',
35		INTERACTION : 'interaction',
36		SERVICE : 'serv',
37		EVENT : 'event',
38		EVENT2 : 'event2',
39		NODE : 'node',
40		NETWORK : 'netw',
41		COMM_PATH : 'commPath',
42		ACTOR : 'actor',
43		ASSESSMENT : 'assess',
44		GOAL : 'goal',
45		OUTCOME : 'outcome',
46		ROLE : 'role',
47		PROCESS : 'proc',
48		DRIVER : 'driver',
49		PRINCIPLE : 'principle',
50		REQUIREMENT : 'requirement',
51		CONSTRAINT : 'constraint',
52		RESOURCE : 'resource',
53		CAPABILITY : 'capability',
54		COURSE : 'course',
55		MATERIAL : 'material',
56		DISTRIBUTION : 'distribution',
57		SYS_SW : 'sysSw',
58		ARTIFACT : 'artifact',
59		PATH : 'path',
60		ARCHI_TYPE : 'archiType',
61		TYPE_SQUARE : 'square',
62		TYPE_ROUNDED : 'rounded',
63		TYPE_OCT : 'oct'
64};
65
66mxArchiMate3Application.prototype.customProperties = [
67	{name: 'archiType', dispName: 'Type', type: 'enum',
68		enumList: [{val: 'square', dispName: 'Square'},
69			       {val: 'rounded', dispName: 'Rounded'},
70			       {val: 'oct', dispName: 'Octagonal'}]
71	},
72	{name: 'appType', dispName: 'App Type', type: 'enum',
73		enumList: [{val: 'comp', dispName: 'Component'},
74				   {val: 'collab', dispName: 'Collaboration'},
75				   {val: 'interface', dispName: 'Interface'},
76				   {val: 'interface2', dispName: 'Interface2'},
77				   {val: 'func', dispName: 'Function'},
78				   {val: 'interaction', dispName: 'Interaction'},
79				   {val: 'location', dispName: 'Location'},
80				   {val: 'serv', dispName: 'Service'},
81				   {val: 'event', dispName: 'Event'},
82				   {val: 'event2', dispName: 'Event2'},
83				   {val: 'node', dispName: 'Node'},
84				   {val: 'netw', dispName: 'Network'},
85				   {val: 'commPath', dispName: 'Comm Path'},
86				   {val: 'actor', dispName: 'Actor'},
87				   {val: 'assess', dispName: 'Assessment'},
88				   {val: 'goal', dispName: 'Goal'},
89				   {val: 'outcome', dispName: 'Outcome'},
90				   {val: 'role', dispName: 'Role'},
91				   {val: 'proc', dispName: 'Process'},
92				   {val: 'driver', dispName: 'Driver'},
93				   {val: 'principle', dispName: 'Principle'},
94				   {val: 'requirement', dispName: 'Requirement'},
95				   {val: 'constraint', dispName: 'Constraint'},
96				   {val: 'resource', dispName: 'Resource'},
97				   {val: 'capability', dispName: 'Capability'},
98				   {val: 'course', dispName: 'Course'},
99				   {val: 'material', dispName: 'Material'},
100				   {val: 'distribution', dispName: 'Distribution'},
101				   {val: 'sysSw', dispName: 'System Sw'},
102				   {val: 'artifact', dispName: 'Artifact'},
103				   {val: 'path', dispName: 'Path'}]
104}];
105
106/**
107* Function: paintVertexShape
108*
109* Paints the vertex shape.
110*/
111mxArchiMate3Application.prototype.paintVertexShape = function(c, x, y, w, h)
112{
113	c.translate(x, y);
114	this.background(c, 0, 0, w, h);
115	c.setShadow(false);
116	c.translate(w - 20, 5);
117	this.foreground(c, w - 20, 5, 15, 15);
118};
119
120mxArchiMate3Application.prototype.background = function(c, x, y, w, h)
121{
122	var archiType = mxUtils.getValue(this.style, mxArchiMate3Application.prototype.cst.ARCHI_TYPE, 'square');
123
124	if (archiType === 'rounded')
125	{
126		c.roundrect(0, 0, w, h, 10, 10);
127	}
128	else if ((archiType === 'oct') && w >= 20 && h >= 20)
129	{
130		c.begin();
131		c.moveTo(0, 10);
132		c.lineTo(10, 0);
133		c.lineTo(w - 10, 0);
134		c.lineTo(w, 10);
135		c.lineTo(w, h - 10);
136		c.lineTo(w - 10, h);
137		c.lineTo(10, h);
138		c.lineTo(0, h - 10);
139		c.close();
140		c.fillAndStroke();
141	}
142	else
143	{
144		c.rect(0, 0, w, h);
145	}
146
147	c.fillAndStroke();
148};
149
150mxArchiMate3Application.prototype.foreground = function(c, x, y, w, h)
151{
152	var type = mxUtils.getValue(this.style, mxArchiMate3Application.prototype.cst.TYPE, '');
153
154	c.setDashed(false);
155
156	if (type === mxArchiMate3Application.prototype.cst.COMPONENT)
157	{
158		c.translate(1, 0);
159		w = w - 2;
160
161		mxArchiMate3Component.prototype.background(c, x, y, w, h);
162	}
163	else if (type === mxArchiMate3Application.prototype.cst.COLLABORATION)
164	{
165		c.translate(0, 3);
166		h = h - 6;
167
168		mxArchiMate3Collaboration.prototype.background(c, x, y, w, h);
169	}
170	else if (type === mxArchiMate3Application.prototype.cst.INTERFACE)
171	{
172		c.translate(0, 4);
173		h = h - 8;
174
175		mxArchiMate3Interface.prototype.background(c, x, y, w, h);
176	}
177	else if (type === mxArchiMate3Application.prototype.cst.INTERFACE2)
178	{
179		c.translate(0, 1);
180		h = h - 2;
181
182		c.begin();
183		c.moveTo(0, h * 0.5);
184		c.lineTo(w * 0.6, h * 0.5);
185		c.moveTo(w, 0);
186		c.arcTo(w * 0.4, h * 0.5, 0, 0, 0, w, h);
187		c.stroke();
188	}
189	else if (type === mxArchiMate3Application.prototype.cst.FUNCTION)
190	{
191		mxArchiMate3Function.prototype.background(c, x, y, w, h);
192	}
193	else if (type === mxArchiMate3Application.prototype.cst.INTERACTION)
194	{
195		mxArchiMate3Interaction.prototype.background(c, x, y, w, h);
196	}
197	else if (type === mxArchiMate3Application.prototype.cst.LOCATION)
198	{
199		c.translate(3, 0);
200		w = w - 6;
201		c.begin();
202		c.moveTo(w * 0.5, h);
203		c.arcTo(w * 0.1775, h * 0.3, 0, 0, 0, w * 0.345, h * 0.7);
204		c.arcTo(w * 0.538, h * 0.364, 0, 0, 1, w * 0.5, 0);
205		c.arcTo(w * 0.538, h * 0.364, 0, 0, 1, w * 0.655, h * 0.7);
206		c.arcTo(w * 0.1775, h * 0.3, 0, 0, 0, w * 0.5, h);
207		c.stroke();
208	}
209	else if (type === mxArchiMate3Application.prototype.cst.SERVICE)
210	{
211		c.translate(0, 3);
212		h = h - 6;
213
214		mxArchiMate3Service.prototype.background(c, x, y, w, h);
215	}
216	else if (type === mxArchiMate3Application.prototype.cst.EVENT)
217	{
218		c.translate(0, 3);
219		h = h - 6;
220
221		mxArchiMate3Event.prototype.background(c, x, y, w, h);
222	}
223	else if (type === mxArchiMate3Application.prototype.cst.EVENT2)
224	{
225		c.translate(0, 3);
226		h = h - 6;
227
228		mxArchiMate3Event2.prototype.background(c, x, y, w, h);
229	}
230	else if (type === mxArchiMate3Application.prototype.cst.NODE)
231	{
232		mxArchiMate3Node.prototype.background(c, x, y, w, h);
233	}
234	else if (type === mxArchiMate3Application.prototype.cst.NETWORK)
235	{
236		c.translate(0, 2);
237		h = h - 4;
238
239		c.begin();
240		c.moveTo(w * 0.4, h * 0.2);
241		c.lineTo(w * 0.85, h * 0.2);
242		c.lineTo(w * 0.6, h * 0.8);
243		c.lineTo(w * 0.15, h * 0.8);
244		c.close();
245		c.stroke();
246
247		var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
248		c.setFillColor(strokeColor);
249
250		c.ellipse(w * 0.25, 0, w * 0.3, h * 0.4);
251		c.fill();
252
253		c.ellipse(w * 0.7, 0, w * 0.3, h * 0.4);
254		c.fill();
255
256		c.ellipse(0, h * 0.6, w * 0.3, h * 0.4);
257		c.fill();
258
259		c.ellipse(w * 0.45, h * 0.6, w * 0.3, h * 0.4);
260		c.fill();
261	}
262	else if (type === mxArchiMate3Application.prototype.cst.COMM_PATH)
263	{
264		c.translate(0, 5);
265		h = h - 10;
266
267		c.begin();
268		c.moveTo(w * 0.1, 0);
269		c.lineTo(0, h * 0.5);
270		c.lineTo(w * 0.1, h);
271		c.moveTo(w * 0.9, 0);
272		c.lineTo(w, h * 0.5);
273		c.lineTo(w * 0.9, h);
274		c.stroke();
275
276		c.setDashed(true);
277		c.begin();
278		c.moveTo(0, h * 0.5);
279		c.lineTo(w, h * 0.5);
280		c.stroke();
281	}
282	else if (type === mxArchiMate3Application.prototype.cst.ARTIFACT)
283	{
284		c.translate(2, 0);
285		w = w - 4;
286
287		c.begin();
288		c.moveTo(0, 0);
289		c.lineTo(w * 0.7, 0);
290		c.lineTo(w, h * 0.22);
291		c.lineTo(w, h);
292		c.lineTo(0, h);
293		c.close();
294		c.moveTo(w * 0.7, 0);
295		c.lineTo(w * 0.7, h * 0.22);
296		c.lineTo(w, h * 0.22);
297		c.stroke();
298	}
299	else if (type === mxArchiMate3Application.prototype.cst.ACTOR)
300	{
301		c.translate(3, 0);
302		w = w - 6;
303
304		mxArchiMate3Actor.prototype.background(c, x, y, w, h);
305	}
306	else if (type === mxArchiMate3Application.prototype.cst.ROLE)
307	{
308		c.translate(0, 4);
309		h = h - 8;
310
311		mxArchiMate3Role.prototype.background(c, x, y, w, h);
312	}
313	else if (type === mxArchiMate3Application.prototype.cst.PROCESS)
314	{
315		c.translate(0, 3);
316		h = h - 6;
317
318		mxArchiMate3Process.prototype.background(c, x, y, w, h);
319	}
320	else if (type === mxArchiMate3Application.prototype.cst.DRIVER)
321	{
322		c.ellipse(w * 0.1, h * 0.1, w * 0.8, h * 0.8);
323		c.stroke();
324
325		c.begin();
326		c.moveTo(0, h * 0.5);
327		c.lineTo(w, h * 0.5);
328		c.moveTo(w * 0.5, 0);
329		c.lineTo(w * 0.5, h);
330		c.moveTo(w * 0.145, h * 0.145);
331		c.lineTo(w * 0.855, h * 0.855);
332		c.moveTo(w * 0.145, h * 0.855);
333		c.lineTo(w * 0.855, h * 0.145);
334		c.stroke();
335
336		var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
337		c.setFillColor(strokeColor);
338
339		c.ellipse(w * 0.35, h * 0.35, w * 0.3, h * 0.3);
340		c.fillAndStroke();
341	}
342	else if (type === mxArchiMate3Application.prototype.cst.ASSESSMENT)
343	{
344		c.ellipse(w * 0.2, 0, w * 0.8, h * 0.8);
345		c.stroke();
346
347		c.begin();
348		c.moveTo(0, h);
349		c.lineTo(w * 0.32, h * 0.68);
350		c.stroke();
351	}
352	else if (type === mxArchiMate3Application.prototype.cst.GOAL)
353	{
354		c.ellipse(0, 0, w, h);
355		c.stroke();
356		c.ellipse(w * 0.15, h * 0.15, w * 0.7, h * 0.7);
357		c.stroke();
358		var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
359		c.setFillColor(strokeColor);
360		c.ellipse(w * 0.3, h * 0.3, w * 0.4, h * 0.4);
361		c.fillAndStroke();
362	}
363	else if (type === mxArchiMate3Application.prototype.cst.OUTCOME)
364	{
365		c.ellipse(0, w * 0.2, w * 0.8, h * 0.8);
366		c.stroke();
367		c.ellipse(w * 0.15, w * 0.35, w * 0.5, h * 0.5);
368		c.stroke();
369		c.ellipse(w * 0.3, w * 0.5, w * 0.2, h * 0.2);
370		c.stroke();
371
372		c.begin();
373		c.moveTo(w * 0.4, h * 0.6);
374		c.lineTo(w * 0.9, h * 0.1);
375		c.moveTo(w * 0.42, h * 0.4);
376		c.lineTo(w * 0.4, h * 0.6);
377		c.lineTo(w * 0.6, h * 0.58);
378		c.moveTo(w * 0.8, 0);
379		c.lineTo(w * 0.75, h * 0.25);
380		c.lineTo(w, h * 0.2);
381		c.stroke();
382	}
383	else if (type === mxArchiMate3Application.prototype.cst.PRINCIPLE)
384	{
385		c.begin();
386		c.moveTo(w * 0.05, h * 0.05);
387		c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.95, h * 0.05);
388		c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.95, h * 0.95);
389		c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.05, h * 0.95);
390		c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.05, h * 0.05);
391		c.close();
392		c.stroke();
393
394		var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
395		c.setFillColor(strokeColor);
396
397		c.begin();
398		c.moveTo(w * 0.45, h * 0.7);
399		c.lineTo(w * 0.42, h * 0.15);
400		c.lineTo(w * 0.58, h * 0.15);
401		c.lineTo(w * 0.55, h * 0.7);
402		c.close();
403		c.fill();
404
405		c.rect(w * 0.45, h * 0.75, w * 0.1, h * 0.1);
406		c.fill();
407	}
408	else if (type === mxArchiMate3Application.prototype.cst.REQUIREMENT)
409	{
410		c.translate(0, 4);
411		h = h - 8;
412
413		mxArchiMate3Requirement.prototype.background(c, x, y, w, h);
414	}
415	else if (type === mxArchiMate3Application.prototype.cst.CONSTRAINT)
416	{
417		c.translate(0, 4);
418		h = h - 8;
419
420		mxArchiMate3Constraint.prototype.background(c, x, y, w, h);
421	}
422	else if (type === mxArchiMate3Application.prototype.cst.MATERIAL)
423	{
424		c.translate(0, 1);
425		h = h - 2;
426
427		c.begin();
428		c.moveTo(0, h * 0.5);
429		c.lineTo(w * 0.25, 0);
430		c.lineTo(w * 0.75, 0);
431		c.lineTo(w, h * 0.5);
432		c.lineTo(w * 0.75, h);
433		c.lineTo(w * 0.25, h);
434		c.close();
435		c.moveTo(w * 0.15, h * 0.5);
436		c.lineTo(w * 0.31, h * 0.2);
437		c.moveTo(w * 0.69, h * 0.2);
438		c.lineTo(w * 0.85, h * 0.5);
439		c.moveTo(w * 0.68, h * 0.80);
440		c.lineTo(w * 0.32, h * 0.80);
441		c.stroke();
442	}
443	else if (type === mxArchiMate3Application.prototype.cst.DISTRIBUTION)
444	{
445		c.translate(0, 4);
446		h = h - 8;
447
448		mxArchiMate3Distribution.prototype.background(c, x, y, w, h);
449	}
450	else if (type === mxArchiMate3Application.prototype.cst.RESOURCE)
451	{
452		c.translate(0, 1);
453		h = h - 2;
454
455		mxArchiMate3Resource.prototype.background(c, x, y, w, h);
456	}
457	else if (type === mxArchiMate3Application.prototype.cst.CAPABILITY)
458	{
459		mxArchiMate3Capability.prototype.background(c, x, y, w, h);
460	}
461	else if (type === mxArchiMate3Application.prototype.cst.COURSE)
462	{
463		mxArchiMate3Course.prototype.background(c, x, y, w, h);
464	}
465	else if (type === mxArchiMate3Application.prototype.cst.SYS_SW)
466	{
467		mxArchiMate3SysSw.prototype.background(c, x, y, w, h);
468	}
469	else if (type === mxArchiMate3Application.prototype.cst.ARTIFACT)
470	{
471		c.translate(2, 0);
472		w = w - 4;
473
474		mxArchiMate3Artifact.prototype.background(c, x, y, w, h);
475	}
476	else if (type === mxArchiMate3Application.prototype.cst.PATH)
477	{
478		c.translate(0, 5);
479		h = h - 10;
480
481		mxArchiMate3Path.prototype.background(c, x, y, w, h);
482	}
483};
484
485mxCellRenderer.registerShape(mxArchiMate3Application.prototype.cst.APPLICATION, mxArchiMate3Application);
486
487mxArchiMate3Application.prototype.getConstraints = function(style, w, h)
488{
489	var constr = [];
490	var archiType = mxUtils.getValue(this.style, mxArchiMate3Application.prototype.cst.ARCHI_TYPE, 'square');
491
492	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
493	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
494	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
495	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
496	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
497	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
498	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
499	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
500	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
501	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
502	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
503	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
504
505	if (archiType === 'rounded')
506	{
507		constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, 2.9));
508		constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, -2.9, 2.9));
509		constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -2.9, -2.9));
510		constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, 2.9, -2.9));
511	}
512	else if ((archiType === 'oct') && w >= 20 && h >= 20)
513	{
514		constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 5, 5));
515		constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, -5, 5));
516		constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -5, -5));
517		constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, 5, -5));
518	}
519	else
520	{
521		constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
522		constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
523		constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
524		constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
525	}
526
527	return (constr);
528};
529
530//**********************************************************************************************************************************************************
531//Component
532//**********************************************************************************************************************************************************
533/**
534* Extends mxShape.
535*/
536function mxArchiMate3Component(bounds, fill, stroke, strokewidth)
537{
538	mxShape.call(this);
539	this.bounds = bounds;
540	this.fill = fill;
541	this.stroke = stroke;
542	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
543};
544
545/**
546* Extends mxShape.
547*/
548mxUtils.extend(mxArchiMate3Component, mxShape);
549
550mxArchiMate3Component.prototype.cst = {
551		COMPONENT : 'mxgraph.archimate3.component'
552};
553
554/**
555* Function: paintVertexShape
556*
557* Paints the vertex shape.
558*/
559mxArchiMate3Component.prototype.paintVertexShape = function(c, x, y, w, h)
560{
561	c.translate(x, y);
562	this.background(c, 0, 0, w, h);
563	c.setShadow(false);
564};
565
566mxArchiMate3Component.prototype.background = function(c, x, y, w, h)
567{
568	c.rect(w * 0.25, 0, w * 0.75, h);
569	c.fillAndStroke();
570
571	c.rect(0, h * 0.25, w * 0.5, h * 0.15);
572	c.fillAndStroke();
573
574	c.rect(0, h * 0.6, w * 0.5, h * 0.15);
575	c.fillAndStroke();
576};
577
578mxCellRenderer.registerShape(mxArchiMate3Component.prototype.cst.COMPONENT, mxArchiMate3Component);
579
580mxArchiMate3Component.prototype.getConstraints = function(style, w, h)
581{
582	var constr = [];
583
584	constr.push(new mxConnectionConstraint(new mxPoint(0.625, 0), false));
585	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
586	constr.push(new mxConnectionConstraint(new mxPoint(0.625, 1), false));
587	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.325), false));
588	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.675), false));
589	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
590	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
591	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
592	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
593
594	return (constr);
595};
596
597//**********************************************************************************************************************************************************
598//Collaboration
599//**********************************************************************************************************************************************************
600/**
601* Extends mxShape.
602*/
603function mxArchiMate3Collaboration(bounds, fill, stroke, strokewidth)
604{
605	mxShape.call(this);
606	this.bounds = bounds;
607	this.fill = fill;
608	this.stroke = stroke;
609	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
610};
611
612/**
613* Extends mxShape.
614*/
615mxUtils.extend(mxArchiMate3Collaboration, mxShape);
616
617mxArchiMate3Collaboration.prototype.cst = {
618		COLLABORATION : 'mxgraph.archimate3.collaboration'
619};
620
621/**
622* Function: paintVertexShape
623*
624* Paints the vertex shape.
625*/
626mxArchiMate3Collaboration.prototype.paintVertexShape = function(c, x, y, w, h)
627{
628	c.translate(x, y);
629	this.background(c, 0, 0, w, h);
630	c.setShadow(false);
631};
632
633mxArchiMate3Collaboration.prototype.background = function(c, x, y, w, h)
634{
635	c.ellipse(0, 0, w * 0.6, h);
636	c.fillAndStroke();
637	c.ellipse(w * 0.4, 0, w * 0.6, h);
638	c.fillAndStroke();
639};
640
641mxCellRenderer.registerShape(mxArchiMate3Collaboration.prototype.cst.COLLABORATION, mxArchiMate3Collaboration);
642
643mxArchiMate3Collaboration.prototype.getConstraints = function(style, w, h)
644{
645	var constr = [];
646
647	constr.push(new mxConnectionConstraint(new mxPoint(0.11, 0.11), false));
648	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.125), false));
649	constr.push(new mxConnectionConstraint(new mxPoint(0.89, 0.11), false));
650	constr.push(new mxConnectionConstraint(new mxPoint(0.11, 0.89), false));
651	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.875), false));
652	constr.push(new mxConnectionConstraint(new mxPoint(0.89, 0.89), false));
653	constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0), false));
654	constr.push(new mxConnectionConstraint(new mxPoint(0.7, 0), false));
655	constr.push(new mxConnectionConstraint(new mxPoint(0.3, 1), false));
656	constr.push(new mxConnectionConstraint(new mxPoint(0.7, 1), false));
657	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
658	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
659
660	return (constr);
661};
662
663//**********************************************************************************************************************************************************
664//Interface
665//**********************************************************************************************************************************************************
666/**
667* Extends mxShape.
668*/
669function mxArchiMate3Interface(bounds, fill, stroke, strokewidth)
670{
671	mxShape.call(this);
672	this.bounds = bounds;
673	this.fill = fill;
674	this.stroke = stroke;
675	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
676};
677
678/**
679* Extends mxShape.
680*/
681mxUtils.extend(mxArchiMate3Interface, mxShape);
682
683mxArchiMate3Interface.prototype.cst = {
684		INTERFACE : 'mxgraph.archimate3.interface'
685};
686
687/**
688* Function: paintVertexShape
689*
690* Paints the vertex shape.
691*/
692mxArchiMate3Interface.prototype.paintVertexShape = function(c, x, y, w, h)
693{
694	c.translate(x, y);
695	this.background(c, 0, 0, w, h);
696	c.setShadow(false);
697};
698
699mxArchiMate3Interface.prototype.background = function(c, x, y, w, h)
700{
701	c.ellipse(w * 0.5, 0, w * 0.5, h);
702	c.fillAndStroke();
703
704	c.begin();
705	c.moveTo(0, h * 0.5);
706	c.lineTo(w * 0.5, h * 0.5);
707	c.stroke();
708};
709
710mxCellRenderer.registerShape(mxArchiMate3Interface.prototype.cst.INTERFACE, mxArchiMate3Interface);
711
712mxArchiMate3Interface.prototype.getConstraints = function(style, w, h)
713{
714	var constr = [];
715
716	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
717	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
718	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
719	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
720
721	return (constr);
722};
723
724//**********************************************************************************************************************************************************
725//Process
726//**********************************************************************************************************************************************************
727/**
728* Extends mxShape.
729*/
730function mxArchiMate3Process(bounds, fill, stroke, strokewidth)
731{
732	mxShape.call(this);
733	this.bounds = bounds;
734	this.fill = fill;
735	this.stroke = stroke;
736	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
737};
738
739/**
740* Extends mxShape.
741*/
742mxUtils.extend(mxArchiMate3Process, mxShape);
743
744mxArchiMate3Process.prototype.cst = {
745		PROCESS : 'mxgraph.archimate3.process'
746};
747
748/**
749* Function: paintVertexShape
750*
751* Paints the vertex shape.
752*/
753mxArchiMate3Process.prototype.paintVertexShape = function(c, x, y, w, h)
754{
755	c.translate(x, y);
756	this.background(c, 0, 0, w, h);
757	c.setShadow(false);
758};
759
760mxArchiMate3Process.prototype.background = function(c, x, y, w, h)
761{
762	c.begin();
763	c.moveTo(0, h * 0.3);
764	c.lineTo(w * 0.6, h * 0.3);
765	c.lineTo(w * 0.6, 0);
766	c.lineTo(w, h * 0.5);
767	c.lineTo(w * 0.6, h);
768	c.lineTo(w * 0.6, h * 0.7);
769	c.lineTo(0, h * 0.7);
770	c.close();
771	c.fillAndStroke();
772};
773
774mxCellRenderer.registerShape(mxArchiMate3Process.prototype.cst.PROCESS, mxArchiMate3Process);
775
776mxArchiMate3Process.prototype.getConstraints = function(style, w, h)
777{
778	var constr = [];
779
780	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
781	constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
782	constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
783	constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
784	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
785	constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
786	constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
787	constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
788	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
789	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
790
791	return (constr);
792};
793
794//**********************************************************************************************************************************************************
795//Function
796//**********************************************************************************************************************************************************
797/**
798* Extends mxShape.
799*/
800function mxArchiMate3Function(bounds, fill, stroke, strokewidth)
801{
802	mxShape.call(this);
803	this.bounds = bounds;
804	this.fill = fill;
805	this.stroke = stroke;
806	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
807};
808
809/**
810* Extends mxShape.
811*/
812mxUtils.extend(mxArchiMate3Function, mxShape);
813
814mxArchiMate3Function.prototype.cst = {
815		FUNCTION : 'mxgraph.archimate3.function'
816};
817
818/**
819* Function: paintVertexShape
820*
821* Paints the vertex shape.
822*/
823mxArchiMate3Function.prototype.paintVertexShape = function(c, x, y, w, h)
824{
825	c.translate(x, y);
826	this.background(c, 0, 0, w, h);
827	c.setShadow(false);
828};
829
830mxArchiMate3Function.prototype.background = function(c, x, y, w, h)
831{
832	c.begin();
833	c.moveTo(w * 0.5, 0);
834	c.lineTo(w, h * 0.2);
835	c.lineTo(w, h);
836	c.lineTo(w * 0.5, h * 0.8);
837	c.lineTo(0, h);
838	c.lineTo(0, h * 0.2);
839	c.close();
840	c.fillAndStroke();
841};
842
843mxCellRenderer.registerShape(mxArchiMate3Function.prototype.cst.FUNCTION, mxArchiMate3Function);
844
845mxArchiMate3Function.prototype.getConstraints = function(style, w, h)
846{
847	var constr = [];
848
849	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
850	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.2), false));
851	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.6), false));
852	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
853	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.8), false));
854	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
855	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.6), false));
856	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.2), false));
857
858	return (constr);
859};
860
861//**********************************************************************************************************************************************************
862//Interaction
863//**********************************************************************************************************************************************************
864/**
865* Extends mxShape.
866*/
867function mxArchiMate3Interaction(bounds, fill, stroke, strokewidth)
868{
869	mxShape.call(this);
870	this.bounds = bounds;
871	this.fill = fill;
872	this.stroke = stroke;
873	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
874};
875
876/**
877* Extends mxShape.
878*/
879mxUtils.extend(mxArchiMate3Interaction, mxShape);
880
881mxArchiMate3Interaction.prototype.cst = {
882		INTERACTION : 'mxgraph.archimate3.interaction'
883};
884
885/**
886* Function: paintVertexShape
887*
888* Paints the vertex shape.
889*/
890mxArchiMate3Interaction.prototype.paintVertexShape = function(c, x, y, w, h)
891{
892	c.translate(x, y);
893	this.background(c, 0, 0, w, h);
894	c.setShadow(false);
895};
896
897mxArchiMate3Interaction.prototype.background = function(c, x, y, w, h)
898{
899	c.begin();
900	c.moveTo(w * 0.55, 0);
901	c.arcTo(w * 0.45, h * 0.5, 0, 0, 1, w * 0.55, h);
902	c.close();
903	c.moveTo(w * 0.45, 0);
904	c.arcTo(w * 0.45, h * 0.5, 0, 0, 0, w * 0.45, h);
905	c.close();
906	c.fillAndStroke();
907};
908
909mxCellRenderer.registerShape(mxArchiMate3Interaction.prototype.cst.INTERACTION, mxArchiMate3Interaction);
910
911mxArchiMate3Interaction.prototype.getConstraints = function(style, w, h)
912{
913	var constr = [];
914
915	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
916	constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.14), false));
917	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
918	constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.86), false));
919	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
920	constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.86), false));
921	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
922	constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.14), false));
923
924	return (constr);
925};
926
927//**********************************************************************************************************************************************************
928//Service
929//**********************************************************************************************************************************************************
930/**
931* Extends mxShape.
932*/
933function mxArchiMate3Service(bounds, fill, stroke, strokewidth)
934{
935	mxShape.call(this);
936	this.bounds = bounds;
937	this.fill = fill;
938	this.stroke = stroke;
939	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
940};
941
942/**
943* Extends mxShape.
944*/
945mxUtils.extend(mxArchiMate3Service, mxShape);
946
947mxArchiMate3Service.prototype.cst = {
948		SERVICE : 'mxgraph.archimate3.service'
949};
950
951/**
952* Function: paintVertexShape
953*
954* Paints the vertex shape.
955*/
956mxArchiMate3Service.prototype.paintVertexShape = function(c, x, y, w, h)
957{
958	c.translate(x, y);
959	this.background(c, 0, 0, w, h);
960	c.setShadow(false);
961};
962
963mxArchiMate3Service.prototype.background = function(c, x, y, w, h)
964{
965	var w1 = Math.max(w - h * 0.5, w * 0.5);
966	var w2 = Math.min(h * 0.5, w * 0.5);
967
968	c.begin();
969	c.moveTo(w1, 0);
970	c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w1, h);
971	c.lineTo(w2, h);
972	c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w2, 0);
973	c.close();
974	c.fillAndStroke();
975};
976
977mxCellRenderer.registerShape(mxArchiMate3Service.prototype.cst.SERVICE, mxArchiMate3Service);
978
979mxArchiMate3Service.prototype.getConstraints = function(style, w, h)
980{
981	var constr = [];
982	var w1 = Math.max(w - h * 0.5, w * 0.5);
983	var w2 = Math.min(h * 0.5, w * 0.5);
984
985	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
986	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
987	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1, 0));
988	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1, h));
989	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2, h));
990	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2, 0));
991	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1 + h * 0.355, h * 0.145));
992	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1 + h * 0.5, h * 0.5));
993	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1 + h * 0.355, h * 0.855));
994	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2 - h * 0.355, h * 0.145));
995	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2 - h * 0.5, h * 0.5));
996	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2 - h * 0.355, h * 0.855));
997
998	return (constr);
999};
1000
1001//**********************************************************************************************************************************************************
1002//Requirement
1003//**********************************************************************************************************************************************************
1004/**
1005* Extends mxShape.
1006*/
1007function mxArchiMate3Requirement(bounds, fill, stroke, strokewidth)
1008{
1009	mxShape.call(this);
1010	this.bounds = bounds;
1011	this.fill = fill;
1012	this.stroke = stroke;
1013	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1014};
1015
1016/**
1017* Extends mxShape.
1018*/
1019mxUtils.extend(mxArchiMate3Requirement, mxShape);
1020
1021mxArchiMate3Requirement.prototype.cst = {
1022		REQUIREMENT : 'mxgraph.archimate3.requirement'
1023};
1024
1025/**
1026* Function: paintVertexShape
1027*
1028* Paints the vertex shape.
1029*/
1030mxArchiMate3Requirement.prototype.paintVertexShape = function(c, x, y, w, h)
1031{
1032	c.translate(x, y);
1033	this.background(c, 0, 0, w, h);
1034	c.setShadow(false);
1035};
1036
1037mxArchiMate3Requirement.prototype.background = function(c, x, y, w, h)
1038{
1039	c.begin();
1040	c.moveTo(w * 0.25, 0);
1041	c.lineTo(w, 0);
1042	c.lineTo(w * 0.75, h);
1043	c.lineTo(0, h);
1044	c.close();
1045	c.fillAndStroke();
1046};
1047
1048mxCellRenderer.registerShape(mxArchiMate3Requirement.prototype.cst.REQUIREMENT, mxArchiMate3Requirement);
1049
1050mxArchiMate3Requirement.prototype.getConstraints = function(style, w, h)
1051{
1052	var constr = [];
1053
1054	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
1055	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1056	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
1057	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
1058	constr.push(new mxConnectionConstraint(new mxPoint(0.9375, 0.25), false));
1059	constr.push(new mxConnectionConstraint(new mxPoint(0.875, 0.5), false));
1060	constr.push(new mxConnectionConstraint(new mxPoint(0.8125, 0.75), false));
1061	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
1062	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
1063	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
1064	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
1065	constr.push(new mxConnectionConstraint(new mxPoint(0.0625, 0.75), false));
1066	constr.push(new mxConnectionConstraint(new mxPoint(0.125, 0.5), false));
1067	constr.push(new mxConnectionConstraint(new mxPoint(0.1875, 0.25), false));
1068
1069	return (constr);
1070};
1071
1072//**********************************************************************************************************************************************************
1073//Constraint
1074//**********************************************************************************************************************************************************
1075/**
1076* Extends mxShape.
1077*/
1078function mxArchiMate3Constraint(bounds, fill, stroke, strokewidth)
1079{
1080	mxShape.call(this);
1081	this.bounds = bounds;
1082	this.fill = fill;
1083	this.stroke = stroke;
1084	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1085};
1086
1087/**
1088* Extends mxShape.
1089*/
1090mxUtils.extend(mxArchiMate3Constraint, mxShape);
1091
1092mxArchiMate3Constraint.prototype.cst = {
1093		CONSTRAINT : 'mxgraph.archimate3.constraint'
1094};
1095
1096/**
1097* Function: paintVertexShape
1098*
1099* Paints the vertex shape.
1100*/
1101mxArchiMate3Constraint.prototype.paintVertexShape = function(c, x, y, w, h)
1102{
1103	c.translate(x, y);
1104	this.background(c, 0, 0, w, h);
1105	c.setShadow(false);
1106};
1107
1108mxArchiMate3Constraint.prototype.background = function(c, x, y, w, h)
1109{
1110	c.begin();
1111	c.moveTo(w * 0.25, 0);
1112	c.lineTo(w, 0);
1113	c.lineTo(w * 0.75, h);
1114	c.lineTo(0, h);
1115	c.close();
1116	c.moveTo(w * 0.45, 0);
1117	c.lineTo(w * 0.2, h);
1118	c.fillAndStroke();
1119};
1120
1121mxCellRenderer.registerShape(mxArchiMate3Constraint.prototype.cst.CONSTRAINT, mxArchiMate3Constraint);
1122
1123mxArchiMate3Constraint.prototype.getConstraints = function(style, w, h)
1124{
1125	var constr = [];
1126
1127	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
1128	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1129	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
1130	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
1131	constr.push(new mxConnectionConstraint(new mxPoint(0.9375, 0.25), false));
1132	constr.push(new mxConnectionConstraint(new mxPoint(0.875, 0.5), false));
1133	constr.push(new mxConnectionConstraint(new mxPoint(0.8125, 0.75), false));
1134	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
1135	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
1136	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
1137	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
1138	constr.push(new mxConnectionConstraint(new mxPoint(0.0625, 0.75), false));
1139	constr.push(new mxConnectionConstraint(new mxPoint(0.125, 0.5), false));
1140	constr.push(new mxConnectionConstraint(new mxPoint(0.1875, 0.25), false));
1141
1142	return (constr);
1143};
1144
1145//**********************************************************************************************************************************************************
1146//Event
1147//**********************************************************************************************************************************************************
1148/**
1149* Extends mxShape.
1150*/
1151function mxArchiMate3Event(bounds, fill, stroke, strokewidth)
1152{
1153	mxShape.call(this);
1154	this.bounds = bounds;
1155	this.fill = fill;
1156	this.stroke = stroke;
1157	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1158};
1159
1160/**
1161* Extends mxShape.
1162*/
1163mxUtils.extend(mxArchiMate3Event, mxShape);
1164
1165mxArchiMate3Event.prototype.cst = {
1166		EVENT : 'mxgraph.archimate3.event'
1167};
1168
1169/**
1170* Function: paintVertexShape
1171*
1172* Paints the vertex shape.
1173*/
1174mxArchiMate3Event.prototype.paintVertexShape = function(c, x, y, w, h)
1175{
1176	c.translate(x, y);
1177	this.background(c, 0, 0, w, h);
1178	c.setShadow(false);
1179};
1180
1181mxArchiMate3Event.prototype.background = function(c, x, y, w, h)
1182{
1183	c.begin();
1184	c.moveTo(w - h * 0.5, 0);
1185	c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w - h * 0.5, h);
1186	c.lineTo(0, h);
1187	c.lineTo(h * 0.5, h * 0.5);
1188	c.lineTo(0, 0);
1189	c.close();
1190	c.fillAndStroke();
1191};
1192
1193mxCellRenderer.registerShape(mxArchiMate3Event.prototype.cst.EVENT, mxArchiMate3Event);
1194
1195mxArchiMate3Event.prototype.getConstraints = function(style, w, h)
1196{
1197	var constr = [];
1198	var w1 = Math.max(w - h * 0.5, w * 0.5);
1199	var w2 = Math.min(h * 0.5, w * 0.5);
1200
1201	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - h * 0.5, 0));
1202	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - h * 0.5, h));
1203	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h));
1204	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, h * 0.5, h * 0.5));
1205	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
1206	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
1207	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - h * 0.5) * 0.5, 0));
1208	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - h * 0.5) * 0.5, h));
1209
1210	return (constr);
1211};
1212
1213//**********************************************************************************************************************************************************
1214//Event 2
1215//**********************************************************************************************************************************************************
1216/**
1217* Extends mxShape.
1218*/
1219function mxArchiMate3Event2(bounds, fill, stroke, strokewidth)
1220{
1221	mxShape.call(this);
1222	this.bounds = bounds;
1223	this.fill = fill;
1224	this.stroke = stroke;
1225	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1226};
1227
1228/**
1229* Extends mxShape.
1230*/
1231mxUtils.extend(mxArchiMate3Event2, mxShape);
1232
1233mxArchiMate3Event2.prototype.cst = {
1234		EVENT2 : 'mxgraph.archimate3.event2'
1235};
1236
1237/**
1238* Function: paintVertexShape
1239*
1240* Paints the vertex shape.
1241*/
1242mxArchiMate3Event2.prototype.paintVertexShape = function(c, x, y, w, h)
1243{
1244	c.translate(x, y);
1245	this.background(c, 0, 0, w, h);
1246	c.setShadow(false);
1247};
1248
1249mxArchiMate3Event2.prototype.background = function(c, x, y, w, h)
1250{
1251	c.begin();
1252	c.moveTo(w - h * 0.5, 0);
1253	c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w - h * 0.5, h);
1254	c.lineTo(0, h);
1255	c.arcTo(h * 0.5, h * 0.5, 0, 0, 0, 0, 0);
1256	c.close();
1257	c.fillAndStroke();
1258};
1259
1260mxCellRenderer.registerShape(mxArchiMate3Event2.prototype.cst.EVENT2, mxArchiMate3Event2);
1261
1262//**********************************************************************************************************************************************************
1263//Actor
1264//**********************************************************************************************************************************************************
1265/**
1266* Extends mxShape.
1267*/
1268function mxArchiMate3Actor(bounds, fill, stroke, strokewidth)
1269{
1270	mxShape.call(this);
1271	this.bounds = bounds;
1272	this.fill = fill;
1273	this.stroke = stroke;
1274	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1275};
1276
1277/**
1278* Extends mxShape.
1279*/
1280mxUtils.extend(mxArchiMate3Actor, mxShape);
1281
1282mxArchiMate3Actor.prototype.cst = {
1283		ACTOR : 'mxgraph.archimate3.actor'
1284};
1285
1286/**
1287* Function: paintVertexShape
1288*
1289* Paints the vertex shape.
1290*/
1291mxArchiMate3Actor.prototype.paintVertexShape = function(c, x, y, w, h)
1292{
1293	c.translate(x, y);
1294	this.background(c, 0, 0, w, h);
1295	c.setShadow(false);
1296};
1297
1298mxArchiMate3Actor.prototype.background = function(c, x, y, w, h)
1299{
1300	c.ellipse(w * 0.2, 0, w * 0.6, h * 0.3);
1301	c.fillAndStroke();
1302
1303	c.begin();
1304	c.moveTo(w * 0.5, h * 0.3);
1305	c.lineTo(w * 0.5, h * 0.75);
1306	c.moveTo(0, h * 0.45);
1307	c.lineTo(w, h * 0.45);
1308	c.moveTo(0, h);
1309	c.lineTo(w * 0.5, h * 0.75);
1310	c.lineTo(w, h);
1311	c.stroke();
1312};
1313
1314mxCellRenderer.registerShape(mxArchiMate3Actor.prototype.cst.ACTOR, mxArchiMate3Actor);
1315
1316mxArchiMate3Actor.prototype.getConstraints = function(style, w, h)
1317{
1318	var constr = [];
1319
1320	constr.push(new mxConnectionConstraint(new mxPoint(0.2, 0.15), false));
1321	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1322	constr.push(new mxConnectionConstraint(new mxPoint(0.8, 0.15), false));
1323	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.45), false));
1324	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.45), false));
1325	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
1326	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
1327
1328	return (constr);
1329};
1330
1331//**********************************************************************************************************************************************************
1332//Role
1333//**********************************************************************************************************************************************************
1334/**
1335* Extends mxShape.
1336*/
1337function mxArchiMate3Role(bounds, fill, stroke, strokewidth)
1338{
1339	mxShape.call(this);
1340	this.bounds = bounds;
1341	this.fill = fill;
1342	this.stroke = stroke;
1343	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1344};
1345
1346/**
1347* Extends mxShape.
1348*/
1349mxUtils.extend(mxArchiMate3Role, mxShape);
1350
1351mxArchiMate3Role.prototype.cst = {
1352		ROLE : 'mxgraph.archimate3.role'
1353};
1354
1355/**
1356* Function: paintVertexShape
1357*
1358* Paints the vertex shape.
1359*/
1360mxArchiMate3Role.prototype.paintVertexShape = function(c, x, y, w, h)
1361{
1362	c.translate(x, y);
1363	this.background(c, 0, 0, w, h);
1364	c.setShadow(false);
1365};
1366
1367mxArchiMate3Role.prototype.background = function(c, x, y, w, h)
1368{
1369	c.begin();
1370	c.moveTo(w * 0.8, 0);
1371	c.lineTo(w * 0.2, 0);
1372	c.arcTo(w * 0.2, h * 0.5, 0, 0, 0, w * 0.2, h);
1373	c.lineTo(w * 0.8, h);
1374	c.fillAndStroke();
1375
1376	c.ellipse(w * 0.6, 0, w * 0.4, h);
1377	c.fillAndStroke();
1378};
1379
1380mxCellRenderer.registerShape(mxArchiMate3Role.prototype.cst.ROLE, mxArchiMate3Role);
1381
1382mxArchiMate3Role.prototype.getConstraints = function(style, w, h)
1383{
1384	var constr = [];
1385
1386	constr.push(new mxConnectionConstraint(new mxPoint(0.2, 0), false));
1387	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1388	constr.push(new mxConnectionConstraint(new mxPoint(0.8, 0), false));
1389	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
1390	constr.push(new mxConnectionConstraint(new mxPoint(0.8, 1), false));
1391	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
1392	constr.push(new mxConnectionConstraint(new mxPoint(0.2, 1), false));
1393	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
1394
1395	return (constr);
1396};
1397
1398//**********************************************************************************************************************************************************
1399//Business Object
1400//**********************************************************************************************************************************************************
1401/**
1402* Extends mxShape.
1403*/
1404function mxArchiMate3BusinessObject(bounds, fill, stroke, strokewidth)
1405{
1406	mxShape.call(this);
1407	this.bounds = bounds;
1408	this.fill = fill;
1409	this.stroke = stroke;
1410	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1411};
1412
1413/**
1414* Extends mxShape.
1415*/
1416mxUtils.extend(mxArchiMate3BusinessObject, mxShape);
1417
1418mxArchiMate3BusinessObject.prototype.cst = {
1419		BUSINESS_OBJECT : 'mxgraph.archimate3.businessObject'
1420};
1421
1422/**
1423* Function: paintVertexShape
1424*
1425* Paints the vertex shape.
1426*/
1427mxArchiMate3BusinessObject.prototype.paintVertexShape = function(c, x, y, w, h)
1428{
1429	c.translate(x, y);
1430	this.background(c, 0, 0, w, h);
1431	c.setShadow(false);
1432	this.foreground(c, 0, 0, w, h);
1433};
1434
1435mxArchiMate3BusinessObject.prototype.background = function(c, x, y, w, h)
1436{
1437	c.rect(0, 0, w, h);
1438	c.fillAndStroke();
1439};
1440
1441mxArchiMate3BusinessObject.prototype.foreground = function(c, x, y, w, h)
1442{
1443	if (h >= 15)
1444	{
1445		c.begin();
1446		c.moveTo(0, 15);
1447		c.lineTo(w, 15);
1448		c.stroke();
1449	}
1450};
1451
1452mxCellRenderer.registerShape(mxArchiMate3BusinessObject.prototype.cst.BUSINESS_OBJECT, mxArchiMate3BusinessObject);
1453
1454mxArchiMate3BusinessObject.prototype.getConstraints = function(style, w, h)
1455{
1456	var constr = [];
1457
1458	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
1459	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
1460	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1461	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
1462	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
1463	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
1464	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
1465	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
1466	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
1467	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
1468	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
1469	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
1470	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
1471	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
1472	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
1473	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
1474
1475	return (constr);
1476};
1477
1478//**********************************************************************************************************************************************************
1479//Contract
1480//**********************************************************************************************************************************************************
1481/**
1482* Extends mxShape.
1483*/
1484function mxArchiMate3Contract(bounds, fill, stroke, strokewidth)
1485{
1486	mxShape.call(this);
1487	this.bounds = bounds;
1488	this.fill = fill;
1489	this.stroke = stroke;
1490	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1491};
1492
1493/**
1494* Extends mxShape.
1495*/
1496mxUtils.extend(mxArchiMate3Contract, mxShape);
1497
1498mxArchiMate3Contract.prototype.cst = {
1499		CONTRACT : 'mxgraph.archimate3.contract'
1500};
1501
1502/**
1503* Function: paintVertexShape
1504*
1505* Paints the vertex shape.
1506*/
1507mxArchiMate3Contract.prototype.paintVertexShape = function(c, x, y, w, h)
1508{
1509	c.translate(x, y);
1510	this.background(c, 0, 0, w, h);
1511	c.setShadow(false);
1512	this.foreground(c, 0, 0, w, h);
1513};
1514
1515mxArchiMate3Contract.prototype.background = function(c, x, y, w, h)
1516{
1517	c.rect(0, 0, w, h);
1518	c.fillAndStroke();
1519};
1520
1521mxArchiMate3Contract.prototype.foreground = function(c, x, y, w, h)
1522{
1523	if (h >= 15)
1524	{
1525		c.begin();
1526		c.moveTo(0, 15);
1527		c.lineTo(w, 15);
1528		c.stroke();
1529	}
1530
1531	if (h >= 30)
1532	{
1533		c.begin();
1534		c.moveTo(0, h - 15);
1535		c.lineTo(w,  h - 15);
1536		c.stroke();
1537	}
1538
1539};
1540
1541mxCellRenderer.registerShape(mxArchiMate3Contract.prototype.cst.CONTRACT, mxArchiMate3Contract);
1542
1543mxArchiMate3Contract.prototype.getConstraints = function(style, w, h)
1544{
1545	var constr = [];
1546
1547	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
1548	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
1549	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1550	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
1551	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
1552	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
1553	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
1554	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
1555	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
1556	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
1557	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
1558	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
1559	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
1560	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
1561	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
1562	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
1563
1564	return (constr);
1565};
1566
1567//**********************************************************************************************************************************************************
1568//Product
1569//**********************************************************************************************************************************************************
1570/**
1571* Extends mxShape.
1572*/
1573function mxArchiMate3Product(bounds, fill, stroke, strokewidth)
1574{
1575	mxShape.call(this);
1576	this.bounds = bounds;
1577	this.fill = fill;
1578	this.stroke = stroke;
1579	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1580};
1581
1582/**
1583* Extends mxShape.
1584*/
1585mxUtils.extend(mxArchiMate3Product, mxShape);
1586
1587mxArchiMate3Product.prototype.cst = {
1588		PRODUCT : 'mxgraph.archimate3.product'
1589};
1590
1591/**
1592* Function: paintVertexShape
1593*
1594* Paints the vertex shape.
1595*/
1596mxArchiMate3Product.prototype.paintVertexShape = function(c, x, y, w, h)
1597{
1598	c.translate(x, y);
1599	this.background(c, 0, 0, w, h);
1600	c.setShadow(false);
1601	this.foreground(c, 0, 0, w, h);
1602};
1603
1604mxArchiMate3Product.prototype.background = function(c, x, y, w, h)
1605{
1606	c.rect(0, 0, w, h);
1607	c.fillAndStroke();
1608};
1609
1610mxArchiMate3Product.prototype.foreground = function(c, x, y, w, h)
1611{
1612	if (h >= 15)
1613	{
1614		c.begin();
1615		c.moveTo(0, 15);
1616		c.lineTo(w * 0.6, 15);
1617		c.lineTo(w * 0.6, 0);
1618		c.stroke();
1619	}
1620};
1621
1622mxCellRenderer.registerShape(mxArchiMate3Product.prototype.cst.PRODUCT, mxArchiMate3Product);
1623
1624mxArchiMate3Product.prototype.getConstraints = function(style, w, h)
1625{
1626	var constr = [];
1627
1628	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
1629	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
1630	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1631	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
1632	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
1633	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
1634	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
1635	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
1636	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
1637	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
1638	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
1639	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
1640	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
1641	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
1642	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
1643	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
1644
1645	return (constr);
1646};
1647
1648//**********************************************************************************************************************************************************
1649//Representation
1650//**********************************************************************************************************************************************************
1651/**
1652* Extends mxShape.
1653*/
1654function mxArchiMate3Representation(bounds, fill, stroke, strokewidth)
1655{
1656	mxShape.call(this);
1657	this.bounds = bounds;
1658	this.fill = fill;
1659	this.stroke = stroke;
1660	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1661};
1662
1663/**
1664* Extends mxShape.
1665*/
1666mxUtils.extend(mxArchiMate3Representation, mxShape);
1667
1668mxArchiMate3Representation.prototype.cst = {
1669		REPRESENTATION : 'mxgraph.archimate3.representation'
1670};
1671
1672/**
1673* Function: paintVertexShape
1674*
1675* Paints the vertex shape.
1676*/
1677mxArchiMate3Representation.prototype.paintVertexShape = function(c, x, y, w, h)
1678{
1679	c.translate(x, y);
1680	this.background(c, 0, 0, w, h);
1681};
1682
1683mxArchiMate3Representation.prototype.background = function(c, x, y, w, h)
1684{
1685	c.begin();
1686	c.moveTo(0, 0);
1687	c.lineTo(w, 0);
1688	c.lineTo(w, h * 0.85);
1689	c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
1690	c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
1691	c.close();
1692	c.fillAndStroke();
1693
1694	if (h >= 20)
1695	c.begin();
1696	c.moveTo(0, 15);
1697	c.lineTo(w, 15);
1698	c.stroke();
1699};
1700
1701mxCellRenderer.registerShape(mxArchiMate3Representation.prototype.cst.REPRESENTATION, mxArchiMate3Representation);
1702
1703mxArchiMate3Representation.prototype.getConstraints = function(style, w, h)
1704{
1705	var constr = [];
1706
1707	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
1708	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
1709	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1710	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
1711	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
1712	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
1713	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
1714	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
1715	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.85), false));
1716	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0.745), false));
1717	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.85), false));
1718	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0.955), false));
1719	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.85), false));
1720	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
1721	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
1722	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
1723
1724	return (constr);
1725};
1726
1727//**********************************************************************************************************************************************************
1728//Deliverable
1729//**********************************************************************************************************************************************************
1730/**
1731* Extends mxShape.
1732*/
1733function mxArchiMate3Deliverable(bounds, fill, stroke, strokewidth)
1734{
1735	mxShape.call(this);
1736	this.bounds = bounds;
1737	this.fill = fill;
1738	this.stroke = stroke;
1739	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1740};
1741
1742/**
1743* Extends mxShape.
1744*/
1745mxUtils.extend(mxArchiMate3Deliverable, mxShape);
1746
1747mxArchiMate3Deliverable.prototype.cst = {
1748		DELIVERABLE : 'mxgraph.archimate3.deliverable'
1749};
1750
1751/**
1752* Function: paintVertexShape
1753*
1754* Paints the vertex shape.
1755*/
1756mxArchiMate3Deliverable.prototype.paintVertexShape = function(c, x, y, w, h)
1757{
1758	c.translate(x, y);
1759	this.background(c, 0, 0, w, h);
1760};
1761
1762mxArchiMate3Deliverable.prototype.background = function(c, x, y, w, h)
1763{
1764	c.begin();
1765	c.moveTo(0, 0);
1766	c.lineTo(w, 0);
1767	c.lineTo(w, h * 0.85);
1768	c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
1769	c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
1770	c.close();
1771	c.fillAndStroke();
1772};
1773
1774mxCellRenderer.registerShape(mxArchiMate3Deliverable.prototype.cst.DELIVERABLE, mxArchiMate3Deliverable);
1775
1776mxArchiMate3Deliverable.prototype.getConstraints = function(style, w, h)
1777{
1778	var constr = [];
1779
1780	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
1781	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
1782	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1783	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
1784	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
1785	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
1786	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
1787	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
1788	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.85), false));
1789	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0.745), false));
1790	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.85), false));
1791	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0.955), false));
1792	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.85), false));
1793	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
1794	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
1795	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
1796
1797	return (constr);
1798};
1799
1800//**********************************************************************************************************************************************************
1801//Location
1802//**********************************************************************************************************************************************************
1803/**
1804* Extends mxShape.
1805*/
1806function mxArchiMate3Location(bounds, fill, stroke, strokewidth)
1807{
1808	mxShape.call(this);
1809	this.bounds = bounds;
1810	this.fill = fill;
1811	this.stroke = stroke;
1812	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1813};
1814
1815/**
1816* Extends mxShape.
1817*/
1818mxUtils.extend(mxArchiMate3Location, mxShape);
1819
1820mxArchiMate3Location.prototype.cst = {
1821		LOCATION : 'mxgraph.archimate3.location'
1822};
1823
1824/**
1825* Function: paintVertexShape
1826*
1827* Paints the vertex shape.
1828*/
1829mxArchiMate3Location.prototype.paintVertexShape = function(c, x, y, w, h)
1830{
1831	c.translate(x, y);
1832	this.background(c, 0, 0, w, h);
1833	c.setShadow(false);
1834	c.translate(w - 20, 5);
1835	this.foreground(c, w - 20, 5, 15, 15);
1836};
1837
1838mxArchiMate3Location.prototype.background = function(c, x, y, w, h)
1839{
1840	c.rect(0, 0, w, h);
1841	c.fillAndStroke();
1842};
1843
1844mxArchiMate3Location.prototype.foreground = function(c, x, y, w, h)
1845{
1846	c.setDashed(false);
1847
1848	c.translate(3 ,0);
1849	w = w - 6;
1850	c.begin();
1851	c.moveTo(w * 0.5, h);
1852	c.arcTo(w * 0.1775, h * 0.3, 0, 0, 0, w * 0.345, h * 0.7);
1853	c.arcTo(w * 0.538, h * 0.364, 0, 0, 1, w * 0.5, 0);
1854	c.arcTo(w * 0.538, h * 0.364, 0, 0, 1, w * 0.655, h * 0.7);
1855	c.arcTo(w * 0.1775, h * 0.3, 0, 0, 0, w * 0.5, h);
1856	c.stroke();
1857};
1858
1859mxCellRenderer.registerShape(mxArchiMate3Location.prototype.cst.LOCATION, mxArchiMate3Location);
1860
1861//**********************************************************************************************************************************************************
1862//Gap
1863//**********************************************************************************************************************************************************
1864/**
1865* Extends mxShape.
1866*/
1867function mxArchiMate3Gap(bounds, fill, stroke, strokewidth)
1868{
1869	mxShape.call(this);
1870	this.bounds = bounds;
1871	this.fill = fill;
1872	this.stroke = stroke;
1873	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1874};
1875
1876/**
1877* Extends mxShape.
1878*/
1879mxUtils.extend(mxArchiMate3Gap, mxShape);
1880
1881mxArchiMate3Gap.prototype.cst = {
1882		GAP : 'mxgraph.archimate3.gap'
1883};
1884
1885/**
1886* Function: paintVertexShape
1887*
1888* Paints the vertex shape.
1889*/
1890mxArchiMate3Gap.prototype.paintVertexShape = function(c, x, y, w, h)
1891{
1892	c.translate(x, y);
1893	this.background(c, 0, 0, w, h);
1894	c.setShadow(false);
1895	c.translate(w - 20, 5);
1896	this.foreground(c, w - 20, 5, 15, 15);
1897};
1898
1899mxArchiMate3Gap.prototype.background = function(c, x, y, w, h)
1900{
1901	c.begin();
1902	c.moveTo(0, 0);
1903	c.lineTo(w, 0);
1904	c.lineTo(w, h * 0.85);
1905	c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
1906	c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
1907	c.close();
1908	c.fillAndStroke();
1909};
1910
1911mxArchiMate3Gap.prototype.foreground = function(c, x, y, w, h)
1912{
1913	c.setDashed(false);
1914
1915	c.translate(0, 2);
1916	h = h - 4;
1917
1918	c.ellipse(w * 0.15, 0, w * 0.7, h);
1919	c.stroke();
1920
1921	c.begin();
1922	c.moveTo(0, h * 0.35);
1923	c.lineTo(w, h * 0.35);
1924	c.moveTo(0, h * 0.65);
1925	c.lineTo(w, h * 0.65);
1926	c.stroke();
1927};
1928
1929mxCellRenderer.registerShape(mxArchiMate3Gap.prototype.cst.GAP, mxArchiMate3Gap);
1930
1931mxArchiMate3Gap.prototype.getConstraints = function(style, w, h)
1932{
1933	var constr = [];
1934
1935	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
1936	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
1937	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
1938	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
1939	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
1940	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
1941	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
1942	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
1943	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.85), false));
1944	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0.745), false));
1945	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.85), false));
1946	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0.955), false));
1947	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.85), false));
1948	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
1949	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
1950	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
1951
1952	return (constr);
1953};
1954
1955//**********************************************************************************************************************************************************
1956//Tech
1957//**********************************************************************************************************************************************************
1958/**
1959* Extends mxShape.
1960*/
1961function mxArchiMate3Tech(bounds, fill, stroke, strokewidth)
1962{
1963	mxShape.call(this);
1964	this.bounds = bounds;
1965	this.fill = fill;
1966	this.stroke = stroke;
1967	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
1968};
1969
1970/**
1971* Extends mxShape.
1972*/
1973mxUtils.extend(mxArchiMate3Tech, mxShape);
1974
1975mxArchiMate3Tech.prototype.cst = {
1976		TECH : 'mxgraph.archimate3.tech',
1977		TYPE : 'techType',
1978		DEVICE : 'device',
1979		PLATEAU : 'plateau',
1980		FACILITY : 'facility',
1981		EQUIPMENT : 'equipment',
1982		SYS_SW : 'sysSw'
1983};
1984
1985/**
1986* Function: paintVertexShape
1987*
1988* Paints the vertex shape.
1989*/
1990mxArchiMate3Tech.prototype.paintVertexShape = function(c, x, y, w, h)
1991{
1992	c.translate(x, y);
1993	this.background(c, 0, 0, w, h);
1994	c.setShadow(false);
1995	c.translate(w - 30, 15);
1996	this.foreground(c, w - 30, 15, 15, 15);
1997};
1998
1999mxArchiMate3Tech.prototype.background = function(c, x, y, w, h)
2000{
2001	c.begin();
2002	c.moveTo(0, 10);
2003	c.lineTo(10, 0);
2004	c.lineTo(w, 0);
2005	c.lineTo(w, h - 10);
2006	c.lineTo(w - 10, h);
2007	c.lineTo(0, h);
2008	c.close();
2009	c.moveTo(0, 10);
2010	c.lineTo(w - 10, 10);
2011	c.lineTo(w - 10, h);
2012	c.moveTo(w, 0);
2013	c.lineTo(w - 10, 10);
2014	c.fillAndStroke();
2015};
2016
2017mxArchiMate3Tech.prototype.foreground = function(c, x, y, w, h)
2018{
2019	var type = mxUtils.getValue(this.style, mxArchiMate3Tech.prototype.cst.TYPE, mxArchiMate3Tech.prototype.cst.DEVICE);
2020
2021	c.setDashed(false);
2022
2023	if (type === mxArchiMate3Tech.prototype.cst.PLATEAU)
2024	{
2025		var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
2026		c.setFillColor(strokeColor);
2027
2028		c.rect(w * 0.4, 0, w * 0.6, h * 0.2);
2029		c.fill();
2030
2031		c.rect(w * 0.2, h * 0.4, w * 0.6, h * 0.2);
2032		c.fill();
2033
2034		c.rect(0, h * 0.8, w * 0.6, h * 0.2);
2035		c.fill();
2036	}
2037	else if (type === mxArchiMate3Tech.prototype.cst.FACILITY)
2038	{
2039		c.begin();
2040		c.moveTo(0, h);
2041		c.lineTo(0, 0);
2042		c.lineTo(w * 0.13, 0);
2043		c.lineTo(w * 0.13, h * 0.7);
2044		c.lineTo(w * 0.42, h * 0.55);
2045		c.lineTo(w * 0.42, h * 0.7);
2046		c.lineTo(w * 0.71, h * 0.55);
2047		c.lineTo(w * 0.71, h * 0.7);
2048		c.lineTo(w, h * 0.55);
2049		c.lineTo(w, h);
2050		c.close();
2051		c.stroke();
2052	}
2053	else if (type === mxArchiMate3Tech.prototype.cst.EQUIPMENT)
2054	{
2055		c.begin();
2056		c.moveTo(w * 0.72, h * 0.38);
2057		c.curveTo(w * 0.78, w * 0.38, w * 0.85, h * 0.34, w * 0.85, h * 0.26);
2058		c.curveTo(w * 0.85, w * 0.18, w * 0.78, h * 0.14, w * 0.73, h * 0.14);
2059		c.curveTo(w * 0.64, w * 0.14, w * 0.59, h * 0.2, w * 0.59, h * 0.26);
2060		c.curveTo(w * 0.59, h * 0.33, w * 0.65, w * 0.38, w * 0.72, h * 0.38);
2061		c.close();
2062		c.moveTo(w * 0.68, h * 0.52);
2063		c.lineTo(w * 0.67, h * 0.45);
2064		c.lineTo(w * 0.61, h * 0.43);
2065		c.lineTo(w * 0.56, h * 0.48);
2066		c.lineTo(w * 0.5, h * 0.42);
2067		c.lineTo(w * 0.54, h * 0.36);
2068		c.lineTo(w * 0.52, h * 0.31);
2069		c.lineTo(w * 0.45, h * 0.31);
2070		c.lineTo(w * 0.45, h * 0.22);
2071		c.lineTo(w * 0.52, h * 0.21);
2072		c.lineTo(w * 0.54, h * 0.16);
2073		c.lineTo(w * 0.5, h * 0.11);
2074		c.lineTo(w * 0.56, h * 0.05);
2075		c.lineTo(w * 0.62, h * 0.09);
2076		c.lineTo(w * 0.67, h * 0.07);
2077		c.lineTo(w * 0.68, 0);
2078		c.lineTo(w * 0.77, 0);
2079		c.lineTo(w * 0.78, h * 0.07);
2080		c.lineTo(w * 0.83, h * 0.09);
2081		c.lineTo(w * 0.89, h * 0.05);
2082		c.lineTo(w * 0.95, h * 0.11);
2083		c.lineTo(w * 0.91, h * 0.16);
2084		c.lineTo(w * 0.93, h * 0.21);
2085		c.lineTo(w, h * 0.22);
2086		c.lineTo(w, h * 0.31);
2087		c.lineTo(w * 0.93, h * 0.31);
2088		c.lineTo(w * 0.91, h * 0.36);
2089		c.lineTo(w * 0.95, h * 0.41);
2090		c.lineTo(w * 0.89, h * 0.47);
2091		c.lineTo(w * 0.83, h * 0.43);
2092		c.lineTo(w * 0.78, h * 0.45);
2093		c.lineTo(w * 0.77, h * 0.52);
2094		c.lineTo(w * 0.68, h * 0.52);
2095		c.close();
2096		c.moveTo(w * 0.36, h * 0.81);
2097		c.curveTo(w * 0.44, h * 0.81, w * 0.52, h * 0.75, w * 0.52, h * 0.67);
2098		c.curveTo(w * 0.52, h * 0.59, w * 0.45, h * 0.51, w * 0.35, h * 0.51);
2099		c.curveTo(w * 0.27, h * 0.51, w * 0.19, h * 0.58, w * 0.19, h * 0.67);
2100		c.curveTo(w * 0.19, h * 0.74, w * 0.27, h * 0.82, w * 0.36, h * 0.81);
2101		c.close();
2102		c.moveTo(w * 0.21, h * 0.98);
2103		c.lineTo(w * 0.22, h * 0.89);
2104		c.lineTo(w * 0.16, h * 0.85);
2105		c.lineTo(w * 0.08, h * 0.88);
2106		c.lineTo(w * 0.02, h * 0.79);
2107		c.lineTo(w * 0.09, h * 0.74);
2108		c.lineTo(w * 0.08, h * 0.67);
2109		c.lineTo(0, h * 0.63);
2110		c.lineTo(w * 0.03, h * 0.53);
2111		c.lineTo(w * 0.12, h * 0.54);
2112		c.lineTo(w * 0.16, h * 0.48);
2113		c.lineTo(w * 0.13, h * 0.4);
2114		c.lineTo(w * 0.22, h * 0.35);
2115		c.lineTo(w * 0.28, h * 0.42);
2116		c.lineTo(w * 0.36, h * 0.41);
2117		c.lineTo(w * 0.39, h * 0.33);
2118		c.lineTo(w * 0.5, h * 0.36);
2119		c.lineTo(w * 0.49, h * 0.45);
2120		c.lineTo(w * 0.55, h * 0.49);
2121		c.lineTo(w * 0.63, h * 0.45);
2122		c.lineTo(w * 0.69, h * 0.54);
2123		c.lineTo(w * 0.62, h * 0.6);
2124		c.lineTo(w * 0.63, h * 0.67);
2125		c.lineTo(w * 0.71, h * 0.7);
2126		c.lineTo(w * 0.68, h * 0.8);
2127		c.lineTo(w * 0.59, h * 0.79);
2128		c.lineTo(w * 0.55, h * 0.85);
2129		c.lineTo(w * 0.59, h * 0.79);
2130		c.lineTo(w * 0.55, h * 0.85);
2131		c.lineTo(w * 0.59, h * 0.93);
2132		c.lineTo(w * 0.49, h * 0.98);
2133		c.lineTo(w * 0.43, h * 0.91);
2134		c.lineTo(w * 0.36, h * 0.92);
2135		c.lineTo(w * 0.32, h);
2136		c.lineTo(w * 0.21, h * 0.98);
2137		c.close();
2138		c.stroke();
2139	}
2140	else if (type === mxArchiMate3Tech.prototype.cst.SYS_SW)
2141	{
2142		mxArchiMate3SysSw.prototype.background(c, x, y, w, h);
2143	}
2144	else if (type === mxArchiMate3Tech.prototype.cst.DEVICE)
2145	{
2146		mxArchiMate3Device.prototype.background(c, x, y, w, h);
2147	}
2148};
2149
2150mxCellRenderer.registerShape(mxArchiMate3Tech.prototype.cst.TECH, mxArchiMate3Tech);
2151
2152mxArchiMate3Tech.prototype.getConstraints = function(style, w, h)
2153{
2154	var constr = [];
2155
2156	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 10, 0));
2157	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
2158	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
2159	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
2160	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
2161	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
2162	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
2163	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
2164	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, 0, -10));
2165	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -10, 0));
2166	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
2167	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
2168	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
2169	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
2170	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
2171	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
2172	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
2173	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, 10));
2174
2175	return (constr);
2176};
2177
2178//**********************************************************************************************************************************************************
2179//Distribution
2180//**********************************************************************************************************************************************************
2181/**
2182* Extends mxShape.
2183*/
2184function mxArchiMate3Distribution(bounds, fill, stroke, strokewidth)
2185{
2186	mxShape.call(this);
2187	this.bounds = bounds;
2188	this.fill = fill;
2189	this.stroke = stroke;
2190	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2191};
2192
2193/**
2194* Extends mxShape.
2195*/
2196mxUtils.extend(mxArchiMate3Distribution, mxShape);
2197
2198mxArchiMate3Distribution.prototype.cst = {
2199		DISTRIBUTION : 'mxgraph.archimate3.distribution'
2200};
2201
2202/**
2203* Function: paintVertexShape
2204*
2205* Paints the vertex shape.
2206*/
2207mxArchiMate3Distribution.prototype.paintVertexShape = function(c, x, y, w, h)
2208{
2209	c.translate(x, y);
2210	this.background(c, 0, 0, w, h);
2211	c.setShadow(false);
2212};
2213
2214mxArchiMate3Distribution.prototype.background = function(c, x, y, w, h)
2215{
2216	c.begin();
2217	c.moveTo(w * 0.1, h * 0.25);
2218	c.lineTo(w * 0.9, h * 0.25);
2219	c.lineTo(w, h * 0.5);
2220	c.lineTo(w * 0.9, h * 0.75);
2221	c.lineTo(w * 0.1, h * 0.75);
2222	c.lineTo(0, h * 0.5);
2223	c.fillAndStroke();
2224	c.begin();
2225	c.moveTo(w * 0.2, 0);
2226	c.lineTo(0, h * 0.5);
2227	c.lineTo(w * 0.2, h);
2228	c.moveTo(w * 0.8, 0);
2229	c.lineTo(w, h * 0.5);
2230	c.lineTo(w * 0.8, h);
2231	c.stroke();
2232};
2233
2234mxCellRenderer.registerShape(mxArchiMate3Distribution.prototype.cst.DISTRIBUTION, mxArchiMate3Distribution);
2235
2236mxArchiMate3Distribution.prototype.getConstraints = function(style, w, h)
2237{
2238	var constr = [];
2239
2240	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
2241	constr.push(new mxConnectionConstraint(new mxPoint(0.2, 0), false));
2242	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.25), false));
2243	constr.push(new mxConnectionConstraint(new mxPoint(0.8, 0), false));
2244	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
2245	constr.push(new mxConnectionConstraint(new mxPoint(0.8, 1), false));
2246	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.75), false));
2247	constr.push(new mxConnectionConstraint(new mxPoint(0.2, 1), false));
2248	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
2249
2250	return (constr);
2251};
2252
2253//**********************************************************************************************************************************************************
2254//Resource
2255//**********************************************************************************************************************************************************
2256/**
2257* Extends mxShape.
2258*/
2259function mxArchiMate3Resource(bounds, fill, stroke, strokewidth)
2260{
2261	mxShape.call(this);
2262	this.bounds = bounds;
2263	this.fill = fill;
2264	this.stroke = stroke;
2265	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2266};
2267
2268/**
2269* Extends mxShape.
2270*/
2271mxUtils.extend(mxArchiMate3Resource, mxShape);
2272
2273mxArchiMate3Resource.prototype.cst = {
2274		RESOURCE : 'mxgraph.archimate3.resource'
2275};
2276
2277/**
2278* Function: paintVertexShape
2279*
2280* Paints the vertex shape.
2281*/
2282mxArchiMate3Resource.prototype.paintVertexShape = function(c, x, y, w, h)
2283{
2284	c.translate(x, y);
2285	this.background(c, 0, 0, w, h);
2286	c.setShadow(false);
2287};
2288
2289mxArchiMate3Resource.prototype.background = function(c, x, y, w, h)
2290{
2291	c.begin();
2292	c.moveTo(w * 0.51, h * 0.34);
2293	c.lineTo(w * 0.51, h * 0.65);
2294	c.moveTo(w * 0.35, h * 0.34);
2295	c.lineTo(w * 0.35, h * 0.65);
2296	c.moveTo(w * 0.19, h * 0.34);
2297	c.lineTo(w * 0.19, h * 0.65);
2298	c.moveTo(w * 0.91, h * 0.4);
2299	c.curveTo(w * 0.93, h * 0.39, w * 0.95, h * 0.39, w * 0.97, h * 0.40);
2300	c.curveTo(w * 0.99, h * 0.4, w, h * 0.41, w, h * 0.43);
2301	c.curveTo(w, h * 0.48, w, h * 0.52, w, h * 0.57);
2302	c.curveTo(w, h * 0.58, w * 0.99, h * 0.59, w * 0.98, h * 0.6);
2303	c.curveTo(w * 0.96, h * 0.6, w * 0.93, h * 0.6, w * 0.91, h * 0.6);
2304	c.moveTo(0, h * 0.73);
2305	c.curveTo(0, h * 0.6, 0, h * 0.43, 0, h * 0.27);
2306	c.curveTo(0, h * 0.24, w * 0.03, h * 0.21, w * 0.08, h * 0.21);
2307	c.curveTo(w * 0.33, h * 0.2, w * 0.61, h * 0.2, w * 0.84, h * 0.21);
2308	c.curveTo(w * 0.88, h * 0.22, w * 0.89, h * 0.24, w * 0.9, h * 0.26);
2309	c.curveTo(w * 0.91, h * 0.41, w * 0.91, h * 0.57, w * 0.9, h * 0.72);
2310	c.curveTo(w * 0.9, h * 0.74, w * 0.88, h * 0.78, w * 0.83, h * 0.79);
2311	c.curveTo(w * 0.57, h * 0.79, w * 0.32, h * 0.79, w * 0.06, h * 0.79);
2312	c.curveTo(w * 0.02, h * 0.78, 0, h * 0.76, 0, h * 0.73);
2313	c.close();
2314	c.stroke();
2315};
2316
2317mxCellRenderer.registerShape(mxArchiMate3Resource.prototype.cst.RESOURCE, mxArchiMate3Resource);
2318
2319//**********************************************************************************************************************************************************
2320//Capability
2321//**********************************************************************************************************************************************************
2322/**
2323* Extends mxShape.
2324*/
2325function mxArchiMate3Capability(bounds, fill, stroke, strokewidth)
2326{
2327	mxShape.call(this);
2328	this.bounds = bounds;
2329	this.fill = fill;
2330	this.stroke = stroke;
2331	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2332};
2333
2334/**
2335* Extends mxShape.
2336*/
2337mxUtils.extend(mxArchiMate3Capability, mxShape);
2338
2339mxArchiMate3Capability.prototype.cst = {
2340		CAPABILITY : 'mxgraph.archimate3.capability'
2341};
2342
2343/**
2344* Function: paintVertexShape
2345*
2346* Paints the vertex shape.
2347*/
2348mxArchiMate3Capability.prototype.paintVertexShape = function(c, x, y, w, h)
2349{
2350	c.translate(x, y);
2351	this.background(c, 0, 0, w, h);
2352	c.setShadow(false);
2353};
2354
2355mxArchiMate3Capability.prototype.background = function(c, x, y, w, h)
2356{
2357	c.begin();
2358	c.moveTo(w, 0);
2359	c.lineTo(w, h);
2360	c.lineTo(0, h);
2361	c.lineTo(0, h * 0.67);
2362	c.lineTo(w * 0.33, h * 0.67);
2363	c.lineTo(w * 0.33, h * 0.33);
2364	c.lineTo(w * 0.67, h * 0.33);
2365	c.lineTo(w * 0.67, 0);
2366	c.close();
2367	c.moveTo(w * 0.67, h * 0.33);
2368	c.lineTo(w, h * 0.33);
2369	c.moveTo(w * 0.33, h * 0.67);
2370	c.lineTo(w, h * 0.67);
2371	c.moveTo(w * 0.33, h * 0.67);
2372	c.lineTo(w * 0.33, h);
2373	c.moveTo(w * 0.67, h * 0.33);
2374	c.lineTo(w * 0.67, h);
2375	c.stroke();
2376};
2377
2378mxCellRenderer.registerShape(mxArchiMate3Capability.prototype.cst.CAPABILITY, mxArchiMate3Capability);
2379
2380//**********************************************************************************************************************************************************
2381//Course of Action
2382//**********************************************************************************************************************************************************
2383/**
2384* Extends mxShape.
2385*/
2386function mxArchiMate3Course(bounds, fill, stroke, strokewidth)
2387{
2388	mxShape.call(this);
2389	this.bounds = bounds;
2390	this.fill = fill;
2391	this.stroke = stroke;
2392	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2393};
2394
2395/**
2396* Extends mxShape.
2397*/
2398mxUtils.extend(mxArchiMate3Course, mxShape);
2399
2400mxArchiMate3Course.prototype.cst = {
2401		COURSE : 'mxgraph.archimate3.course'
2402};
2403
2404/**
2405* Function: paintVertexShape
2406*
2407* Paints the vertex shape.
2408*/
2409mxArchiMate3Course.prototype.paintVertexShape = function(c, x, y, w, h)
2410{
2411	c.translate(x, y);
2412	this.background(c, 0, 0, w, h);
2413	c.setShadow(false);
2414};
2415
2416mxArchiMate3Course.prototype.background = function(c, x, y, w, h)
2417{
2418	c.begin();
2419	c.moveTo(0, h);
2420	c.arcTo(w * 0.7, h * 0.7, 0, 0, 1, w * 0.41, h * 0.56);
2421	c.moveTo(w * 0.14, h * 0.54);
2422	c.lineTo(w * 0.41, h * 0.56);
2423	c.lineTo(w * 0.3, h * 0.78);
2424	c.stroke();
2425
2426	c.ellipse(w * 0.4, 0, w * 0.6, h * 0.6);
2427	c.stroke();
2428	c.ellipse(w * 0.5, h * 0.1, w * 0.4, h * 0.4);
2429	c.stroke();
2430
2431	var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#000000');
2432	c.setFillColor(fillColor);
2433	c.ellipse(w * 0.6, h * 0.2, w * 0.2, h * 0.2);
2434	c.fill();
2435};
2436
2437mxCellRenderer.registerShape(mxArchiMate3Course.prototype.cst.COURSE, mxArchiMate3Course);
2438
2439//**********************************************************************************************************************************************************
2440//Node
2441//**********************************************************************************************************************************************************
2442/**
2443* Extends mxShape.
2444*/
2445function mxArchiMate3Node(bounds, fill, stroke, strokewidth)
2446{
2447	mxShape.call(this);
2448	this.bounds = bounds;
2449	this.fill = fill;
2450	this.stroke = stroke;
2451	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2452};
2453
2454/**
2455* Extends mxShape.
2456*/
2457mxUtils.extend(mxArchiMate3Node, mxShape);
2458
2459mxArchiMate3Node.prototype.cst = {
2460		NODE : 'mxgraph.archimate3.node'
2461};
2462
2463/**
2464* Function: paintVertexShape
2465*
2466* Paints the vertex shape.
2467*/
2468mxArchiMate3Node.prototype.paintVertexShape = function(c, x, y, w, h)
2469{
2470	c.translate(x, y);
2471	this.background(c, 0, 0, w, h);
2472	c.setShadow(false);
2473};
2474
2475mxArchiMate3Node.prototype.background = function(c, x, y, w, h)
2476{
2477	c.begin();
2478	c.moveTo(0, h * 0.25);
2479	c.lineTo(w * 0.25, 0);
2480	c.lineTo(w, 0);
2481	c.lineTo(w, h * 0.75);
2482	c.lineTo(w * 0.75, h);
2483	c.lineTo(0, h);
2484	c.close();
2485	c.moveTo(0, h * 0.25);
2486	c.lineTo(w * 0.75, h * 0.25);
2487	c.lineTo(w * 0.75, h);
2488	c.moveTo(w, 0);
2489	c.lineTo(w * 0.75, h * 0.25);
2490	c.fillAndStroke();
2491};
2492
2493mxCellRenderer.registerShape(mxArchiMate3Node.prototype.cst.NODE, mxArchiMate3Node);
2494
2495mxArchiMate3Node.prototype.getConstraints = function(style, w, h)
2496{
2497	var constr = [];
2498
2499	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
2500	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
2501	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
2502	constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
2503	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
2504	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
2505	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
2506	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
2507	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
2508	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
2509	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
2510	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
2511	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
2512	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
2513	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
2514	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
2515	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
2516	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
2517
2518	return (constr);
2519};
2520
2521//**********************************************************************************************************************************************************
2522//Device
2523//**********************************************************************************************************************************************************
2524/**
2525* Extends mxShape.
2526*/
2527function mxArchiMate3Device(bounds, fill, stroke, strokewidth)
2528{
2529	mxShape.call(this);
2530	this.bounds = bounds;
2531	this.fill = fill;
2532	this.stroke = stroke;
2533	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2534};
2535
2536/**
2537* Extends mxShape.
2538*/
2539mxUtils.extend(mxArchiMate3Device, mxShape);
2540
2541mxArchiMate3Device.prototype.cst = {
2542		DEVICE : 'mxgraph.archimate3.device'
2543};
2544
2545/**
2546* Function: paintVertexShape
2547*
2548* Paints the vertex shape.
2549*/
2550mxArchiMate3Device.prototype.paintVertexShape = function(c, x, y, w, h)
2551{
2552	c.translate(x, y);
2553	this.background(c, 0, 0, w, h);
2554	c.setShadow(false);
2555};
2556
2557mxArchiMate3Device.prototype.background = function(c, x, y, w, h)
2558{
2559	c.roundrect(0, 0, w, h * 0.88, w * 0.1, h * 0.1);
2560	c.fillAndStroke();
2561
2562	c.begin();
2563	c.moveTo(w * 0.1, h * 0.88);
2564	c.lineTo(0, h);
2565	c.lineTo(w, h);
2566	c.lineTo(w * 0.9, h * 0.88);
2567	c.fillAndStroke();
2568};
2569
2570mxCellRenderer.registerShape(mxArchiMate3Device.prototype.cst.DEVICE, mxArchiMate3Device);
2571
2572mxArchiMate3Device.prototype.getConstraints = function(style, w, h)
2573{
2574	var constr = [];
2575
2576	constr.push(new mxConnectionConstraint(new mxPoint(0.03, 0.03), false));
2577	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
2578	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
2579	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
2580	constr.push(new mxConnectionConstraint(new mxPoint(0.97, 0.03), false));
2581	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
2582	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
2583	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
2584	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
2585	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
2586	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
2587	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
2588	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
2589	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
2590	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
2591	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
2592
2593	return (constr);
2594};
2595
2596//**********************************************************************************************************************************************************
2597//System Software
2598//**********************************************************************************************************************************************************
2599/**
2600* Extends mxShape.
2601*/
2602function mxArchiMate3SysSw(bounds, fill, stroke, strokewidth)
2603{
2604	mxShape.call(this);
2605	this.bounds = bounds;
2606	this.fill = fill;
2607	this.stroke = stroke;
2608	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2609};
2610
2611/**
2612* Extends mxShape.
2613*/
2614mxUtils.extend(mxArchiMate3SysSw, mxShape);
2615
2616mxArchiMate3SysSw.prototype.cst = {
2617		SYS_SW : 'mxgraph.archimate3.sysSw'
2618};
2619
2620/**
2621* Function: paintVertexShape
2622*
2623* Paints the vertex shape.
2624*/
2625mxArchiMate3SysSw.prototype.paintVertexShape = function(c, x, y, w, h)
2626{
2627	c.translate(x, y);
2628	this.background(c, 0, 0, w, h);
2629	c.setShadow(false);
2630};
2631
2632mxArchiMate3SysSw.prototype.background = function(c, x, y, w, h)
2633{
2634	c.ellipse(w * 0.3, 0, w * 0.7, h * 0.7);
2635	c.stroke();
2636
2637	c.ellipse(0, h * 0.02, w * 0.98, h * 0.98);
2638	c.fillAndStroke();
2639};
2640
2641mxCellRenderer.registerShape(mxArchiMate3SysSw.prototype.cst.SYS_SW, mxArchiMate3SysSw);
2642
2643//**********************************************************************************************************************************************************
2644//Artifact
2645//**********************************************************************************************************************************************************
2646/**
2647* Extends mxShape.
2648*/
2649function mxArchiMate3Artifact(bounds, fill, stroke, strokewidth)
2650{
2651	mxShape.call(this);
2652	this.bounds = bounds;
2653	this.fill = fill;
2654	this.stroke = stroke;
2655	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2656};
2657
2658/**
2659* Extends mxShape.
2660*/
2661mxUtils.extend(mxArchiMate3Artifact, mxShape);
2662
2663mxArchiMate3Artifact.prototype.cst = {
2664		ARTIFACT : 'mxgraph.archimate3.artifact'
2665};
2666
2667/**
2668* Function: paintVertexShape
2669*
2670* Paints the vertex shape.
2671*/
2672mxArchiMate3Artifact.prototype.paintVertexShape = function(c, x, y, w, h)
2673{
2674	c.translate(x, y);
2675	this.background(c, 0, 0, w, h);
2676	c.setShadow(false);
2677};
2678
2679mxArchiMate3Artifact.prototype.background = function(c, x, y, w, h)
2680{
2681	c.begin();
2682	c.moveTo(0, 0);
2683	c.lineTo(w * 0.7, 0);
2684	c.lineTo(w, h * 0.22);
2685	c.lineTo(w, h);
2686	c.lineTo(0, h);
2687	c.close();
2688	c.fillAndStroke();
2689
2690	c.begin();
2691	c.moveTo(w * 0.7, 0);
2692	c.lineTo(w * 0.7, h * 0.22);
2693	c.lineTo(w, h * 0.22);
2694	c.stroke();
2695};
2696
2697mxCellRenderer.registerShape(mxArchiMate3Artifact.prototype.cst.ARTIFACT, mxArchiMate3Artifact);
2698
2699mxArchiMate3Artifact.prototype.getConstraints = function(style, w, h)
2700{
2701	var constr = [];
2702
2703	constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
2704	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
2705	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
2706	constr.push(new mxConnectionConstraint(new mxPoint(0.7, 0), false));
2707	constr.push(new mxConnectionConstraint(new mxPoint(0.85, 0.11), false));
2708	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.22), false));
2709	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
2710	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
2711	constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
2712	constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
2713	constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
2714	constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
2715	constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
2716	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
2717	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
2718	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
2719
2720	return (constr);
2721};
2722
2723//**********************************************************************************************************************************************************
2724//Communication Network
2725//**********************************************************************************************************************************************************
2726/**
2727* Extends mxShape.
2728*/
2729function mxArchiMate3CommNetw(bounds, fill, stroke, strokewidth)
2730{
2731	mxShape.call(this);
2732	this.bounds = bounds;
2733	this.fill = fill;
2734	this.stroke = stroke;
2735	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2736};
2737
2738/**
2739* Extends mxShape.
2740*/
2741mxUtils.extend(mxArchiMate3CommNetw, mxShape);
2742
2743mxArchiMate3CommNetw.prototype.cst = {
2744		COMM_NETW : 'mxgraph.archimate3.commNetw'
2745};
2746
2747/**
2748* Function: paintVertexShape
2749*
2750* Paints the vertex shape.
2751*/
2752mxArchiMate3CommNetw.prototype.paintVertexShape = function(c, x, y, w, h)
2753{
2754	c.translate(x, y);
2755	this.background(c, 0, 0, w, h);
2756	c.setShadow(false);
2757};
2758
2759mxArchiMate3CommNetw.prototype.background = function(c, x, y, w, h)
2760{
2761	c.begin();
2762	c.moveTo(w * 0.2, h);
2763	c.lineTo(0, h * 0.5);
2764	c.lineTo(w * 0.2, 0);
2765	c.moveTo(w * 0.8, h);
2766	c.lineTo(w, h * 0.5);
2767	c.lineTo(w * 0.8, 0);
2768	c.moveTo(0, h * 0.5);
2769	c.lineTo(w, h * 0.5);
2770	c.stroke();
2771};
2772
2773mxCellRenderer.registerShape(mxArchiMate3CommNetw.prototype.cst.COMM_NETW, mxArchiMate3CommNetw);
2774
2775mxArchiMate3CommNetw.prototype.getConstraints = function(style, w, h)
2776{
2777	var constr = [];
2778
2779	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
2780	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
2781
2782	return (constr);
2783};
2784
2785//**********************************************************************************************************************************************************
2786//Path
2787//**********************************************************************************************************************************************************
2788/**
2789* Extends mxShape.
2790*/
2791function mxArchiMate3Path(bounds, fill, stroke, strokewidth)
2792{
2793	mxShape.call(this);
2794	this.bounds = bounds;
2795	this.fill = fill;
2796	this.stroke = stroke;
2797	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
2798};
2799
2800/**
2801* Extends mxShape.
2802*/
2803mxUtils.extend(mxArchiMate3Path, mxShape);
2804
2805mxArchiMate3Path.prototype.cst = {
2806		PATH : 'mxgraph.archimate3.path'
2807};
2808
2809/**
2810* Function: paintVertexShape
2811*
2812* Paints the vertex shape.
2813*/
2814mxArchiMate3Path.prototype.paintVertexShape = function(c, x, y, w, h)
2815{
2816	c.translate(x, y);
2817	this.background(c, 0, 0, w, h);
2818	c.setShadow(false);
2819};
2820
2821mxArchiMate3Path.prototype.background = function(c, x, y, w, h)
2822{
2823	c.begin();
2824	c.moveTo(w * 0.2, h);
2825	c.lineTo(0, h * 0.5);
2826	c.lineTo(w * 0.2, 0);
2827	c.moveTo(w * 0.8, h);
2828	c.lineTo(w, h * 0.5);
2829	c.lineTo(w * 0.8, 0);
2830	c.stroke();
2831
2832	c.setDashed(true);
2833	c.begin();
2834	c.moveTo(0, h * 0.5);
2835	c.lineTo(w, h * 0.5);
2836	c.stroke();
2837};
2838
2839mxCellRenderer.registerShape(mxArchiMate3Path.prototype.cst.PATH, mxArchiMate3Path);
2840
2841mxArchiMate3Path.prototype.getConstraints = function(style, w, h)
2842{
2843	var constr = [];
2844
2845	constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
2846	constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
2847
2848	return (constr);
2849};
2850