mxArchiMate3.js 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258
  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. //Application
  7. //**********************************************************************************************************************************************************
  8. /**
  9. * Extends mxShape.
  10. */
  11. function mxArchiMate3Application(bounds, fill, stroke, strokewidth)
  12. {
  13. mxShape.call(this);
  14. this.bounds = bounds;
  15. this.fill = fill;
  16. this.stroke = stroke;
  17. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  18. };
  19. /**
  20. * Extends mxShape.
  21. */
  22. mxUtils.extend(mxArchiMate3Application, mxShape);
  23. mxArchiMate3Application.prototype.cst = {
  24. APPLICATION : 'mxgraph.archimate3.application',
  25. TYPE : 'appType',
  26. COMPONENT : 'comp',
  27. COLLABORATION : 'collab',
  28. INTERFACE : 'interface',
  29. INTERFACE2 : 'interface2',
  30. FUNCTION : 'func',
  31. INTERACTION : 'interaction',
  32. SERVICE : 'serv',
  33. EVENT : 'event',
  34. EVENT2 : 'event2',
  35. NODE : 'node',
  36. NETWORK : 'netw',
  37. COMM_PATH : 'commPath',
  38. SYS_SW : 'sysSw',
  39. ARTIFACT : 'artifact',
  40. ACTOR : 'actor',
  41. ASSESSMENT : 'assess',
  42. GOAL : 'goal',
  43. OUTCOME : 'outcome',
  44. ROLE : 'role',
  45. PROCESS : 'proc',
  46. DRIVER : 'driver',
  47. PRINCIPLE : 'principle',
  48. REQUIREMENT : 'requirement',
  49. CONSTRAINT : 'constraint',
  50. RESOURCE : 'resource',
  51. CAPABILITY : 'capability',
  52. COURSE : 'course',
  53. MATERIAL : 'material',
  54. DISTRIBUTION : 'distribution',
  55. SYS_SW : 'sysSw',
  56. ARTIFACT : 'artifact',
  57. PATH : 'path',
  58. ARCHI_TYPE : 'archiType',
  59. TYPE_SQUARE : 'square',
  60. TYPE_ROUNDED : 'rounded',
  61. TYPE_OCT : 'oct'
  62. };
  63. /**
  64. * Function: paintVertexShape
  65. *
  66. * Paints the vertex shape.
  67. */
  68. mxArchiMate3Application.prototype.paintVertexShape = function(c, x, y, w, h)
  69. {
  70. c.translate(x, y);
  71. this.background(c, 0, 0, w, h);
  72. c.setShadow(false);
  73. c.translate(w - 20, 5);
  74. this.foreground(c, w - 20, 5, 15, 15);
  75. };
  76. mxArchiMate3Application.prototype.background = function(c, x, y, w, h)
  77. {
  78. var archiType = mxUtils.getValue(this.style, mxArchiMate3Application.prototype.cst.ARCHI_TYPE, 'square');
  79. if (archiType === 'rounded')
  80. {
  81. c.roundrect(0, 0, w, h, 10, 10);
  82. }
  83. else if ((archiType === 'oct') && w >= 20 && h >= 20)
  84. {
  85. c.begin();
  86. c.moveTo(0, 10);
  87. c.lineTo(10, 0);
  88. c.lineTo(w - 10, 0);
  89. c.lineTo(w, 10);
  90. c.lineTo(w, h - 10);
  91. c.lineTo(w - 10, h);
  92. c.lineTo(10, h);
  93. c.lineTo(0, h - 10);
  94. c.close();
  95. c.fillAndStroke();
  96. }
  97. else
  98. {
  99. c.rect(0, 0, w, h);
  100. }
  101. c.fillAndStroke();
  102. };
  103. mxArchiMate3Application.prototype.foreground = function(c, x, y, w, h)
  104. {
  105. var type = mxUtils.getValue(this.style, mxArchiMate3Application.prototype.cst.TYPE, '');
  106. c.setDashed(false);
  107. if (type === mxArchiMate3Application.prototype.cst.COMPONENT)
  108. {
  109. c.translate(1, 0);
  110. w = w - 2;
  111. mxArchiMate3Component.prototype.background(c, x, y, w, h);
  112. }
  113. else if (type === mxArchiMate3Application.prototype.cst.COLLABORATION)
  114. {
  115. c.translate(0, 3);
  116. h = h - 6;
  117. mxArchiMate3Collaboration.prototype.background(c, x, y, w, h);
  118. }
  119. else if (type === mxArchiMate3Application.prototype.cst.INTERFACE)
  120. {
  121. c.translate(0, 4);
  122. h = h - 8;
  123. mxArchiMate3Interface.prototype.background(c, x, y, w, h);
  124. }
  125. else if (type === mxArchiMate3Application.prototype.cst.INTERFACE2)
  126. {
  127. c.translate(0, 1);
  128. h = h - 2;
  129. c.begin();
  130. c.moveTo(0, h * 0.5);
  131. c.lineTo(w * 0.6, h * 0.5);
  132. c.moveTo(w, 0);
  133. c.arcTo(w * 0.4, h * 0.5, 0, 0, 0, w, h);
  134. c.stroke();
  135. }
  136. else if (type === mxArchiMate3Application.prototype.cst.FUNCTION)
  137. {
  138. mxArchiMate3Function.prototype.background(c, x, y, w, h);
  139. }
  140. else if (type === mxArchiMate3Application.prototype.cst.INTERACTION)
  141. {
  142. mxArchiMate3Interaction.prototype.background(c, x, y, w, h);
  143. }
  144. else if (type === mxArchiMate3Application.prototype.cst.SERVICE)
  145. {
  146. c.translate(0, 3);
  147. h = h - 6;
  148. mxArchiMate3Service.prototype.background(c, x, y, w, h);
  149. }
  150. else if (type === mxArchiMate3Application.prototype.cst.EVENT)
  151. {
  152. c.translate(0, 3);
  153. h = h - 6;
  154. mxArchiMate3Event.prototype.background(c, x, y, w, h);
  155. }
  156. else if (type === mxArchiMate3Application.prototype.cst.EVENT2)
  157. {
  158. c.translate(0, 3);
  159. h = h - 6;
  160. mxArchiMate3Event2.prototype.background(c, x, y, w, h);
  161. }
  162. else if (type === mxArchiMate3Application.prototype.cst.NODE)
  163. {
  164. mxArchiMate3Node.prototype.background(c, x, y, w, h);
  165. }
  166. else if (type === mxArchiMate3Application.prototype.cst.NETWORK)
  167. {
  168. c.translate(0, 2);
  169. h = h - 4;
  170. c.begin();
  171. c.moveTo(w * 0.4, h * 0.2);
  172. c.lineTo(w * 0.85, h * 0.2);
  173. c.lineTo(w * 0.6, h * 0.8);
  174. c.lineTo(w * 0.15, h * 0.8);
  175. c.close();
  176. c.stroke();
  177. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  178. c.setFillColor(strokeColor);
  179. c.ellipse(w * 0.25, 0, w * 0.3, h * 0.4);
  180. c.fill();
  181. c.ellipse(w * 0.7, 0, w * 0.3, h * 0.4);
  182. c.fill();
  183. c.ellipse(0, h * 0.6, w * 0.3, h * 0.4);
  184. c.fill();
  185. c.ellipse(w * 0.45, h * 0.6, w * 0.3, h * 0.4);
  186. c.fill();
  187. }
  188. else if (type === mxArchiMate3Application.prototype.cst.COMM_PATH)
  189. {
  190. c.translate(0, 5);
  191. h = h - 10;
  192. c.begin();
  193. c.moveTo(w * 0.1, 0);
  194. c.lineTo(0, h * 0.5);
  195. c.lineTo(w * 0.1, h);
  196. c.moveTo(w * 0.9, 0);
  197. c.lineTo(w, h * 0.5);
  198. c.lineTo(w * 0.9, h);
  199. c.stroke();
  200. c.setDashed(true);
  201. c.begin();
  202. c.moveTo(0, h * 0.5);
  203. c.lineTo(w, h * 0.5);
  204. c.stroke();
  205. }
  206. else if (type === mxArchiMate3Application.prototype.cst.ARTIFACT)
  207. {
  208. c.translate(2, 0);
  209. w = w - 4;
  210. c.begin();
  211. c.moveTo(0, 0);
  212. c.lineTo(w * 0.7, 0);
  213. c.lineTo(w, h * 0.22);
  214. c.lineTo(w, h);
  215. c.lineTo(0, h);
  216. c.close();
  217. c.moveTo(w * 0.7, 0);
  218. c.lineTo(w * 0.7, h * 0.22);
  219. c.lineTo(w, h * 0.22);
  220. c.stroke();
  221. }
  222. else if (type === mxArchiMate3Application.prototype.cst.ACTOR)
  223. {
  224. c.translate(3, 0);
  225. w = w - 6;
  226. mxArchiMate3Actor.prototype.background(c, x, y, w, h);
  227. }
  228. else if (type === mxArchiMate3Application.prototype.cst.ROLE)
  229. {
  230. c.translate(0, 4);
  231. h = h - 8;
  232. mxArchiMate3Role.prototype.background(c, x, y, w, h);
  233. }
  234. else if (type === mxArchiMate3Application.prototype.cst.PROCESS)
  235. {
  236. c.translate(0, 3);
  237. h = h - 6;
  238. mxArchiMate3Process.prototype.background(c, x, y, w, h);
  239. }
  240. else if (type === mxArchiMate3Application.prototype.cst.DRIVER)
  241. {
  242. c.ellipse(w * 0.1, h * 0.1, w * 0.8, h * 0.8);
  243. c.stroke();
  244. c.begin();
  245. c.moveTo(0, h * 0.5);
  246. c.lineTo(w, h * 0.5);
  247. c.moveTo(w * 0.5, 0);
  248. c.lineTo(w * 0.5, h);
  249. c.moveTo(w * 0.145, h * 0.145);
  250. c.lineTo(w * 0.855, h * 0.855);
  251. c.moveTo(w * 0.145, h * 0.855);
  252. c.lineTo(w * 0.855, h * 0.145);
  253. c.stroke();
  254. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  255. c.setFillColor(strokeColor);
  256. c.ellipse(w * 0.35, h * 0.35, w * 0.3, h * 0.3);
  257. c.fillAndStroke();
  258. }
  259. else if (type === mxArchiMate3Application.prototype.cst.ASSESSMENT)
  260. {
  261. c.ellipse(w * 0.2, 0, w * 0.8, h * 0.8);
  262. c.stroke();
  263. c.begin();
  264. c.moveTo(0, h);
  265. c.lineTo(w * 0.32, h * 0.68);
  266. c.stroke();
  267. }
  268. else if (type === mxArchiMate3Application.prototype.cst.GOAL)
  269. {
  270. c.ellipse(0, 0, w, h);
  271. c.stroke();
  272. c.ellipse(w * 0.15, h * 0.15, w * 0.7, h * 0.7);
  273. c.stroke();
  274. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  275. c.setFillColor(strokeColor);
  276. c.ellipse(w * 0.3, h * 0.3, w * 0.4, h * 0.4);
  277. c.fillAndStroke();
  278. }
  279. else if (type === mxArchiMate3Application.prototype.cst.OUTCOME)
  280. {
  281. c.ellipse(0, w * 0.2, w * 0.8, h * 0.8);
  282. c.stroke();
  283. c.ellipse(w * 0.15, w * 0.35, w * 0.5, h * 0.5);
  284. c.stroke();
  285. c.ellipse(w * 0.3, w * 0.5, w * 0.2, h * 0.2);
  286. c.stroke();
  287. c.begin();
  288. c.moveTo(w * 0.4, h * 0.6);
  289. c.lineTo(w * 0.9, h * 0.1);
  290. c.moveTo(w * 0.42, h * 0.4);
  291. c.lineTo(w * 0.4, h * 0.6);
  292. c.lineTo(w * 0.6, h * 0.58);
  293. c.moveTo(w * 0.8, 0);
  294. c.lineTo(w * 0.75, h * 0.25);
  295. c.lineTo(w, h * 0.2);
  296. c.stroke();
  297. }
  298. else if (type === mxArchiMate3Application.prototype.cst.PRINCIPLE)
  299. {
  300. c.begin();
  301. c.moveTo(w * 0.05, h * 0.05);
  302. c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.95, h * 0.05);
  303. c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.95, h * 0.95);
  304. c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.05, h * 0.95);
  305. c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.05, h * 0.05);
  306. c.close();
  307. c.stroke();
  308. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  309. c.setFillColor(strokeColor);
  310. c.begin();
  311. c.moveTo(w * 0.45, h * 0.7);
  312. c.lineTo(w * 0.42, h * 0.15);
  313. c.lineTo(w * 0.58, h * 0.15);
  314. c.lineTo(w * 0.55, h * 0.7);
  315. c.close();
  316. c.fill();
  317. c.rect(w * 0.45, h * 0.75, w * 0.1, h * 0.1);
  318. c.fill();
  319. }
  320. else if (type === mxArchiMate3Application.prototype.cst.REQUIREMENT)
  321. {
  322. c.translate(0, 4);
  323. h = h - 8;
  324. mxArchiMate3Requirement.prototype.background(c, x, y, w, h);
  325. }
  326. else if (type === mxArchiMate3Application.prototype.cst.CONSTRAINT)
  327. {
  328. c.translate(0, 4);
  329. h = h - 8;
  330. mxArchiMate3Constraint.prototype.background(c, x, y, w, h);
  331. }
  332. else if (type === mxArchiMate3Application.prototype.cst.MATERIAL)
  333. {
  334. c.translate(0, 1);
  335. h = h - 2;
  336. c.begin();
  337. c.moveTo(0, h * 0.5);
  338. c.lineTo(w * 0.25, 0);
  339. c.lineTo(w * 0.75, 0);
  340. c.lineTo(w, h * 0.5);
  341. c.lineTo(w * 0.75, h);
  342. c.lineTo(w * 0.25, h);
  343. c.close();
  344. c.moveTo(w * 0.15, h * 0.5);
  345. c.lineTo(w * 0.31, h * 0.2);
  346. c.moveTo(w * 0.69, h * 0.2);
  347. c.lineTo(w * 0.85, h * 0.5);
  348. c.moveTo(w * 0.68, h * 0.80);
  349. c.lineTo(w * 0.32, h * 0.80);
  350. c.stroke();
  351. }
  352. else if (type === mxArchiMate3Application.prototype.cst.DISTRIBUTION)
  353. {
  354. c.translate(0, 4);
  355. h = h - 8;
  356. mxArchiMate3Distribution.prototype.background(c, x, y, w, h);
  357. }
  358. else if (type === mxArchiMate3Application.prototype.cst.RESOURCE)
  359. {
  360. c.translate(0, 1);
  361. h = h - 2;
  362. mxArchiMate3Resource.prototype.background(c, x, y, w, h);
  363. }
  364. else if (type === mxArchiMate3Application.prototype.cst.CAPABILITY)
  365. {
  366. mxArchiMate3Capability.prototype.background(c, x, y, w, h);
  367. }
  368. else if (type === mxArchiMate3Application.prototype.cst.COURSE)
  369. {
  370. mxArchiMate3Course.prototype.background(c, x, y, w, h);
  371. }
  372. else if (type === mxArchiMate3Application.prototype.cst.SYS_SW)
  373. {
  374. mxArchiMate3SysSw.prototype.background(c, x, y, w, h);
  375. }
  376. else if (type === mxArchiMate3Application.prototype.cst.ARTIFACT)
  377. {
  378. c.translate(2, 0);
  379. w = w - 4;
  380. mxArchiMate3Artifact.prototype.background(c, x, y, w, h);
  381. }
  382. else if (type === mxArchiMate3Application.prototype.cst.PATH)
  383. {
  384. c.translate(0, 5);
  385. h = h - 10;
  386. mxArchiMate3Path.prototype.background(c, x, y, w, h);
  387. }
  388. };
  389. mxCellRenderer.registerShape(mxArchiMate3Application.prototype.cst.APPLICATION, mxArchiMate3Application);
  390. //**********************************************************************************************************************************************************
  391. //Component
  392. //**********************************************************************************************************************************************************
  393. /**
  394. * Extends mxShape.
  395. */
  396. function mxArchiMate3Component(bounds, fill, stroke, strokewidth)
  397. {
  398. mxShape.call(this);
  399. this.bounds = bounds;
  400. this.fill = fill;
  401. this.stroke = stroke;
  402. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  403. };
  404. /**
  405. * Extends mxShape.
  406. */
  407. mxUtils.extend(mxArchiMate3Component, mxShape);
  408. mxArchiMate3Component.prototype.cst = {
  409. COMPONENT : 'mxgraph.archimate3.component'
  410. };
  411. /**
  412. * Function: paintVertexShape
  413. *
  414. * Paints the vertex shape.
  415. */
  416. mxArchiMate3Component.prototype.paintVertexShape = function(c, x, y, w, h)
  417. {
  418. c.translate(x, y);
  419. this.background(c, 0, 0, w, h);
  420. c.setShadow(false);
  421. };
  422. mxArchiMate3Component.prototype.background = function(c, x, y, w, h)
  423. {
  424. c.rect(w * 0.25, 0, w * 0.75, h);
  425. c.fillAndStroke();
  426. c.rect(0, h * 0.25, w * 0.5, h * 0.15);
  427. c.fillAndStroke();
  428. c.rect(0, h * 0.6, w * 0.5, h * 0.15);
  429. c.fillAndStroke();
  430. };
  431. mxCellRenderer.registerShape(mxArchiMate3Component.prototype.cst.COMPONENT, mxArchiMate3Component);
  432. //**********************************************************************************************************************************************************
  433. //Collaboration
  434. //**********************************************************************************************************************************************************
  435. /**
  436. * Extends mxShape.
  437. */
  438. function mxArchiMate3Collaboration(bounds, fill, stroke, strokewidth)
  439. {
  440. mxShape.call(this);
  441. this.bounds = bounds;
  442. this.fill = fill;
  443. this.stroke = stroke;
  444. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  445. };
  446. /**
  447. * Extends mxShape.
  448. */
  449. mxUtils.extend(mxArchiMate3Collaboration, mxShape);
  450. mxArchiMate3Collaboration.prototype.cst = {
  451. COLLABORATION : 'mxgraph.archimate3.collaboration'
  452. };
  453. /**
  454. * Function: paintVertexShape
  455. *
  456. * Paints the vertex shape.
  457. */
  458. mxArchiMate3Collaboration.prototype.paintVertexShape = function(c, x, y, w, h)
  459. {
  460. c.translate(x, y);
  461. this.background(c, 0, 0, w, h);
  462. c.setShadow(false);
  463. };
  464. mxArchiMate3Collaboration.prototype.background = function(c, x, y, w, h)
  465. {
  466. c.ellipse(0, 0, w * 0.6, h);
  467. c.fillAndStroke();
  468. c.ellipse(w * 0.4, 0, w * 0.6, h);
  469. c.fillAndStroke();
  470. };
  471. mxCellRenderer.registerShape(mxArchiMate3Collaboration.prototype.cst.COLLABORATION, mxArchiMate3Collaboration);
  472. //**********************************************************************************************************************************************************
  473. //Interface
  474. //**********************************************************************************************************************************************************
  475. /**
  476. * Extends mxShape.
  477. */
  478. function mxArchiMate3Interface(bounds, fill, stroke, strokewidth)
  479. {
  480. mxShape.call(this);
  481. this.bounds = bounds;
  482. this.fill = fill;
  483. this.stroke = stroke;
  484. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  485. };
  486. /**
  487. * Extends mxShape.
  488. */
  489. mxUtils.extend(mxArchiMate3Interface, mxShape);
  490. mxArchiMate3Interface.prototype.cst = {
  491. INTERFACE : 'mxgraph.archimate3.interface'
  492. };
  493. /**
  494. * Function: paintVertexShape
  495. *
  496. * Paints the vertex shape.
  497. */
  498. mxArchiMate3Interface.prototype.paintVertexShape = function(c, x, y, w, h)
  499. {
  500. c.translate(x, y);
  501. this.background(c, 0, 0, w, h);
  502. c.setShadow(false);
  503. };
  504. mxArchiMate3Interface.prototype.background = function(c, x, y, w, h)
  505. {
  506. c.ellipse(w * 0.5, 0, w * 0.5, h);
  507. c.fillAndStroke();
  508. c.begin();
  509. c.moveTo(0, h * 0.5);
  510. c.lineTo(w * 0.5, h * 0.5);
  511. c.stroke();
  512. };
  513. mxCellRenderer.registerShape(mxArchiMate3Interface.prototype.cst.INTERFACE, mxArchiMate3Interface);
  514. //**********************************************************************************************************************************************************
  515. //Process
  516. //**********************************************************************************************************************************************************
  517. /**
  518. * Extends mxShape.
  519. */
  520. function mxArchiMate3Process(bounds, fill, stroke, strokewidth)
  521. {
  522. mxShape.call(this);
  523. this.bounds = bounds;
  524. this.fill = fill;
  525. this.stroke = stroke;
  526. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  527. };
  528. /**
  529. * Extends mxShape.
  530. */
  531. mxUtils.extend(mxArchiMate3Process, mxShape);
  532. mxArchiMate3Process.prototype.cst = {
  533. PROCESS : 'mxgraph.archimate3.process'
  534. };
  535. /**
  536. * Function: paintVertexShape
  537. *
  538. * Paints the vertex shape.
  539. */
  540. mxArchiMate3Process.prototype.paintVertexShape = function(c, x, y, w, h)
  541. {
  542. c.translate(x, y);
  543. this.background(c, 0, 0, w, h);
  544. c.setShadow(false);
  545. };
  546. mxArchiMate3Process.prototype.background = function(c, x, y, w, h)
  547. {
  548. c.begin();
  549. c.moveTo(0, h * 0.3);
  550. c.lineTo(w * 0.6, h * 0.3);
  551. c.lineTo(w * 0.6, 0);
  552. c.lineTo(w, h * 0.5);
  553. c.lineTo(w * 0.6, h);
  554. c.lineTo(w * 0.6, h * 0.7);
  555. c.lineTo(0, h * 0.7);
  556. c.close();
  557. c.fillAndStroke();
  558. };
  559. mxCellRenderer.registerShape(mxArchiMate3Process.prototype.cst.PROCESS, mxArchiMate3Process);
  560. //**********************************************************************************************************************************************************
  561. //Function
  562. //**********************************************************************************************************************************************************
  563. /**
  564. * Extends mxShape.
  565. */
  566. function mxArchiMate3Function(bounds, fill, stroke, strokewidth)
  567. {
  568. mxShape.call(this);
  569. this.bounds = bounds;
  570. this.fill = fill;
  571. this.stroke = stroke;
  572. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  573. };
  574. /**
  575. * Extends mxShape.
  576. */
  577. mxUtils.extend(mxArchiMate3Function, mxShape);
  578. mxArchiMate3Function.prototype.cst = {
  579. FUNCTION : 'mxgraph.archimate3.function'
  580. };
  581. /**
  582. * Function: paintVertexShape
  583. *
  584. * Paints the vertex shape.
  585. */
  586. mxArchiMate3Function.prototype.paintVertexShape = function(c, x, y, w, h)
  587. {
  588. c.translate(x, y);
  589. this.background(c, 0, 0, w, h);
  590. c.setShadow(false);
  591. };
  592. mxArchiMate3Function.prototype.background = function(c, x, y, w, h)
  593. {
  594. c.begin();
  595. c.moveTo(w * 0.5, 0);
  596. c.lineTo(w, h * 0.2);
  597. c.lineTo(w, h);
  598. c.lineTo(w * 0.5, h * 0.8);
  599. c.lineTo(0, h);
  600. c.lineTo(0, h * 0.2);
  601. c.close();
  602. c.fillAndStroke();
  603. };
  604. mxCellRenderer.registerShape(mxArchiMate3Function.prototype.cst.FUNCTION, mxArchiMate3Function);
  605. //**********************************************************************************************************************************************************
  606. //Interaction
  607. //**********************************************************************************************************************************************************
  608. /**
  609. * Extends mxShape.
  610. */
  611. function mxArchiMate3Interaction(bounds, fill, stroke, strokewidth)
  612. {
  613. mxShape.call(this);
  614. this.bounds = bounds;
  615. this.fill = fill;
  616. this.stroke = stroke;
  617. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  618. };
  619. /**
  620. * Extends mxShape.
  621. */
  622. mxUtils.extend(mxArchiMate3Interaction, mxShape);
  623. mxArchiMate3Interaction.prototype.cst = {
  624. INTERACTION : 'mxgraph.archimate3.interaction'
  625. };
  626. /**
  627. * Function: paintVertexShape
  628. *
  629. * Paints the vertex shape.
  630. */
  631. mxArchiMate3Interaction.prototype.paintVertexShape = function(c, x, y, w, h)
  632. {
  633. c.translate(x, y);
  634. this.background(c, 0, 0, w, h);
  635. c.setShadow(false);
  636. };
  637. mxArchiMate3Interaction.prototype.background = function(c, x, y, w, h)
  638. {
  639. c.begin();
  640. c.moveTo(w * 0.55, 0);
  641. c.arcTo(w * 0.45, h * 0.5, 0, 0, 1, w * 0.55, h);
  642. c.close();
  643. c.moveTo(w * 0.45, 0);
  644. c.arcTo(w * 0.45, h * 0.5, 0, 0, 0, w * 0.45, h);
  645. c.close();
  646. c.fillAndStroke();
  647. };
  648. mxCellRenderer.registerShape(mxArchiMate3Interaction.prototype.cst.INTERACTION, mxArchiMate3Interaction);
  649. //**********************************************************************************************************************************************************
  650. //Service
  651. //**********************************************************************************************************************************************************
  652. /**
  653. * Extends mxShape.
  654. */
  655. function mxArchiMate3Service(bounds, fill, stroke, strokewidth)
  656. {
  657. mxShape.call(this);
  658. this.bounds = bounds;
  659. this.fill = fill;
  660. this.stroke = stroke;
  661. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  662. };
  663. /**
  664. * Extends mxShape.
  665. */
  666. mxUtils.extend(mxArchiMate3Service, mxShape);
  667. mxArchiMate3Service.prototype.cst = {
  668. SERVICE : 'mxgraph.archimate3.service'
  669. };
  670. /**
  671. * Function: paintVertexShape
  672. *
  673. * Paints the vertex shape.
  674. */
  675. mxArchiMate3Service.prototype.paintVertexShape = function(c, x, y, w, h)
  676. {
  677. c.translate(x, y);
  678. this.background(c, 0, 0, w, h);
  679. c.setShadow(false);
  680. };
  681. mxArchiMate3Service.prototype.background = function(c, x, y, w, h)
  682. {
  683. c.begin();
  684. c.moveTo(w - h * 0.5, 0);
  685. c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w - h * 0.5, h);
  686. c.lineTo(h * 0.5, h);
  687. c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, h * 0.5, 0);
  688. c.close();
  689. c.fillAndStroke();
  690. };
  691. mxCellRenderer.registerShape(mxArchiMate3Service.prototype.cst.SERVICE, mxArchiMate3Service);
  692. //**********************************************************************************************************************************************************
  693. //Requirement
  694. //**********************************************************************************************************************************************************
  695. /**
  696. * Extends mxShape.
  697. */
  698. function mxArchiMate3Requirement(bounds, fill, stroke, strokewidth)
  699. {
  700. mxShape.call(this);
  701. this.bounds = bounds;
  702. this.fill = fill;
  703. this.stroke = stroke;
  704. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  705. };
  706. /**
  707. * Extends mxShape.
  708. */
  709. mxUtils.extend(mxArchiMate3Requirement, mxShape);
  710. mxArchiMate3Requirement.prototype.cst = {
  711. REQUIREMENT : 'mxgraph.archimate3.requirement'
  712. };
  713. /**
  714. * Function: paintVertexShape
  715. *
  716. * Paints the vertex shape.
  717. */
  718. mxArchiMate3Requirement.prototype.paintVertexShape = function(c, x, y, w, h)
  719. {
  720. c.translate(x, y);
  721. this.background(c, 0, 0, w, h);
  722. c.setShadow(false);
  723. };
  724. mxArchiMate3Requirement.prototype.background = function(c, x, y, w, h)
  725. {
  726. c.begin();
  727. c.moveTo(w * 0.25, 0);
  728. c.lineTo(w, 0);
  729. c.lineTo(w * 0.75, h);
  730. c.lineTo(0, h);
  731. c.close();
  732. c.fillAndStroke();
  733. };
  734. mxCellRenderer.registerShape(mxArchiMate3Requirement.prototype.cst.REQUIREMENT, mxArchiMate3Requirement);
  735. //**********************************************************************************************************************************************************
  736. //Constraint
  737. //**********************************************************************************************************************************************************
  738. /**
  739. * Extends mxShape.
  740. */
  741. function mxArchiMate3Constraint(bounds, fill, stroke, strokewidth)
  742. {
  743. mxShape.call(this);
  744. this.bounds = bounds;
  745. this.fill = fill;
  746. this.stroke = stroke;
  747. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  748. };
  749. /**
  750. * Extends mxShape.
  751. */
  752. mxUtils.extend(mxArchiMate3Constraint, mxShape);
  753. mxArchiMate3Constraint.prototype.cst = {
  754. CONSTRAINT : 'mxgraph.archimate3.constraint'
  755. };
  756. /**
  757. * Function: paintVertexShape
  758. *
  759. * Paints the vertex shape.
  760. */
  761. mxArchiMate3Constraint.prototype.paintVertexShape = function(c, x, y, w, h)
  762. {
  763. c.translate(x, y);
  764. this.background(c, 0, 0, w, h);
  765. c.setShadow(false);
  766. };
  767. mxArchiMate3Constraint.prototype.background = function(c, x, y, w, h)
  768. {
  769. c.begin();
  770. c.moveTo(w * 0.25, 0);
  771. c.lineTo(w, 0);
  772. c.lineTo(w * 0.75, h);
  773. c.lineTo(0, h);
  774. c.close();
  775. c.moveTo(w * 0.45, 0);
  776. c.lineTo(w * 0.2, h);
  777. c.fillAndStroke();
  778. };
  779. mxCellRenderer.registerShape(mxArchiMate3Constraint.prototype.cst.CONSTRAINT, mxArchiMate3Constraint);
  780. //**********************************************************************************************************************************************************
  781. //Event
  782. //**********************************************************************************************************************************************************
  783. /**
  784. * Extends mxShape.
  785. */
  786. function mxArchiMate3Event(bounds, fill, stroke, strokewidth)
  787. {
  788. mxShape.call(this);
  789. this.bounds = bounds;
  790. this.fill = fill;
  791. this.stroke = stroke;
  792. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  793. };
  794. /**
  795. * Extends mxShape.
  796. */
  797. mxUtils.extend(mxArchiMate3Event, mxShape);
  798. mxArchiMate3Event.prototype.cst = {
  799. EVENT : 'mxgraph.archimate3.event'
  800. };
  801. /**
  802. * Function: paintVertexShape
  803. *
  804. * Paints the vertex shape.
  805. */
  806. mxArchiMate3Event.prototype.paintVertexShape = function(c, x, y, w, h)
  807. {
  808. c.translate(x, y);
  809. this.background(c, 0, 0, w, h);
  810. c.setShadow(false);
  811. };
  812. mxArchiMate3Event.prototype.background = function(c, x, y, w, h)
  813. {
  814. c.begin();
  815. c.moveTo(w - h * 0.5, 0);
  816. c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w - h * 0.5, h);
  817. c.lineTo(0, h);
  818. c.lineTo(h * 0.5, h * 0.5);
  819. c.lineTo(0, 0);
  820. c.close();
  821. c.fillAndStroke();
  822. };
  823. mxCellRenderer.registerShape(mxArchiMate3Event.prototype.cst.EVENT, mxArchiMate3Event);
  824. //**********************************************************************************************************************************************************
  825. //Event 2
  826. //**********************************************************************************************************************************************************
  827. /**
  828. * Extends mxShape.
  829. */
  830. function mxArchiMate3Event2(bounds, fill, stroke, strokewidth)
  831. {
  832. mxShape.call(this);
  833. this.bounds = bounds;
  834. this.fill = fill;
  835. this.stroke = stroke;
  836. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  837. };
  838. /**
  839. * Extends mxShape.
  840. */
  841. mxUtils.extend(mxArchiMate3Event2, mxShape);
  842. mxArchiMate3Event2.prototype.cst = {
  843. EVENT2 : 'mxgraph.archimate3.event2'
  844. };
  845. /**
  846. * Function: paintVertexShape
  847. *
  848. * Paints the vertex shape.
  849. */
  850. mxArchiMate3Event2.prototype.paintVertexShape = function(c, x, y, w, h)
  851. {
  852. c.translate(x, y);
  853. this.background(c, 0, 0, w, h);
  854. c.setShadow(false);
  855. };
  856. mxArchiMate3Event2.prototype.background = function(c, x, y, w, h)
  857. {
  858. c.begin();
  859. c.moveTo(w - h * 0.5, 0);
  860. c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w - h * 0.5, h);
  861. c.lineTo(0, h);
  862. c.arcTo(h * 0.5, h * 0.5, 0, 0, 0, 0, 0);
  863. c.close();
  864. c.fillAndStroke();
  865. };
  866. mxCellRenderer.registerShape(mxArchiMate3Event2.prototype.cst.EVENT2, mxArchiMate3Event2);
  867. //**********************************************************************************************************************************************************
  868. //Actor
  869. //**********************************************************************************************************************************************************
  870. /**
  871. * Extends mxShape.
  872. */
  873. function mxArchiMate3Actor(bounds, fill, stroke, strokewidth)
  874. {
  875. mxShape.call(this);
  876. this.bounds = bounds;
  877. this.fill = fill;
  878. this.stroke = stroke;
  879. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  880. };
  881. /**
  882. * Extends mxShape.
  883. */
  884. mxUtils.extend(mxArchiMate3Actor, mxShape);
  885. mxArchiMate3Actor.prototype.cst = {
  886. ACTOR : 'mxgraph.archimate3.actor'
  887. };
  888. /**
  889. * Function: paintVertexShape
  890. *
  891. * Paints the vertex shape.
  892. */
  893. mxArchiMate3Actor.prototype.paintVertexShape = function(c, x, y, w, h)
  894. {
  895. c.translate(x, y);
  896. this.background(c, 0, 0, w, h);
  897. c.setShadow(false);
  898. };
  899. mxArchiMate3Actor.prototype.background = function(c, x, y, w, h)
  900. {
  901. c.ellipse(w * 0.2, 0, w * 0.6, h * 0.3);
  902. c.fillAndStroke();
  903. c.begin();
  904. c.moveTo(w * 0.5, h * 0.3);
  905. c.lineTo(w * 0.5, h * 0.75);
  906. c.moveTo(0, h * 0.45);
  907. c.lineTo(w, h * 0.45);
  908. c.moveTo(0, h);
  909. c.lineTo(w * 0.5, h * 0.75);
  910. c.lineTo(w, h);
  911. c.stroke();
  912. };
  913. mxCellRenderer.registerShape(mxArchiMate3Actor.prototype.cst.ACTOR, mxArchiMate3Actor);
  914. //**********************************************************************************************************************************************************
  915. //Role
  916. //**********************************************************************************************************************************************************
  917. /**
  918. * Extends mxShape.
  919. */
  920. function mxArchiMate3Role(bounds, fill, stroke, strokewidth)
  921. {
  922. mxShape.call(this);
  923. this.bounds = bounds;
  924. this.fill = fill;
  925. this.stroke = stroke;
  926. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  927. };
  928. /**
  929. * Extends mxShape.
  930. */
  931. mxUtils.extend(mxArchiMate3Role, mxShape);
  932. mxArchiMate3Role.prototype.cst = {
  933. ROLE : 'mxgraph.archimate3.role'
  934. };
  935. /**
  936. * Function: paintVertexShape
  937. *
  938. * Paints the vertex shape.
  939. */
  940. mxArchiMate3Role.prototype.paintVertexShape = function(c, x, y, w, h)
  941. {
  942. c.translate(x, y);
  943. this.background(c, 0, 0, w, h);
  944. c.setShadow(false);
  945. };
  946. mxArchiMate3Role.prototype.background = function(c, x, y, w, h)
  947. {
  948. c.begin();
  949. c.moveTo(w * 0.8, 0);
  950. c.lineTo(w * 0.2, 0);
  951. c.arcTo(w * 0.2, h * 0.5, 0, 0, 0, w * 0.2, h);
  952. c.lineTo(w * 0.8, h);
  953. c.fillAndStroke();
  954. c.ellipse(w * 0.6, 0, w * 0.4, h);
  955. c.fillAndStroke();
  956. };
  957. mxCellRenderer.registerShape(mxArchiMate3Role.prototype.cst.ROLE, mxArchiMate3Role);
  958. //**********************************************************************************************************************************************************
  959. //Business Object
  960. //**********************************************************************************************************************************************************
  961. /**
  962. * Extends mxShape.
  963. */
  964. function mxArchiMate3BusinessObject(bounds, fill, stroke, strokewidth)
  965. {
  966. mxShape.call(this);
  967. this.bounds = bounds;
  968. this.fill = fill;
  969. this.stroke = stroke;
  970. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  971. };
  972. /**
  973. * Extends mxShape.
  974. */
  975. mxUtils.extend(mxArchiMate3BusinessObject, mxShape);
  976. mxArchiMate3BusinessObject.prototype.cst = {
  977. BUSINESS_OBJECT : 'mxgraph.archimate3.businessObject'
  978. };
  979. /**
  980. * Function: paintVertexShape
  981. *
  982. * Paints the vertex shape.
  983. */
  984. mxArchiMate3BusinessObject.prototype.paintVertexShape = function(c, x, y, w, h)
  985. {
  986. c.translate(x, y);
  987. this.background(c, 0, 0, w, h);
  988. c.setShadow(false);
  989. this.foreground(c, 0, 0, w, h);
  990. };
  991. mxArchiMate3BusinessObject.prototype.background = function(c, x, y, w, h)
  992. {
  993. c.rect(0, 0, w, h);
  994. c.fillAndStroke();
  995. };
  996. mxArchiMate3BusinessObject.prototype.foreground = function(c, x, y, w, h)
  997. {
  998. if (h >= 15)
  999. {
  1000. c.begin();
  1001. c.moveTo(0, 15);
  1002. c.lineTo(w, 15);
  1003. c.stroke();
  1004. }
  1005. };
  1006. mxCellRenderer.registerShape(mxArchiMate3BusinessObject.prototype.cst.BUSINESS_OBJECT, mxArchiMate3BusinessObject);
  1007. //**********************************************************************************************************************************************************
  1008. //Contract
  1009. //**********************************************************************************************************************************************************
  1010. /**
  1011. * Extends mxShape.
  1012. */
  1013. function mxArchiMate3Contract(bounds, fill, stroke, strokewidth)
  1014. {
  1015. mxShape.call(this);
  1016. this.bounds = bounds;
  1017. this.fill = fill;
  1018. this.stroke = stroke;
  1019. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1020. };
  1021. /**
  1022. * Extends mxShape.
  1023. */
  1024. mxUtils.extend(mxArchiMate3Contract, mxShape);
  1025. mxArchiMate3Contract.prototype.cst = {
  1026. CONTRACT : 'mxgraph.archimate3.contract'
  1027. };
  1028. /**
  1029. * Function: paintVertexShape
  1030. *
  1031. * Paints the vertex shape.
  1032. */
  1033. mxArchiMate3Contract.prototype.paintVertexShape = function(c, x, y, w, h)
  1034. {
  1035. c.translate(x, y);
  1036. this.background(c, 0, 0, w, h);
  1037. c.setShadow(false);
  1038. this.foreground(c, 0, 0, w, h);
  1039. };
  1040. mxArchiMate3Contract.prototype.background = function(c, x, y, w, h)
  1041. {
  1042. c.rect(0, 0, w, h);
  1043. c.fillAndStroke();
  1044. };
  1045. mxArchiMate3Contract.prototype.foreground = function(c, x, y, w, h)
  1046. {
  1047. if (h >= 15)
  1048. {
  1049. c.begin();
  1050. c.moveTo(0, 15);
  1051. c.lineTo(w, 15);
  1052. c.stroke();
  1053. }
  1054. if (h >= 30)
  1055. {
  1056. c.begin();
  1057. c.moveTo(0, h - 15);
  1058. c.lineTo(w, h - 15);
  1059. c.stroke();
  1060. }
  1061. };
  1062. mxCellRenderer.registerShape(mxArchiMate3Contract.prototype.cst.CONTRACT, mxArchiMate3Contract);
  1063. //**********************************************************************************************************************************************************
  1064. //Product
  1065. //**********************************************************************************************************************************************************
  1066. /**
  1067. * Extends mxShape.
  1068. */
  1069. function mxArchiMate3Product(bounds, fill, stroke, strokewidth)
  1070. {
  1071. mxShape.call(this);
  1072. this.bounds = bounds;
  1073. this.fill = fill;
  1074. this.stroke = stroke;
  1075. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1076. };
  1077. /**
  1078. * Extends mxShape.
  1079. */
  1080. mxUtils.extend(mxArchiMate3Product, mxShape);
  1081. mxArchiMate3Product.prototype.cst = {
  1082. PRODUCT : 'mxgraph.archimate3.product'
  1083. };
  1084. /**
  1085. * Function: paintVertexShape
  1086. *
  1087. * Paints the vertex shape.
  1088. */
  1089. mxArchiMate3Product.prototype.paintVertexShape = function(c, x, y, w, h)
  1090. {
  1091. c.translate(x, y);
  1092. this.background(c, 0, 0, w, h);
  1093. c.setShadow(false);
  1094. this.foreground(c, 0, 0, w, h);
  1095. };
  1096. mxArchiMate3Product.prototype.background = function(c, x, y, w, h)
  1097. {
  1098. c.rect(0, 0, w, h);
  1099. c.fillAndStroke();
  1100. };
  1101. mxArchiMate3Product.prototype.foreground = function(c, x, y, w, h)
  1102. {
  1103. if (h >= 15)
  1104. {
  1105. c.begin();
  1106. c.moveTo(0, 15);
  1107. c.lineTo(w * 0.6, 15);
  1108. c.lineTo(w * 0.6, 0);
  1109. c.stroke();
  1110. }
  1111. };
  1112. mxCellRenderer.registerShape(mxArchiMate3Product.prototype.cst.PRODUCT, mxArchiMate3Product);
  1113. //**********************************************************************************************************************************************************
  1114. //Representation
  1115. //**********************************************************************************************************************************************************
  1116. /**
  1117. * Extends mxShape.
  1118. */
  1119. function mxArchiMate3Representation(bounds, fill, stroke, strokewidth)
  1120. {
  1121. mxShape.call(this);
  1122. this.bounds = bounds;
  1123. this.fill = fill;
  1124. this.stroke = stroke;
  1125. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1126. };
  1127. /**
  1128. * Extends mxShape.
  1129. */
  1130. mxUtils.extend(mxArchiMate3Representation, mxShape);
  1131. mxArchiMate3Representation.prototype.cst = {
  1132. REPRESENTATION : 'mxgraph.archimate3.representation'
  1133. };
  1134. /**
  1135. * Function: paintVertexShape
  1136. *
  1137. * Paints the vertex shape.
  1138. */
  1139. mxArchiMate3Representation.prototype.paintVertexShape = function(c, x, y, w, h)
  1140. {
  1141. c.translate(x, y);
  1142. this.background(c, 0, 0, w, h);
  1143. };
  1144. mxArchiMate3Representation.prototype.background = function(c, x, y, w, h)
  1145. {
  1146. c.begin();
  1147. c.moveTo(0, 0);
  1148. c.lineTo(w, 0);
  1149. c.lineTo(w, h * 0.85);
  1150. c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
  1151. c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
  1152. c.close();
  1153. c.fillAndStroke();
  1154. if (h >= 20)
  1155. c.begin();
  1156. c.moveTo(0, 15);
  1157. c.lineTo(w, 15);
  1158. c.stroke();
  1159. };
  1160. mxCellRenderer.registerShape(mxArchiMate3Representation.prototype.cst.REPRESENTATION, mxArchiMate3Representation);
  1161. //**********************************************************************************************************************************************************
  1162. //Deliverable
  1163. //**********************************************************************************************************************************************************
  1164. /**
  1165. * Extends mxShape.
  1166. */
  1167. function mxArchiMate3Deliverable(bounds, fill, stroke, strokewidth)
  1168. {
  1169. mxShape.call(this);
  1170. this.bounds = bounds;
  1171. this.fill = fill;
  1172. this.stroke = stroke;
  1173. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1174. };
  1175. /**
  1176. * Extends mxShape.
  1177. */
  1178. mxUtils.extend(mxArchiMate3Deliverable, mxShape);
  1179. mxArchiMate3Deliverable.prototype.cst = {
  1180. DELIVERABLE : 'mxgraph.archimate3.deliverable'
  1181. };
  1182. /**
  1183. * Function: paintVertexShape
  1184. *
  1185. * Paints the vertex shape.
  1186. */
  1187. mxArchiMate3Deliverable.prototype.paintVertexShape = function(c, x, y, w, h)
  1188. {
  1189. c.translate(x, y);
  1190. this.background(c, 0, 0, w, h);
  1191. };
  1192. mxArchiMate3Deliverable.prototype.background = function(c, x, y, w, h)
  1193. {
  1194. c.begin();
  1195. c.moveTo(0, 0);
  1196. c.lineTo(w, 0);
  1197. c.lineTo(w, h * 0.85);
  1198. c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
  1199. c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
  1200. c.close();
  1201. c.fillAndStroke();
  1202. };
  1203. mxCellRenderer.registerShape(mxArchiMate3Deliverable.prototype.cst.DELIVERABLE, mxArchiMate3Deliverable);
  1204. //**********************************************************************************************************************************************************
  1205. //Location
  1206. //**********************************************************************************************************************************************************
  1207. /**
  1208. * Extends mxShape.
  1209. */
  1210. function mxArchiMate3Location(bounds, fill, stroke, strokewidth)
  1211. {
  1212. mxShape.call(this);
  1213. this.bounds = bounds;
  1214. this.fill = fill;
  1215. this.stroke = stroke;
  1216. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1217. };
  1218. /**
  1219. * Extends mxShape.
  1220. */
  1221. mxUtils.extend(mxArchiMate3Location, mxShape);
  1222. mxArchiMate3Location.prototype.cst = {
  1223. LOCATION : 'mxgraph.archimate3.location'
  1224. };
  1225. /**
  1226. * Function: paintVertexShape
  1227. *
  1228. * Paints the vertex shape.
  1229. */
  1230. mxArchiMate3Location.prototype.paintVertexShape = function(c, x, y, w, h)
  1231. {
  1232. c.translate(x, y);
  1233. this.background(c, 0, 0, w, h);
  1234. c.setShadow(false);
  1235. c.translate(w - 20, 5);
  1236. this.foreground(c, w - 20, 5, 15, 15);
  1237. };
  1238. mxArchiMate3Location.prototype.background = function(c, x, y, w, h)
  1239. {
  1240. c.rect(0, 0, w, h);
  1241. c.fillAndStroke();
  1242. };
  1243. mxArchiMate3Location.prototype.foreground = function(c, x, y, w, h)
  1244. {
  1245. c.setDashed(false);
  1246. c.translate(3 ,0);
  1247. w = w - 6;
  1248. c.begin();
  1249. c.moveTo(w * 0.5, h);
  1250. c.arcTo(w * 0.1775, h * 0.3, 0, 0, 0, w * 0.345, h * 0.7);
  1251. c.arcTo(w * 0.538, h * 0.364, 0, 0, 1, w * 0.5, 0);
  1252. c.arcTo(w * 0.538, h * 0.364, 0, 0, 1, w * 0.655, h * 0.7);
  1253. c.arcTo(w * 0.1775, h * 0.3, 0, 0, 0, w * 0.5, h);
  1254. c.stroke();
  1255. };
  1256. mxCellRenderer.registerShape(mxArchiMate3Location.prototype.cst.LOCATION, mxArchiMate3Location);
  1257. //**********************************************************************************************************************************************************
  1258. //Gap
  1259. //**********************************************************************************************************************************************************
  1260. /**
  1261. * Extends mxShape.
  1262. */
  1263. function mxArchiMate3Gap(bounds, fill, stroke, strokewidth)
  1264. {
  1265. mxShape.call(this);
  1266. this.bounds = bounds;
  1267. this.fill = fill;
  1268. this.stroke = stroke;
  1269. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1270. };
  1271. /**
  1272. * Extends mxShape.
  1273. */
  1274. mxUtils.extend(mxArchiMate3Gap, mxShape);
  1275. mxArchiMate3Gap.prototype.cst = {
  1276. GAP : 'mxgraph.archimate3.gap'
  1277. };
  1278. /**
  1279. * Function: paintVertexShape
  1280. *
  1281. * Paints the vertex shape.
  1282. */
  1283. mxArchiMate3Gap.prototype.paintVertexShape = function(c, x, y, w, h)
  1284. {
  1285. c.translate(x, y);
  1286. this.background(c, 0, 0, w, h);
  1287. c.setShadow(false);
  1288. c.translate(w - 20, 5);
  1289. this.foreground(c, w - 20, 5, 15, 15);
  1290. };
  1291. mxArchiMate3Gap.prototype.background = function(c, x, y, w, h)
  1292. {
  1293. c.begin();
  1294. c.moveTo(0, 0);
  1295. c.lineTo(w, 0);
  1296. c.lineTo(w, h * 0.85);
  1297. c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
  1298. c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
  1299. c.close();
  1300. c.fillAndStroke();
  1301. };
  1302. mxArchiMate3Gap.prototype.foreground = function(c, x, y, w, h)
  1303. {
  1304. c.setDashed(false);
  1305. c.translate(0, 2);
  1306. h = h - 4;
  1307. c.ellipse(w * 0.15, 0, w * 0.7, h);
  1308. c.stroke();
  1309. c.begin();
  1310. c.moveTo(0, h * 0.35);
  1311. c.lineTo(w, h * 0.35);
  1312. c.moveTo(0, h * 0.65);
  1313. c.lineTo(w, h * 0.65);
  1314. c.stroke();
  1315. };
  1316. mxCellRenderer.registerShape(mxArchiMate3Gap.prototype.cst.GAP, mxArchiMate3Gap);
  1317. //**********************************************************************************************************************************************************
  1318. //Tech
  1319. //**********************************************************************************************************************************************************
  1320. /**
  1321. * Extends mxShape.
  1322. */
  1323. function mxArchiMate3Tech(bounds, fill, stroke, strokewidth)
  1324. {
  1325. mxShape.call(this);
  1326. this.bounds = bounds;
  1327. this.fill = fill;
  1328. this.stroke = stroke;
  1329. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1330. };
  1331. /**
  1332. * Extends mxShape.
  1333. */
  1334. mxUtils.extend(mxArchiMate3Tech, mxShape);
  1335. mxArchiMate3Tech.prototype.cst = {
  1336. TECH : 'mxgraph.archimate3.tech',
  1337. TYPE : 'techType',
  1338. DEVICE : 'device',
  1339. PLATEAU : 'plateau',
  1340. FACILITY : 'facility',
  1341. EQUIPMENT : 'equipment',
  1342. SYS_SW : 'sysSw'
  1343. };
  1344. /**
  1345. * Function: paintVertexShape
  1346. *
  1347. * Paints the vertex shape.
  1348. */
  1349. mxArchiMate3Tech.prototype.paintVertexShape = function(c, x, y, w, h)
  1350. {
  1351. c.translate(x, y);
  1352. this.background(c, 0, 0, w, h);
  1353. c.setShadow(false);
  1354. c.translate(w - 30, 15);
  1355. this.foreground(c, w - 30, 15, 15, 15);
  1356. };
  1357. mxArchiMate3Tech.prototype.background = function(c, x, y, w, h)
  1358. {
  1359. c.begin();
  1360. c.moveTo(0, 10);
  1361. c.lineTo(10, 0);
  1362. c.lineTo(w, 0);
  1363. c.lineTo(w, h - 10);
  1364. c.lineTo(w - 10, h);
  1365. c.lineTo(0, h);
  1366. c.close();
  1367. c.moveTo(0, 10);
  1368. c.lineTo(w - 10, 10);
  1369. c.lineTo(w - 10, h);
  1370. c.moveTo(w, 0);
  1371. c.lineTo(w - 10, 10);
  1372. c.fillAndStroke();
  1373. };
  1374. mxArchiMate3Tech.prototype.foreground = function(c, x, y, w, h)
  1375. {
  1376. var type = mxUtils.getValue(this.style, mxArchiMate3Tech.prototype.cst.TYPE, mxArchiMate3Tech.prototype.cst.DEVICE);
  1377. c.setDashed(false);
  1378. if (type === mxArchiMate3Tech.prototype.cst.PLATEAU)
  1379. {
  1380. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1381. c.setFillColor(strokeColor);
  1382. c.rect(w * 0.4, 0, w * 0.6, h * 0.2);
  1383. c.fill();
  1384. c.rect(w * 0.2, h * 0.4, w * 0.6, h * 0.2);
  1385. c.fill();
  1386. c.rect(0, h * 0.8, w * 0.6, h * 0.2);
  1387. c.fill();
  1388. }
  1389. else if (type === mxArchiMate3Tech.prototype.cst.FACILITY)
  1390. {
  1391. c.begin();
  1392. c.moveTo(0, h);
  1393. c.lineTo(0, 0);
  1394. c.lineTo(w * 0.13, 0);
  1395. c.lineTo(w * 0.13, h * 0.7);
  1396. c.lineTo(w * 0.42, h * 0.55);
  1397. c.lineTo(w * 0.42, h * 0.7);
  1398. c.lineTo(w * 0.71, h * 0.55);
  1399. c.lineTo(w * 0.71, h * 0.7);
  1400. c.lineTo(w, h * 0.55);
  1401. c.lineTo(w, h);
  1402. c.close();
  1403. c.stroke();
  1404. }
  1405. else if (type === mxArchiMate3Tech.prototype.cst.EQUIPMENT)
  1406. {
  1407. c.begin();
  1408. c.moveTo(w * 0.72, h * 0.38);
  1409. c.curveTo(w * 0.78, w * 0.38, w * 0.85, h * 0.34, w * 0.85, h * 0.26);
  1410. c.curveTo(w * 0.85, w * 0.18, w * 0.78, h * 0.14, w * 0.73, h * 0.14);
  1411. c.curveTo(w * 0.64, w * 0.14, w * 0.59, h * 0.2, w * 0.59, h * 0.26);
  1412. c.curveTo(w * 0.59, h * 0.33, w * 0.65, w * 0.38, w * 0.72, h * 0.38);
  1413. c.close();
  1414. c.moveTo(w * 0.68, h * 0.52);
  1415. c.lineTo(w * 0.67, h * 0.45);
  1416. c.lineTo(w * 0.61, h * 0.43);
  1417. c.lineTo(w * 0.56, h * 0.48);
  1418. c.lineTo(w * 0.5, h * 0.42);
  1419. c.lineTo(w * 0.54, h * 0.36);
  1420. c.lineTo(w * 0.52, h * 0.31);
  1421. c.lineTo(w * 0.45, h * 0.31);
  1422. c.lineTo(w * 0.45, h * 0.22);
  1423. c.lineTo(w * 0.52, h * 0.21);
  1424. c.lineTo(w * 0.54, h * 0.16);
  1425. c.lineTo(w * 0.5, h * 0.11);
  1426. c.lineTo(w * 0.56, h * 0.05);
  1427. c.lineTo(w * 0.62, h * 0.09);
  1428. c.lineTo(w * 0.67, h * 0.07);
  1429. c.lineTo(w * 0.68, 0);
  1430. c.lineTo(w * 0.77, 0);
  1431. c.lineTo(w * 0.78, h * 0.07);
  1432. c.lineTo(w * 0.83, h * 0.09);
  1433. c.lineTo(w * 0.89, h * 0.05);
  1434. c.lineTo(w * 0.95, h * 0.11);
  1435. c.lineTo(w * 0.91, h * 0.16);
  1436. c.lineTo(w * 0.93, h * 0.21);
  1437. c.lineTo(w, h * 0.22);
  1438. c.lineTo(w, h * 0.31);
  1439. c.lineTo(w * 0.93, h * 0.31);
  1440. c.lineTo(w * 0.91, h * 0.36);
  1441. c.lineTo(w * 0.95, h * 0.41);
  1442. c.lineTo(w * 0.89, h * 0.47);
  1443. c.lineTo(w * 0.83, h * 0.43);
  1444. c.lineTo(w * 0.78, h * 0.45);
  1445. c.lineTo(w * 0.77, h * 0.52);
  1446. c.lineTo(w * 0.68, h * 0.52);
  1447. c.close();
  1448. c.moveTo(w * 0.36, h * 0.81);
  1449. c.curveTo(w * 0.44, h * 0.81, w * 0.52, h * 0.75, w * 0.52, h * 0.67);
  1450. c.curveTo(w * 0.52, h * 0.59, w * 0.45, h * 0.51, w * 0.35, h * 0.51);
  1451. c.curveTo(w * 0.27, h * 0.51, w * 0.19, h * 0.58, w * 0.19, h * 0.67);
  1452. c.curveTo(w * 0.19, h * 0.74, w * 0.27, h * 0.82, w * 0.36, h * 0.81);
  1453. c.close();
  1454. c.moveTo(w * 0.21, h * 0.98);
  1455. c.lineTo(w * 0.22, h * 0.89);
  1456. c.lineTo(w * 0.16, h * 0.85);
  1457. c.lineTo(w * 0.08, h * 0.88);
  1458. c.lineTo(w * 0.02, h * 0.79);
  1459. c.lineTo(w * 0.09, h * 0.74);
  1460. c.lineTo(w * 0.08, h * 0.67);
  1461. c.lineTo(0, h * 0.63);
  1462. c.lineTo(w * 0.03, h * 0.53);
  1463. c.lineTo(w * 0.12, h * 0.54);
  1464. c.lineTo(w * 0.16, h * 0.48);
  1465. c.lineTo(w * 0.13, h * 0.4);
  1466. c.lineTo(w * 0.22, h * 0.35);
  1467. c.lineTo(w * 0.28, h * 0.42);
  1468. c.lineTo(w * 0.36, h * 0.41);
  1469. c.lineTo(w * 0.39, h * 0.33);
  1470. c.lineTo(w * 0.5, h * 0.36);
  1471. c.lineTo(w * 0.49, h * 0.45);
  1472. c.lineTo(w * 0.55, h * 0.49);
  1473. c.lineTo(w * 0.63, h * 0.45);
  1474. c.lineTo(w * 0.69, h * 0.54);
  1475. c.lineTo(w * 0.62, h * 0.6);
  1476. c.lineTo(w * 0.63, h * 0.67);
  1477. c.lineTo(w * 0.71, h * 0.7);
  1478. c.lineTo(w * 0.68, h * 0.8);
  1479. c.lineTo(w * 0.59, h * 0.79);
  1480. c.lineTo(w * 0.55, h * 0.85);
  1481. c.lineTo(w * 0.59, h * 0.79);
  1482. c.lineTo(w * 0.55, h * 0.85);
  1483. c.lineTo(w * 0.59, h * 0.93);
  1484. c.lineTo(w * 0.49, h * 0.98);
  1485. c.lineTo(w * 0.43, h * 0.91);
  1486. c.lineTo(w * 0.36, h * 0.92);
  1487. c.lineTo(w * 0.32, h);
  1488. c.lineTo(w * 0.21, h * 0.98);
  1489. c.close();
  1490. c.stroke();
  1491. }
  1492. else if (type === mxArchiMate3Tech.prototype.cst.SYS_SW)
  1493. {
  1494. mxArchiMate3SysSw.prototype.background(c, x, y, w, h);
  1495. }
  1496. else if (type === mxArchiMate3Tech.prototype.cst.DEVICE)
  1497. {
  1498. mxArchiMate3Device.prototype.background(c, x, y, w, h);
  1499. }
  1500. };
  1501. mxCellRenderer.registerShape(mxArchiMate3Tech.prototype.cst.TECH, mxArchiMate3Tech);
  1502. //**********************************************************************************************************************************************************
  1503. //Distribution
  1504. //**********************************************************************************************************************************************************
  1505. /**
  1506. * Extends mxShape.
  1507. */
  1508. function mxArchiMate3Distribution(bounds, fill, stroke, strokewidth)
  1509. {
  1510. mxShape.call(this);
  1511. this.bounds = bounds;
  1512. this.fill = fill;
  1513. this.stroke = stroke;
  1514. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1515. };
  1516. /**
  1517. * Extends mxShape.
  1518. */
  1519. mxUtils.extend(mxArchiMate3Distribution, mxShape);
  1520. mxArchiMate3Distribution.prototype.cst = {
  1521. DISTRIBUTION : 'mxgraph.archimate3.distribution'
  1522. };
  1523. /**
  1524. * Function: paintVertexShape
  1525. *
  1526. * Paints the vertex shape.
  1527. */
  1528. mxArchiMate3Distribution.prototype.paintVertexShape = function(c, x, y, w, h)
  1529. {
  1530. c.translate(x, y);
  1531. this.background(c, 0, 0, w, h);
  1532. c.setShadow(false);
  1533. };
  1534. mxArchiMate3Distribution.prototype.background = function(c, x, y, w, h)
  1535. {
  1536. c.begin();
  1537. c.moveTo(w * 0.1, h * 0.25);
  1538. c.lineTo(w * 0.9, h * 0.25);
  1539. c.lineTo(w, h * 0.5);
  1540. c.lineTo(w * 0.9, h * 0.75);
  1541. c.lineTo(w * 0.1, h * 0.75);
  1542. c.lineTo(0, h * 0.5);
  1543. c.fillAndStroke();
  1544. c.begin();
  1545. c.moveTo(w * 0.2, 0);
  1546. c.lineTo(0, h * 0.5);
  1547. c.lineTo(w * 0.2, h);
  1548. c.moveTo(w * 0.8, 0);
  1549. c.lineTo(w, h * 0.5);
  1550. c.lineTo(w * 0.8, h);
  1551. c.stroke();
  1552. };
  1553. mxCellRenderer.registerShape(mxArchiMate3Distribution.prototype.cst.DISTRIBUTION, mxArchiMate3Distribution);
  1554. //**********************************************************************************************************************************************************
  1555. //Resource
  1556. //**********************************************************************************************************************************************************
  1557. /**
  1558. * Extends mxShape.
  1559. */
  1560. function mxArchiMate3Resource(bounds, fill, stroke, strokewidth)
  1561. {
  1562. mxShape.call(this);
  1563. this.bounds = bounds;
  1564. this.fill = fill;
  1565. this.stroke = stroke;
  1566. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1567. };
  1568. /**
  1569. * Extends mxShape.
  1570. */
  1571. mxUtils.extend(mxArchiMate3Resource, mxShape);
  1572. mxArchiMate3Resource.prototype.cst = {
  1573. RESOURCE : 'mxgraph.archimate3.resource'
  1574. };
  1575. /**
  1576. * Function: paintVertexShape
  1577. *
  1578. * Paints the vertex shape.
  1579. */
  1580. mxArchiMate3Resource.prototype.paintVertexShape = function(c, x, y, w, h)
  1581. {
  1582. c.translate(x, y);
  1583. this.background(c, 0, 0, w, h);
  1584. c.setShadow(false);
  1585. };
  1586. mxArchiMate3Resource.prototype.background = function(c, x, y, w, h)
  1587. {
  1588. c.begin();
  1589. c.moveTo(w * 0.51, h * 0.34);
  1590. c.lineTo(w * 0.51, h * 0.65);
  1591. c.moveTo(w * 0.35, h * 0.34);
  1592. c.lineTo(w * 0.35, h * 0.65);
  1593. c.moveTo(w * 0.19, h * 0.34);
  1594. c.lineTo(w * 0.19, h * 0.65);
  1595. c.moveTo(w * 0.91, h * 0.4);
  1596. c.curveTo(w * 0.93, h * 0.39, w * 0.95, h * 0.39, w * 0.97, h * 0.40);
  1597. c.curveTo(w * 0.99, h * 0.4, w, h * 0.41, w, h * 0.43);
  1598. c.curveTo(w, h * 0.48, w, h * 0.52, w, h * 0.57);
  1599. c.curveTo(w, h * 0.58, w * 0.99, h * 0.59, w * 0.98, h * 0.6);
  1600. c.curveTo(w * 0.96, h * 0.6, w * 0.93, h * 0.6, w * 0.91, h * 0.6);
  1601. c.moveTo(0, h * 0.73);
  1602. c.curveTo(0, h * 0.6, 0, h * 0.43, 0, h * 0.27);
  1603. c.curveTo(0, h * 0.24, w * 0.03, h * 0.21, w * 0.08, h * 0.21);
  1604. c.curveTo(w * 0.33, h * 0.2, w * 0.61, h * 0.2, w * 0.84, h * 0.21);
  1605. c.curveTo(w * 0.88, h * 0.22, w * 0.89, h * 0.24, w * 0.9, h * 0.26);
  1606. c.curveTo(w * 0.91, h * 0.41, w * 0.91, h * 0.57, w * 0.9, h * 0.72);
  1607. c.curveTo(w * 0.9, h * 0.74, w * 0.88, h * 0.78, w * 0.83, h * 0.79);
  1608. c.curveTo(w * 0.57, h * 0.79, w * 0.32, h * 0.79, w * 0.06, h * 0.79);
  1609. c.curveTo(w * 0.02, h * 0.78, 0, h * 0.76, 0, h * 0.73);
  1610. c.close();
  1611. c.stroke();
  1612. };
  1613. mxCellRenderer.registerShape(mxArchiMate3Resource.prototype.cst.RESOURCE, mxArchiMate3Resource);
  1614. //**********************************************************************************************************************************************************
  1615. //Capability
  1616. //**********************************************************************************************************************************************************
  1617. /**
  1618. * Extends mxShape.
  1619. */
  1620. function mxArchiMate3Capability(bounds, fill, stroke, strokewidth)
  1621. {
  1622. mxShape.call(this);
  1623. this.bounds = bounds;
  1624. this.fill = fill;
  1625. this.stroke = stroke;
  1626. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1627. };
  1628. /**
  1629. * Extends mxShape.
  1630. */
  1631. mxUtils.extend(mxArchiMate3Capability, mxShape);
  1632. mxArchiMate3Capability.prototype.cst = {
  1633. CAPABILITY : 'mxgraph.archimate3.capability'
  1634. };
  1635. /**
  1636. * Function: paintVertexShape
  1637. *
  1638. * Paints the vertex shape.
  1639. */
  1640. mxArchiMate3Capability.prototype.paintVertexShape = function(c, x, y, w, h)
  1641. {
  1642. c.translate(x, y);
  1643. this.background(c, 0, 0, w, h);
  1644. c.setShadow(false);
  1645. };
  1646. mxArchiMate3Capability.prototype.background = function(c, x, y, w, h)
  1647. {
  1648. c.begin();
  1649. c.moveTo(w, 0);
  1650. c.lineTo(w, h);
  1651. c.lineTo(0, h);
  1652. c.lineTo(0, h * 0.67);
  1653. c.lineTo(w * 0.33, h * 0.67);
  1654. c.lineTo(w * 0.33, h * 0.33);
  1655. c.lineTo(w * 0.67, h * 0.33);
  1656. c.lineTo(w * 0.67, 0);
  1657. c.close();
  1658. c.moveTo(w * 0.67, h * 0.33);
  1659. c.lineTo(w, h * 0.33);
  1660. c.moveTo(w * 0.33, h * 0.67);
  1661. c.lineTo(w, h * 0.67);
  1662. c.moveTo(w * 0.33, h * 0.67);
  1663. c.lineTo(w * 0.33, h);
  1664. c.moveTo(w * 0.67, h * 0.33);
  1665. c.lineTo(w * 0.67, h);
  1666. c.stroke();
  1667. };
  1668. mxCellRenderer.registerShape(mxArchiMate3Capability.prototype.cst.CAPABILITY, mxArchiMate3Capability);
  1669. //**********************************************************************************************************************************************************
  1670. //Course of Action
  1671. //**********************************************************************************************************************************************************
  1672. /**
  1673. * Extends mxShape.
  1674. */
  1675. function mxArchiMate3Course(bounds, fill, stroke, strokewidth)
  1676. {
  1677. mxShape.call(this);
  1678. this.bounds = bounds;
  1679. this.fill = fill;
  1680. this.stroke = stroke;
  1681. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1682. };
  1683. /**
  1684. * Extends mxShape.
  1685. */
  1686. mxUtils.extend(mxArchiMate3Course, mxShape);
  1687. mxArchiMate3Course.prototype.cst = {
  1688. COURSE : 'mxgraph.archimate3.course'
  1689. };
  1690. /**
  1691. * Function: paintVertexShape
  1692. *
  1693. * Paints the vertex shape.
  1694. */
  1695. mxArchiMate3Course.prototype.paintVertexShape = function(c, x, y, w, h)
  1696. {
  1697. c.translate(x, y);
  1698. this.background(c, 0, 0, w, h);
  1699. c.setShadow(false);
  1700. };
  1701. mxArchiMate3Course.prototype.background = function(c, x, y, w, h)
  1702. {
  1703. c.begin();
  1704. c.moveTo(0, h);
  1705. c.arcTo(w * 0.7, h * 0.7, 0, 0, 1, w * 0.41, h * 0.56);
  1706. c.moveTo(w * 0.14, h * 0.54);
  1707. c.lineTo(w * 0.41, h * 0.56);
  1708. c.lineTo(w * 0.3, h * 0.78);
  1709. c.stroke();
  1710. c.ellipse(w * 0.4, 0, w * 0.6, h * 0.6);
  1711. c.stroke();
  1712. c.ellipse(w * 0.5, h * 0.1, w * 0.4, h * 0.4);
  1713. c.stroke();
  1714. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#000000');
  1715. c.setFillColor(fillColor);
  1716. c.ellipse(w * 0.6, h * 0.2, w * 0.2, h * 0.2);
  1717. c.fill();
  1718. };
  1719. mxCellRenderer.registerShape(mxArchiMate3Course.prototype.cst.COURSE, mxArchiMate3Course);
  1720. //**********************************************************************************************************************************************************
  1721. //Node
  1722. //**********************************************************************************************************************************************************
  1723. /**
  1724. * Extends mxShape.
  1725. */
  1726. function mxArchiMate3Node(bounds, fill, stroke, strokewidth)
  1727. {
  1728. mxShape.call(this);
  1729. this.bounds = bounds;
  1730. this.fill = fill;
  1731. this.stroke = stroke;
  1732. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1733. };
  1734. /**
  1735. * Extends mxShape.
  1736. */
  1737. mxUtils.extend(mxArchiMate3Node, mxShape);
  1738. mxArchiMate3Node.prototype.cst = {
  1739. NODE : 'mxgraph.archimate3.node'
  1740. };
  1741. /**
  1742. * Function: paintVertexShape
  1743. *
  1744. * Paints the vertex shape.
  1745. */
  1746. mxArchiMate3Node.prototype.paintVertexShape = function(c, x, y, w, h)
  1747. {
  1748. c.translate(x, y);
  1749. this.background(c, 0, 0, w, h);
  1750. c.setShadow(false);
  1751. };
  1752. mxArchiMate3Node.prototype.background = function(c, x, y, w, h)
  1753. {
  1754. c.begin();
  1755. c.moveTo(0, h * 0.25);
  1756. c.lineTo(w * 0.25, 0);
  1757. c.lineTo(w, 0);
  1758. c.lineTo(w, h * 0.75);
  1759. c.lineTo(w * 0.75, h);
  1760. c.lineTo(0, h);
  1761. c.close();
  1762. c.moveTo(0, h * 0.25);
  1763. c.lineTo(w * 0.75, h * 0.25);
  1764. c.lineTo(w * 0.75, h);
  1765. c.moveTo(w, 0);
  1766. c.lineTo(w * 0.75, h * 0.25);
  1767. c.fillAndStroke();
  1768. };
  1769. mxCellRenderer.registerShape(mxArchiMate3Node.prototype.cst.NODE, mxArchiMate3Node);
  1770. //**********************************************************************************************************************************************************
  1771. //Device
  1772. //**********************************************************************************************************************************************************
  1773. /**
  1774. * Extends mxShape.
  1775. */
  1776. function mxArchiMate3Device(bounds, fill, stroke, strokewidth)
  1777. {
  1778. mxShape.call(this);
  1779. this.bounds = bounds;
  1780. this.fill = fill;
  1781. this.stroke = stroke;
  1782. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1783. };
  1784. /**
  1785. * Extends mxShape.
  1786. */
  1787. mxUtils.extend(mxArchiMate3Device, mxShape);
  1788. mxArchiMate3Device.prototype.cst = {
  1789. DEVICE : 'mxgraph.archimate3.device'
  1790. };
  1791. /**
  1792. * Function: paintVertexShape
  1793. *
  1794. * Paints the vertex shape.
  1795. */
  1796. mxArchiMate3Device.prototype.paintVertexShape = function(c, x, y, w, h)
  1797. {
  1798. c.translate(x, y);
  1799. this.background(c, 0, 0, w, h);
  1800. c.setShadow(false);
  1801. };
  1802. mxArchiMate3Device.prototype.background = function(c, x, y, w, h)
  1803. {
  1804. c.roundrect(0, 0, w, h * 0.88, w * 0.1, h * 0.1);
  1805. c.fillAndStroke();
  1806. c.begin();
  1807. c.moveTo(w * 0.1, h * 0.88);
  1808. c.lineTo(0, h);
  1809. c.lineTo(w, h);
  1810. c.lineTo(w * 0.9, h * 0.88);
  1811. c.fillAndStroke();
  1812. };
  1813. mxCellRenderer.registerShape(mxArchiMate3Device.prototype.cst.DEVICE, mxArchiMate3Device);
  1814. //**********************************************************************************************************************************************************
  1815. //System Software
  1816. //**********************************************************************************************************************************************************
  1817. /**
  1818. * Extends mxShape.
  1819. */
  1820. function mxArchiMate3SysSw(bounds, fill, stroke, strokewidth)
  1821. {
  1822. mxShape.call(this);
  1823. this.bounds = bounds;
  1824. this.fill = fill;
  1825. this.stroke = stroke;
  1826. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1827. };
  1828. /**
  1829. * Extends mxShape.
  1830. */
  1831. mxUtils.extend(mxArchiMate3SysSw, mxShape);
  1832. mxArchiMate3SysSw.prototype.cst = {
  1833. SYS_SW : 'mxgraph.archimate3.sysSw'
  1834. };
  1835. /**
  1836. * Function: paintVertexShape
  1837. *
  1838. * Paints the vertex shape.
  1839. */
  1840. mxArchiMate3SysSw.prototype.paintVertexShape = function(c, x, y, w, h)
  1841. {
  1842. c.translate(x, y);
  1843. this.background(c, 0, 0, w, h);
  1844. c.setShadow(false);
  1845. };
  1846. mxArchiMate3SysSw.prototype.background = function(c, x, y, w, h)
  1847. {
  1848. c.ellipse(w * 0.3, 0, w * 0.7, h * 0.7);
  1849. c.stroke();
  1850. c.ellipse(0, h * 0.02, w * 0.98, h * 0.98);
  1851. c.fillAndStroke();
  1852. };
  1853. mxCellRenderer.registerShape(mxArchiMate3SysSw.prototype.cst.SYS_SW, mxArchiMate3SysSw);
  1854. //**********************************************************************************************************************************************************
  1855. //Artifact
  1856. //**********************************************************************************************************************************************************
  1857. /**
  1858. * Extends mxShape.
  1859. */
  1860. function mxArchiMate3Artifact(bounds, fill, stroke, strokewidth)
  1861. {
  1862. mxShape.call(this);
  1863. this.bounds = bounds;
  1864. this.fill = fill;
  1865. this.stroke = stroke;
  1866. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1867. };
  1868. /**
  1869. * Extends mxShape.
  1870. */
  1871. mxUtils.extend(mxArchiMate3Artifact, mxShape);
  1872. mxArchiMate3Artifact.prototype.cst = {
  1873. ARTIFACT : 'mxgraph.archimate3.artifact'
  1874. };
  1875. /**
  1876. * Function: paintVertexShape
  1877. *
  1878. * Paints the vertex shape.
  1879. */
  1880. mxArchiMate3Artifact.prototype.paintVertexShape = function(c, x, y, w, h)
  1881. {
  1882. c.translate(x, y);
  1883. this.background(c, 0, 0, w, h);
  1884. c.setShadow(false);
  1885. };
  1886. mxArchiMate3Artifact.prototype.background = function(c, x, y, w, h)
  1887. {
  1888. c.begin();
  1889. c.moveTo(0, 0);
  1890. c.lineTo(w * 0.7, 0);
  1891. c.lineTo(w, h * 0.22);
  1892. c.lineTo(w, h);
  1893. c.lineTo(0, h);
  1894. c.close();
  1895. c.fillAndStroke();
  1896. c.begin();
  1897. c.moveTo(w * 0.7, 0);
  1898. c.lineTo(w * 0.7, h * 0.22);
  1899. c.lineTo(w, h * 0.22);
  1900. c.stroke();
  1901. };
  1902. mxCellRenderer.registerShape(mxArchiMate3Artifact.prototype.cst.ARTIFACT, mxArchiMate3Artifact);
  1903. //**********************************************************************************************************************************************************
  1904. //Communication Network
  1905. //**********************************************************************************************************************************************************
  1906. /**
  1907. * Extends mxShape.
  1908. */
  1909. function mxArchiMate3CommNetw(bounds, fill, stroke, strokewidth)
  1910. {
  1911. mxShape.call(this);
  1912. this.bounds = bounds;
  1913. this.fill = fill;
  1914. this.stroke = stroke;
  1915. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1916. };
  1917. /**
  1918. * Extends mxShape.
  1919. */
  1920. mxUtils.extend(mxArchiMate3CommNetw, mxShape);
  1921. mxArchiMate3CommNetw.prototype.cst = {
  1922. COMM_NETW : 'mxgraph.archimate3.commNetw'
  1923. };
  1924. /**
  1925. * Function: paintVertexShape
  1926. *
  1927. * Paints the vertex shape.
  1928. */
  1929. mxArchiMate3CommNetw.prototype.paintVertexShape = function(c, x, y, w, h)
  1930. {
  1931. c.translate(x, y);
  1932. this.background(c, 0, 0, w, h);
  1933. c.setShadow(false);
  1934. };
  1935. mxArchiMate3CommNetw.prototype.background = function(c, x, y, w, h)
  1936. {
  1937. c.begin();
  1938. c.moveTo(w * 0.2, h);
  1939. c.lineTo(0, h * 0.5);
  1940. c.lineTo(w * 0.2, 0);
  1941. c.moveTo(w * 0.8, h);
  1942. c.lineTo(w, h * 0.5);
  1943. c.lineTo(w * 0.8, 0);
  1944. c.moveTo(0, h * 0.5);
  1945. c.lineTo(w, h * 0.5);
  1946. c.stroke();
  1947. };
  1948. mxCellRenderer.registerShape(mxArchiMate3CommNetw.prototype.cst.COMM_NETW, mxArchiMate3CommNetw);
  1949. //**********************************************************************************************************************************************************
  1950. //Path
  1951. //**********************************************************************************************************************************************************
  1952. /**
  1953. * Extends mxShape.
  1954. */
  1955. function mxArchiMate3Path(bounds, fill, stroke, strokewidth)
  1956. {
  1957. mxShape.call(this);
  1958. this.bounds = bounds;
  1959. this.fill = fill;
  1960. this.stroke = stroke;
  1961. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1962. };
  1963. /**
  1964. * Extends mxShape.
  1965. */
  1966. mxUtils.extend(mxArchiMate3Path, mxShape);
  1967. mxArchiMate3Path.prototype.cst = {
  1968. PATH : 'mxgraph.archimate3.path'
  1969. };
  1970. /**
  1971. * Function: paintVertexShape
  1972. *
  1973. * Paints the vertex shape.
  1974. */
  1975. mxArchiMate3Path.prototype.paintVertexShape = function(c, x, y, w, h)
  1976. {
  1977. c.translate(x, y);
  1978. this.background(c, 0, 0, w, h);
  1979. c.setShadow(false);
  1980. };
  1981. mxArchiMate3Path.prototype.background = function(c, x, y, w, h)
  1982. {
  1983. c.begin();
  1984. c.moveTo(w * 0.2, h);
  1985. c.lineTo(0, h * 0.5);
  1986. c.lineTo(w * 0.2, 0);
  1987. c.moveTo(w * 0.8, h);
  1988. c.lineTo(w, h * 0.5);
  1989. c.lineTo(w * 0.8, 0);
  1990. c.stroke();
  1991. c.setDashed(true);
  1992. c.begin();
  1993. c.moveTo(0, h * 0.5);
  1994. c.lineTo(w, h * 0.5);
  1995. c.stroke();
  1996. };
  1997. mxCellRenderer.registerShape(mxArchiMate3Path.prototype.cst.PATH, mxArchiMate3Path);