mxArchiMate3.js 57 KB

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