mxArchiMate3.js 131 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353
  1. /**
  2. * Copyright (c) 2006-2016, JGraph Holdings Ltd
  3. */
  4. //**********************************************************************************************************************************************************
  5. //Application
  6. //**********************************************************************************************************************************************************
  7. /**
  8. * Extends mxShape.
  9. */
  10. function mxArchiMate3Application(bounds, fill, stroke, strokewidth)
  11. {
  12. mxShape.call(this);
  13. this.bounds = bounds;
  14. this.fill = fill;
  15. this.stroke = stroke;
  16. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  17. };
  18. /**
  19. * Extends mxShape.
  20. */
  21. mxUtils.extend(mxArchiMate3Application, mxShape);
  22. mxArchiMate3Application.prototype.cst = {
  23. APPLICATION : 'mxgraph.archimate3.application',
  24. TYPE : 'appType',
  25. COMPONENT : 'comp',
  26. COLLABORATION : 'collab',
  27. CONTRACT : 'contract',
  28. INTERFACE : 'interface',
  29. INTERFACE2 : 'interface2',
  30. LOCATION : 'location',
  31. FACILITY : 'facility',
  32. FUNCTION : 'func',
  33. GAP : 'gap',
  34. INTERACTION : 'interaction',
  35. SERVICE : 'serv',
  36. EQUIPMENT : 'equipment',
  37. EVENT : 'event',
  38. EVENT2 : 'event2',
  39. NODE : 'node',
  40. GENERIC : 'generic',
  41. NETWORK : 'netw',
  42. COMM_PATH : 'commPath',
  43. ACTOR : 'actor',
  44. ASSESSMENT : 'assess',
  45. GOAL : 'goal',
  46. GROUPING : 'grouping',
  47. OUTCOME : 'outcome',
  48. ROLE : 'role',
  49. PASSIVE : 'passive',
  50. PLATEAU : 'plateau',
  51. PROCESS : 'proc',
  52. PRODUCT : 'product',
  53. DRIVER : 'driver',
  54. DELIVERABLE : 'deliverable',
  55. DEVICE : 'device',
  56. PRINCIPLE : 'principle',
  57. REQUIREMENT : 'requirement',
  58. REPRESENTATION : 'representation',
  59. CONSTRAINT : 'constraint',
  60. RESOURCE : 'resource',
  61. CAPABILITY : 'capability',
  62. COURSE : 'course',
  63. MATERIAL : 'material',
  64. MEANING : 'meaning',
  65. DISTRIBUTION : 'distribution',
  66. SYS_SW : 'sysSw',
  67. ARTIFACT : 'artifact',
  68. PATH : 'path',
  69. ARCHI_TYPE : 'archiType',
  70. TYPE_SQUARE : 'square',
  71. TYPE_ROUNDED : 'rounded',
  72. TYPE_OCT : 'oct',
  73. AMVALUE : 'amValue',
  74. VALUE_STREAM : 'valueStream',
  75. WORK_PACKAGE : 'workPackage'
  76. };
  77. mxArchiMate3Application.prototype.customProperties = [
  78. {name: 'archiType', dispName: 'Type', type: 'enum',
  79. enumList: [{val: 'square', dispName: 'Square'},
  80. {val: 'rounded', dispName: 'Rounded'},
  81. {val: 'oct', dispName: 'Octagonal'}]
  82. },
  83. {name: 'appType', dispName: 'App Type', type: 'enum',
  84. enumList: [{val: 'generic', dispName: 'Generic'},
  85. {val: 'comp', dispName: 'Component'},
  86. {val: 'collab', dispName: 'Collaboration'},
  87. {val: 'contract', dispName: 'Contract'},
  88. {val: 'interface', dispName: 'Interface'},
  89. {val: 'interface2', dispName: 'Interface2'},
  90. {val: 'facility', dispName: 'Facility'},
  91. {val: 'func', dispName: 'Function'},
  92. {val: 'gap', dispName: 'Gap'},
  93. {val: 'interaction', dispName: 'Interaction'},
  94. {val: 'location', dispName: 'Location'},
  95. {val: 'serv', dispName: 'Service'},
  96. {val: 'equipment', dispName: 'Equipment'},
  97. {val: 'event', dispName: 'Event'},
  98. {val: 'event2', dispName: 'Event2'},
  99. {val: 'node', dispName: 'Node'},
  100. {val: 'netw', dispName: 'Network'},
  101. {val: 'commPath', dispName: 'Comm Path'},
  102. {val: 'actor', dispName: 'Actor'},
  103. {val: 'assess', dispName: 'Assessment'},
  104. {val: 'goal', dispName: 'Goal'},
  105. {val: 'grouping', dispName: 'Grouping'},
  106. {val: 'outcome', dispName: 'Outcome'},
  107. {val: 'role', dispName: 'Stakeholder'},
  108. {val: 'passive', dispName: 'Passive'},
  109. {val: 'plateau', dispName: 'Plateau'},
  110. {val: 'proc', dispName: 'Process'},
  111. {val: 'product', dispName: 'Product'},
  112. {val: 'deliverable', dispName: 'Deliverable'},
  113. {val: 'device', dispName: 'Device'},
  114. {val: 'driver', dispName: 'Driver'},
  115. {val: 'principle', dispName: 'Principle'},
  116. {val: 'requirement', dispName: 'Requirement'},
  117. {val: 'representation', dispName: 'Representation'},
  118. {val: 'constraint', dispName: 'Constraint'},
  119. {val: 'resource', dispName: 'Resource'},
  120. {val: 'capability', dispName: 'Capability'},
  121. {val: 'course', dispName: 'Course'},
  122. {val: 'material', dispName: 'Material'},
  123. {val: 'meaning', dispName: 'Meaning'},
  124. {val: 'distribution', dispName: 'Distribution'},
  125. {val: 'sysSw', dispName: 'System Sw'},
  126. {val: 'artifact', dispName: 'Artifact'},
  127. {val: 'path', dispName: 'Path'},
  128. {val: 'amValue', dispName: 'Value'},
  129. {val: 'valueStream', dispName: 'Value Stream'},
  130. {val: 'workPackage', dispName: 'Work Package'}]
  131. }];
  132. /**
  133. * Function: paintVertexShape
  134. *
  135. * Paints the vertex shape.
  136. */
  137. mxArchiMate3Application.prototype.paintVertexShape = function(c, x, y, w, h)
  138. {
  139. c.translate(x, y);
  140. this.background(c, 0, 0, w, h);
  141. c.setShadow(false);
  142. c.translate(w - 20, 5);
  143. this.foreground(c, w - 20, 5, 15, 15);
  144. };
  145. mxArchiMate3Application.prototype.background = function(c, x, y, w, h)
  146. {
  147. var archiType = mxUtils.getValue(this.style, mxArchiMate3Application.prototype.cst.ARCHI_TYPE, 'square');
  148. if (archiType === 'rounded')
  149. {
  150. c.roundrect(0, 0, w, h, 10, 10);
  151. }
  152. else if ((archiType === 'oct') && w >= 20 && h >= 20)
  153. {
  154. c.begin();
  155. c.moveTo(0, 10);
  156. c.lineTo(10, 0);
  157. c.lineTo(w - 10, 0);
  158. c.lineTo(w, 10);
  159. c.lineTo(w, h - 10);
  160. c.lineTo(w - 10, h);
  161. c.lineTo(10, h);
  162. c.lineTo(0, h - 10);
  163. c.close();
  164. c.fillAndStroke();
  165. }
  166. else
  167. {
  168. c.rect(0, 0, w, h);
  169. }
  170. c.fillAndStroke();
  171. };
  172. mxArchiMate3Application.prototype.foreground = function(c, x, y, w, h)
  173. {
  174. var type = mxUtils.getValue(this.style, mxArchiMate3Application.prototype.cst.TYPE, '');
  175. c.setDashed(false);
  176. if (type === mxArchiMate3Application.prototype.cst.COMPONENT)
  177. {
  178. c.translate(1, 0);
  179. w = w - 2;
  180. mxArchiMate3Component.prototype.background(c, x, y, w, h);
  181. }
  182. else if (type === mxArchiMate3Application.prototype.cst.COLLABORATION)
  183. {
  184. c.translate(0, 3);
  185. h = h - 6;
  186. mxArchiMate3Collaboration.prototype.background(c, x, y, w, h);
  187. }
  188. else if (type === mxArchiMate3Application.prototype.cst.INTERFACE)
  189. {
  190. c.translate(0, 4);
  191. h = h - 8;
  192. mxArchiMate3Interface.prototype.background(c, x, y, w, h);
  193. }
  194. else if (type === mxArchiMate3Application.prototype.cst.INTERFACE2)
  195. {
  196. c.translate(0, 1);
  197. h = h - 2;
  198. c.begin();
  199. c.moveTo(0, h * 0.5);
  200. c.lineTo(w * 0.6, h * 0.5);
  201. c.moveTo(w, 0);
  202. c.arcTo(w * 0.4, h * 0.5, 0, 0, 0, w, h);
  203. c.stroke();
  204. }
  205. else if (type === mxArchiMate3Application.prototype.cst.FACILITY)
  206. {
  207. mxArchiMate3Facility.prototype.background(c, x, y, w, h);
  208. }
  209. else if (type === mxArchiMate3Application.prototype.cst.FUNCTION)
  210. {
  211. mxArchiMate3Function.prototype.background(c, x, y, w, h);
  212. }
  213. else if (type === mxArchiMate3Application.prototype.cst.GAP)
  214. {
  215. mxArchiMate3GapIcon.prototype.background(c, x, y, w, h);
  216. }
  217. else if (type === mxArchiMate3Application.prototype.cst.INTERACTION)
  218. {
  219. mxArchiMate3Interaction.prototype.background(c, x, y, w, h);
  220. }
  221. else if (type === mxArchiMate3Application.prototype.cst.LOCATION)
  222. {
  223. mxArchiMate3LocationIcon.prototype.background(c, x, y, w, h);
  224. }
  225. else if (type === mxArchiMate3Application.prototype.cst.SERVICE)
  226. {
  227. c.translate(0, 3);
  228. h = h - 6;
  229. mxArchiMate3Service.prototype.background(c, x, y, w, h);
  230. }
  231. else if (type === mxArchiMate3Application.prototype.cst.EQUIPMENT)
  232. {
  233. mxArchiMate3Equipment.prototype.background(c, x, y, w, h);
  234. }
  235. else if (type === mxArchiMate3Application.prototype.cst.EVENT)
  236. {
  237. c.translate(0, 3);
  238. h = h - 6;
  239. mxArchiMate3Event.prototype.background(c, x, y, w, h);
  240. }
  241. else if (type === mxArchiMate3Application.prototype.cst.EVENT2)
  242. {
  243. c.translate(0, 3);
  244. h = h - 6;
  245. mxArchiMate3Event2.prototype.background(c, x, y, w, h);
  246. }
  247. else if (type === mxArchiMate3Application.prototype.cst.NODE)
  248. {
  249. mxArchiMate3Node.prototype.background(c, x, y, w, h);
  250. }
  251. else if (type === mxArchiMate3Application.prototype.cst.GENERIC)
  252. {
  253. }
  254. else if (type === mxArchiMate3Application.prototype.cst.NETWORK)
  255. {
  256. mxArchiMate3Network.prototype.background(c, x, y, w, h);
  257. }
  258. else if (type === mxArchiMate3Application.prototype.cst.COMM_PATH)
  259. {
  260. c.translate(0, 5);
  261. h = h - 10;
  262. c.begin();
  263. c.moveTo(w * 0.1, 0);
  264. c.lineTo(0, h * 0.5);
  265. c.lineTo(w * 0.1, h);
  266. c.moveTo(w * 0.9, 0);
  267. c.lineTo(w, h * 0.5);
  268. c.lineTo(w * 0.9, h);
  269. c.stroke();
  270. c.setDashed(true);
  271. c.begin();
  272. c.moveTo(0, h * 0.5);
  273. c.lineTo(w, h * 0.5);
  274. c.stroke();
  275. }
  276. else if (type === mxArchiMate3Application.prototype.cst.ARTIFACT)
  277. {
  278. c.translate(2, 0);
  279. w = w - 4;
  280. c.begin();
  281. c.moveTo(0, 0);
  282. c.lineTo(w * 0.7, 0);
  283. c.lineTo(w, h * 0.22);
  284. c.lineTo(w, h);
  285. c.lineTo(0, h);
  286. c.close();
  287. c.moveTo(w * 0.7, 0);
  288. c.lineTo(w * 0.7, h * 0.22);
  289. c.lineTo(w, h * 0.22);
  290. c.stroke();
  291. }
  292. else if (type === mxArchiMate3Application.prototype.cst.ACTOR)
  293. {
  294. c.translate(3, 0);
  295. w = w - 6;
  296. mxArchiMate3Actor.prototype.background(c, x, y, w, h);
  297. }
  298. else if (type === mxArchiMate3Application.prototype.cst.ROLE)
  299. {
  300. c.translate(0, 3);
  301. h = h - 6;
  302. mxArchiMate3Role.prototype.background(c, x, y, w, h);
  303. }
  304. else if (type === mxArchiMate3Application.prototype.cst.PASSIVE)
  305. {
  306. c.translate(0, 3);
  307. h = h - 6;
  308. mxArchiMate3Passive.prototype.background(c, x, y, w, h);
  309. }
  310. else if (type === mxArchiMate3Application.prototype.cst.PLATEAU)
  311. {
  312. c.translate(0, 2);
  313. h = h - 4;
  314. mxArchiMate3Plateau.prototype.background(c, x, y, w, h);
  315. }
  316. else if (type === mxArchiMate3Application.prototype.cst.PRODUCT)
  317. {
  318. c.translate(0, 3);
  319. h = h - 6;
  320. mxArchiMate3ProductSmall.prototype.background(c, x, y, w, h);
  321. }
  322. else if (type === mxArchiMate3Application.prototype.cst.CONTRACT)
  323. {
  324. c.translate(0, 3);
  325. h = h - 6;
  326. mxArchiMate3ContractSmall.prototype.background(c, x, y, w, h);
  327. }
  328. else if (type === mxArchiMate3Application.prototype.cst.PROCESS)
  329. {
  330. c.translate(0, 3);
  331. h = h - 6;
  332. mxArchiMate3Process.prototype.background(c, x, y, w, h);
  333. }
  334. else if (type === mxArchiMate3Application.prototype.cst.DELIVERABLE)
  335. {
  336. c.translate(0, 2);
  337. h = h - 4;
  338. mxArchiMate3Deliverable.prototype.background(c, x, y, w, h);
  339. }
  340. else if (type === mxArchiMate3Application.prototype.cst.DEVICE)
  341. {
  342. mxArchiMate3Device.prototype.background(c, x, y, w, h);
  343. }
  344. else if (type === mxArchiMate3Application.prototype.cst.DRIVER)
  345. {
  346. mxArchiMate3Driver.prototype.background(c, x, y, w, h);
  347. }
  348. else if (type === mxArchiMate3Application.prototype.cst.ASSESSMENT)
  349. {
  350. mxArchiMate3Assessment.prototype.background(c, x, y, w, h);
  351. }
  352. else if (type === mxArchiMate3Application.prototype.cst.GOAL)
  353. {
  354. mxArchiMate3Goal.prototype.background(c, x, y, w, h);
  355. }
  356. else if (type === mxArchiMate3Application.prototype.cst.GROUPING)
  357. {
  358. c.translate(0, 2);
  359. h = h - 4;
  360. c.setDashed(true);
  361. mxArchiMate3Grouping.prototype.background(c, x, y, w, h);
  362. }
  363. else if (type === mxArchiMate3Application.prototype.cst.OUTCOME)
  364. {
  365. mxArchiMate3Outcome.prototype.background(c, x, y, w, h);
  366. }
  367. else if (type === mxArchiMate3Application.prototype.cst.PRINCIPLE)
  368. {
  369. mxArchiMate3Principle.prototype.background(c, x, y, w, h);
  370. }
  371. else if (type === mxArchiMate3Application.prototype.cst.REPRESENTATION)
  372. {
  373. c.translate(0, 3);
  374. h = h - 6;
  375. mxArchiMate3RepresentationSmall.prototype.background(c, x, y, w, h);
  376. }
  377. else if (type === mxArchiMate3Application.prototype.cst.REQUIREMENT)
  378. {
  379. c.translate(0, 4);
  380. h = h - 8;
  381. mxArchiMate3Requirement.prototype.background(c, x, y, w, h);
  382. }
  383. else if (type === mxArchiMate3Application.prototype.cst.CONSTRAINT)
  384. {
  385. c.translate(0, 4);
  386. h = h - 8;
  387. mxArchiMate3Constraint.prototype.background(c, x, y, w, h);
  388. }
  389. else if (type === mxArchiMate3Application.prototype.cst.MATERIAL)
  390. {
  391. c.translate(0, 1);
  392. h = h - 2;
  393. mxArchiMate3Material.prototype.background(c, x, y, w, h);
  394. }
  395. else if (type === mxArchiMate3Application.prototype.cst.MEANING)
  396. {
  397. c.translate(0, 2);
  398. h = h - 4;
  399. var frame = mxStencilRegistry.getStencil('mxgraph.basic.cloud_callout');
  400. frame.drawShape(c, this, 0, 0, w, h);
  401. }
  402. else if (type === mxArchiMate3Application.prototype.cst.DISTRIBUTION)
  403. {
  404. c.translate(0, 4);
  405. h = h - 8;
  406. mxArchiMate3Distribution.prototype.background(c, x, y, w, h);
  407. }
  408. else if (type === mxArchiMate3Application.prototype.cst.RESOURCE)
  409. {
  410. c.translate(0, 1);
  411. h = h - 2;
  412. mxArchiMate3Resource.prototype.background(c, x, y, w, h);
  413. }
  414. else if (type === mxArchiMate3Application.prototype.cst.CAPABILITY)
  415. {
  416. mxArchiMate3Capability.prototype.background(c, x, y, w, h);
  417. }
  418. else if (type === mxArchiMate3Application.prototype.cst.COURSE)
  419. {
  420. mxArchiMate3Course.prototype.background(c, x, y, w, h);
  421. }
  422. else if (type === mxArchiMate3Application.prototype.cst.SYS_SW)
  423. {
  424. mxArchiMate3SysSw.prototype.background(c, x, y, w, h);
  425. }
  426. else if (type === mxArchiMate3Application.prototype.cst.ARTIFACT)
  427. {
  428. c.translate(2, 0);
  429. w = w - 4;
  430. mxArchiMate3Artifact.prototype.background(c, x, y, w, h);
  431. }
  432. else if (type === mxArchiMate3Application.prototype.cst.PATH)
  433. {
  434. c.translate(0, 5);
  435. h = h - 10;
  436. mxArchiMate3Path.prototype.background(c, x, y, w, h);
  437. }
  438. else if (type === mxArchiMate3Application.prototype.cst.AMVALUE)
  439. {
  440. c.translate(0, 3);
  441. h = h - 6;
  442. mxEllipse.prototype.paintVertexShape(c, 0, 0, w, h);
  443. }
  444. else if (type === mxArchiMate3Application.prototype.cst.VALUE_STREAM)
  445. {
  446. c.translate(0, 2);
  447. h = h - 4;
  448. mxArchiMate3ValueStream.prototype.background(c, x, y, w, h);
  449. }
  450. else if (type === mxArchiMate3Application.prototype.cst.WORK_PACKAGE)
  451. {
  452. c.translate(0, 1);
  453. h = h - 2;
  454. mxArchiMate3WorkPackage.prototype.background(c, x, y, w, h);
  455. }
  456. };
  457. mxCellRenderer.registerShape(mxArchiMate3Application.prototype.cst.APPLICATION, mxArchiMate3Application);
  458. mxArchiMate3Application.prototype.getConstraints = function(style, w, h)
  459. {
  460. var constr = [];
  461. var archiType = mxUtils.getValue(this.style, mxArchiMate3Application.prototype.cst.ARCHI_TYPE, 'square');
  462. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  463. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  464. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  465. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  466. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  467. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  468. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  469. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  470. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  471. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  472. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  473. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  474. if (archiType === 'rounded')
  475. {
  476. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, 2.9));
  477. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, -2.9, 2.9));
  478. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -2.9, -2.9));
  479. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, 2.9, -2.9));
  480. }
  481. else if ((archiType === 'oct') && w >= 20 && h >= 20)
  482. {
  483. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 5, 5));
  484. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, -5, 5));
  485. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -5, -5));
  486. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, 5, -5));
  487. }
  488. else
  489. {
  490. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  491. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  492. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  493. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  494. }
  495. return (constr);
  496. };
  497. //**********************************************************************************************************************************************************
  498. //Component
  499. //**********************************************************************************************************************************************************
  500. /**
  501. * Extends mxShape.
  502. */
  503. function mxArchiMate3Component(bounds, fill, stroke, strokewidth)
  504. {
  505. mxShape.call(this);
  506. this.bounds = bounds;
  507. this.fill = fill;
  508. this.stroke = stroke;
  509. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  510. };
  511. /**
  512. * Extends mxShape.
  513. */
  514. mxUtils.extend(mxArchiMate3Component, mxShape);
  515. mxArchiMate3Component.prototype.cst = {
  516. COMPONENT : 'mxgraph.archimate3.component'
  517. };
  518. /**
  519. * Function: paintVertexShape
  520. *
  521. * Paints the vertex shape.
  522. */
  523. mxArchiMate3Component.prototype.paintVertexShape = function(c, x, y, w, h)
  524. {
  525. c.translate(x, y);
  526. this.background(c, 0, 0, w, h);
  527. c.setShadow(false);
  528. };
  529. mxArchiMate3Component.prototype.background = function(c, x, y, w, h)
  530. {
  531. c.rect(w * 0.25, 0, w * 0.75, h);
  532. c.fillAndStroke();
  533. c.rect(0, h * 0.25, w * 0.5, h * 0.15);
  534. c.fillAndStroke();
  535. c.rect(0, h * 0.6, w * 0.5, h * 0.15);
  536. c.fillAndStroke();
  537. };
  538. mxCellRenderer.registerShape(mxArchiMate3Component.prototype.cst.COMPONENT, mxArchiMate3Component);
  539. mxArchiMate3Component.prototype.getConstraints = function(style, w, h)
  540. {
  541. var constr = [];
  542. constr.push(new mxConnectionConstraint(new mxPoint(0.625, 0), false));
  543. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  544. constr.push(new mxConnectionConstraint(new mxPoint(0.625, 1), false));
  545. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.325), false));
  546. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.675), false));
  547. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  548. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  549. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  550. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  551. return (constr);
  552. };
  553. //**********************************************************************************************************************************************************
  554. //Collaboration
  555. //**********************************************************************************************************************************************************
  556. /**
  557. * Extends mxShape.
  558. */
  559. function mxArchiMate3Collaboration(bounds, fill, stroke, strokewidth)
  560. {
  561. mxShape.call(this);
  562. this.bounds = bounds;
  563. this.fill = fill;
  564. this.stroke = stroke;
  565. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  566. };
  567. /**
  568. * Extends mxShape.
  569. */
  570. mxUtils.extend(mxArchiMate3Collaboration, mxShape);
  571. mxArchiMate3Collaboration.prototype.cst = {
  572. COLLABORATION : 'mxgraph.archimate3.collaboration'
  573. };
  574. /**
  575. * Function: paintVertexShape
  576. *
  577. * Paints the vertex shape.
  578. */
  579. mxArchiMate3Collaboration.prototype.paintVertexShape = function(c, x, y, w, h)
  580. {
  581. c.translate(x, y);
  582. this.background(c, 0, 0, w, h);
  583. c.setShadow(false);
  584. };
  585. mxArchiMate3Collaboration.prototype.background = function(c, x, y, w, h)
  586. {
  587. c.ellipse(0, 0, w * 0.6, h);
  588. c.fillAndStroke();
  589. c.ellipse(w * 0.4, 0, w * 0.6, h);
  590. c.fillAndStroke();
  591. };
  592. mxCellRenderer.registerShape(mxArchiMate3Collaboration.prototype.cst.COLLABORATION, mxArchiMate3Collaboration);
  593. mxArchiMate3Collaboration.prototype.getConstraints = function(style, w, h)
  594. {
  595. var constr = [];
  596. constr.push(new mxConnectionConstraint(new mxPoint(0.11, 0.11), false));
  597. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.125), false));
  598. constr.push(new mxConnectionConstraint(new mxPoint(0.89, 0.11), false));
  599. constr.push(new mxConnectionConstraint(new mxPoint(0.11, 0.89), false));
  600. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.875), false));
  601. constr.push(new mxConnectionConstraint(new mxPoint(0.89, 0.89), false));
  602. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0), false));
  603. constr.push(new mxConnectionConstraint(new mxPoint(0.7, 0), false));
  604. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 1), false));
  605. constr.push(new mxConnectionConstraint(new mxPoint(0.7, 1), false));
  606. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  607. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  608. return (constr);
  609. };
  610. //**********************************************************************************************************************************************************
  611. //Interface
  612. //**********************************************************************************************************************************************************
  613. /**
  614. * Extends mxShape.
  615. */
  616. function mxArchiMate3Interface(bounds, fill, stroke, strokewidth)
  617. {
  618. mxShape.call(this);
  619. this.bounds = bounds;
  620. this.fill = fill;
  621. this.stroke = stroke;
  622. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  623. };
  624. /**
  625. * Extends mxShape.
  626. */
  627. mxUtils.extend(mxArchiMate3Interface, mxShape);
  628. mxArchiMate3Interface.prototype.cst = {
  629. INTERFACE : 'mxgraph.archimate3.interface'
  630. };
  631. /**
  632. * Function: paintVertexShape
  633. *
  634. * Paints the vertex shape.
  635. */
  636. mxArchiMate3Interface.prototype.paintVertexShape = function(c, x, y, w, h)
  637. {
  638. c.translate(x, y);
  639. this.background(c, 0, 0, w, h);
  640. c.setShadow(false);
  641. };
  642. mxArchiMate3Interface.prototype.background = function(c, x, y, w, h)
  643. {
  644. c.ellipse(w * 0.5, 0, w * 0.5, h);
  645. c.fillAndStroke();
  646. c.begin();
  647. c.moveTo(0, h * 0.5);
  648. c.lineTo(w * 0.5, h * 0.5);
  649. c.stroke();
  650. };
  651. mxCellRenderer.registerShape(mxArchiMate3Interface.prototype.cst.INTERFACE, mxArchiMate3Interface);
  652. mxArchiMate3Interface.prototype.getConstraints = function(style, w, h)
  653. {
  654. var constr = [];
  655. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  656. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  657. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  658. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  659. return (constr);
  660. };
  661. //**********************************************************************************************************************************************************
  662. //Contract Small
  663. //**********************************************************************************************************************************************************
  664. /**
  665. * Extends mxShape.
  666. */
  667. function mxArchiMate3ContractSmall(bounds, fill, stroke, strokewidth)
  668. {
  669. mxShape.call(this);
  670. this.bounds = bounds;
  671. this.fill = fill;
  672. this.stroke = stroke;
  673. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  674. };
  675. /**
  676. * Extends mxShape.
  677. */
  678. mxUtils.extend(mxArchiMate3ContractSmall, mxShape);
  679. mxArchiMate3ContractSmall.prototype.cst = {
  680. CONTRACT_SMALL : 'mxgraph.archimate3.contractSmall'
  681. };
  682. /**
  683. * Function: paintVertexShape
  684. *
  685. * Paints the vertex shape.
  686. */
  687. mxArchiMate3ContractSmall.prototype.paintVertexShape = function(c, x, y, w, h)
  688. {
  689. c.translate(x, y);
  690. this.background(c, 0, 0, w, h);
  691. c.setShadow(false);
  692. };
  693. mxArchiMate3ContractSmall.prototype.background = function(c, x, y, w, h)
  694. {
  695. c.begin();
  696. c.moveTo(0, 0);
  697. c.lineTo(w, 0);
  698. c.lineTo(w, h);
  699. c.lineTo(0, h);
  700. c.close();
  701. c.moveTo(0, h * 0.2);
  702. c.lineTo(w, h * 0.2);
  703. c.moveTo(0, h * 0.8);
  704. c.lineTo(w, h * 0.8);
  705. c.fillAndStroke();
  706. };
  707. mxCellRenderer.registerShape(mxArchiMate3ContractSmall.prototype.cst.CONTRACT_SMALL, mxArchiMate3ContractSmall);
  708. mxArchiMate3ContractSmall.prototype.getConstraints = function(style, w, h)
  709. {
  710. var constr = [];
  711. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  712. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  713. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  714. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  715. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  716. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  717. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  718. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  719. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  720. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  721. return (constr);
  722. };
  723. //**********************************************************************************************************************************************************
  724. //Representation Small
  725. //**********************************************************************************************************************************************************
  726. /**
  727. * Extends mxShape.
  728. */
  729. function mxArchiMate3RepresentationSmall(bounds, fill, stroke, strokewidth)
  730. {
  731. mxShape.call(this);
  732. this.bounds = bounds;
  733. this.fill = fill;
  734. this.stroke = stroke;
  735. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  736. };
  737. /**
  738. * Extends mxShape.
  739. */
  740. mxUtils.extend(mxArchiMate3RepresentationSmall, mxShape);
  741. mxArchiMate3RepresentationSmall.prototype.cst = {
  742. REPRESENTATION_SMALL : 'mxgraph.archimate3.representationSmall'
  743. };
  744. /**
  745. * Function: paintVertexShape
  746. *
  747. * Paints the vertex shape.
  748. */
  749. mxArchiMate3RepresentationSmall.prototype.paintVertexShape = function(c, x, y, w, h)
  750. {
  751. c.translate(x, y);
  752. this.background(c, 0, 0, w, h);
  753. c.setShadow(false);
  754. };
  755. mxArchiMate3RepresentationSmall.prototype.background = function(c, x, y, w, h)
  756. {
  757. c.begin();
  758. c.moveTo(0, 0);
  759. c.lineTo(w, 0);
  760. c.lineTo(w, h * 0.85);
  761. c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
  762. c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
  763. c.close();
  764. c.moveTo(0, h * 0.2);
  765. c.lineTo(w, h * 0.2);
  766. c.fillAndStroke();
  767. };
  768. mxCellRenderer.registerShape(mxArchiMate3RepresentationSmall.prototype.cst.REPRESENTATION_SMALL, mxArchiMate3RepresentationSmall);
  769. mxArchiMate3RepresentationSmall.prototype.getConstraints = function(style, w, h)
  770. {
  771. var constr = [];
  772. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  773. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  774. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  775. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  776. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  777. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  778. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  779. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  780. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  781. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  782. return (constr);
  783. };
  784. //**********************************************************************************************************************************************************
  785. //Passive
  786. //**********************************************************************************************************************************************************
  787. /**
  788. * Extends mxShape.
  789. */
  790. function mxArchiMate3Passive(bounds, fill, stroke, strokewidth)
  791. {
  792. mxShape.call(this);
  793. this.bounds = bounds;
  794. this.fill = fill;
  795. this.stroke = stroke;
  796. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  797. };
  798. /**
  799. * Extends mxShape.
  800. */
  801. mxUtils.extend(mxArchiMate3Passive, mxShape);
  802. mxArchiMate3Passive.prototype.cst = {
  803. PASSIVE : 'mxgraph.archimate3.passive'
  804. };
  805. /**
  806. * Function: paintVertexShape
  807. *
  808. * Paints the vertex shape.
  809. */
  810. mxArchiMate3Passive.prototype.paintVertexShape = function(c, x, y, w, h)
  811. {
  812. c.translate(x, y);
  813. this.background(c, 0, 0, w, h);
  814. c.setShadow(false);
  815. };
  816. mxArchiMate3Passive.prototype.background = function(c, x, y, w, h)
  817. {
  818. c.begin();
  819. c.moveTo(0, 0);
  820. c.lineTo(w, 0);
  821. c.lineTo(w, h);
  822. c.lineTo(0, h);
  823. c.close();
  824. c.moveTo(0, h * 0.2);
  825. c.lineTo(w, h * 0.2);
  826. c.fillAndStroke();
  827. };
  828. mxCellRenderer.registerShape(mxArchiMate3Passive.prototype.cst.PASSIVE, mxArchiMate3Passive);
  829. mxArchiMate3Passive.prototype.getConstraints = function(style, w, h)
  830. {
  831. var constr = [];
  832. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  833. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  834. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  835. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  836. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  837. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  838. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  839. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  840. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  841. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  842. return (constr);
  843. };
  844. //**********************************************************************************************************************************************************
  845. //Plateau
  846. //**********************************************************************************************************************************************************
  847. /**
  848. * Extends mxShape.
  849. */
  850. function mxArchiMate3Plateau(bounds, fill, stroke, strokewidth)
  851. {
  852. mxShape.call(this);
  853. this.bounds = bounds;
  854. this.fill = fill;
  855. this.stroke = stroke;
  856. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  857. };
  858. /**
  859. * Extends mxShape.
  860. */
  861. mxUtils.extend(mxArchiMate3Plateau, mxShape);
  862. mxArchiMate3Plateau.prototype.cst = {
  863. PLATEAU : 'mxgraph.archimate3.plateau'
  864. };
  865. /**
  866. * Function: paintVertexShape
  867. *
  868. * Paints the vertex shape.
  869. */
  870. mxArchiMate3Plateau.prototype.paintVertexShape = function(c, x, y, w, h)
  871. {
  872. c.translate(x, y);
  873. this.background(c, 0, 0, w, h);
  874. c.setShadow(false);
  875. };
  876. mxArchiMate3Plateau.prototype.background = function(c, x, y, w, h)
  877. {
  878. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  879. c.setFillColor(strokeColor);
  880. c.rect(w * 0.4, 0, w * 0.6, h * 0.2);
  881. c.fill();
  882. c.rect(w * 0.2, h * 0.4, w * 0.6, h * 0.2);
  883. c.fill();
  884. c.rect(0, h * 0.8, w * 0.6, h * 0.2);
  885. c.fill();
  886. };
  887. mxCellRenderer.registerShape(mxArchiMate3Plateau.prototype.cst.PLATEAU, mxArchiMate3Plateau);
  888. mxArchiMate3Plateau.prototype.getConstraints = function(style, w, h)
  889. {
  890. var constr = [];
  891. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  892. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  893. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  894. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  895. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  896. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  897. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  898. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  899. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  900. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  901. return (constr);
  902. };
  903. //**********************************************************************************************************************************************************
  904. //Product Small
  905. //**********************************************************************************************************************************************************
  906. /**
  907. * Extends mxShape.
  908. */
  909. function mxArchiMate3ProductSmall(bounds, fill, stroke, strokewidth)
  910. {
  911. mxShape.call(this);
  912. this.bounds = bounds;
  913. this.fill = fill;
  914. this.stroke = stroke;
  915. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  916. };
  917. /**
  918. * Extends mxShape.
  919. */
  920. mxUtils.extend(mxArchiMate3ProductSmall, mxShape);
  921. mxArchiMate3ProductSmall.prototype.cst = {
  922. PRODUCT_SMALL : 'mxgraph.archimate3.productSmall'
  923. };
  924. /**
  925. * Function: paintVertexShape
  926. *
  927. * Paints the vertex shape.
  928. */
  929. mxArchiMate3ProductSmall.prototype.paintVertexShape = function(c, x, y, w, h)
  930. {
  931. c.translate(x, y);
  932. this.background(c, 0, 0, w, h);
  933. c.setShadow(false);
  934. };
  935. mxArchiMate3ProductSmall.prototype.background = function(c, x, y, w, h)
  936. {
  937. c.begin();
  938. c.moveTo(0, 0);
  939. c.lineTo(w, 0);
  940. c.lineTo(w, h);
  941. c.lineTo(0, h);
  942. c.close();
  943. c.moveTo(0, h * 0.2);
  944. c.lineTo(w * 0.5, h * 0.2);
  945. c.lineTo(w * 0.5, 0);
  946. c.fillAndStroke();
  947. };
  948. mxCellRenderer.registerShape(mxArchiMate3ProductSmall.prototype.cst.PRODUCT_SMALL, mxArchiMate3ProductSmall);
  949. mxArchiMate3ProductSmall.prototype.getConstraints = function(style, w, h)
  950. {
  951. var constr = [];
  952. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  953. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  954. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  955. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  956. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  957. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  958. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  959. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  960. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  961. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  962. return (constr);
  963. };
  964. //**********************************************************************************************************************************************************
  965. //Process
  966. //**********************************************************************************************************************************************************
  967. /**
  968. * Extends mxShape.
  969. */
  970. function mxArchiMate3Process(bounds, fill, stroke, strokewidth)
  971. {
  972. mxShape.call(this);
  973. this.bounds = bounds;
  974. this.fill = fill;
  975. this.stroke = stroke;
  976. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  977. };
  978. /**
  979. * Extends mxShape.
  980. */
  981. mxUtils.extend(mxArchiMate3Process, mxShape);
  982. mxArchiMate3Process.prototype.cst = {
  983. PROCESS : 'mxgraph.archimate3.process'
  984. };
  985. /**
  986. * Function: paintVertexShape
  987. *
  988. * Paints the vertex shape.
  989. */
  990. mxArchiMate3Process.prototype.paintVertexShape = function(c, x, y, w, h)
  991. {
  992. c.translate(x, y);
  993. this.background(c, 0, 0, w, h);
  994. c.setShadow(false);
  995. };
  996. mxArchiMate3Process.prototype.background = function(c, x, y, w, h)
  997. {
  998. c.begin();
  999. c.moveTo(0, h * 0.3);
  1000. c.lineTo(w * 0.6, h * 0.3);
  1001. c.lineTo(w * 0.6, 0);
  1002. c.lineTo(w, h * 0.5);
  1003. c.lineTo(w * 0.6, h);
  1004. c.lineTo(w * 0.6, h * 0.7);
  1005. c.lineTo(0, h * 0.7);
  1006. c.close();
  1007. c.fillAndStroke();
  1008. };
  1009. mxCellRenderer.registerShape(mxArchiMate3Process.prototype.cst.PROCESS, mxArchiMate3Process);
  1010. mxArchiMate3Process.prototype.getConstraints = function(style, w, h)
  1011. {
  1012. var constr = [];
  1013. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  1014. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  1015. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  1016. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  1017. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1018. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  1019. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  1020. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  1021. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  1022. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1023. return (constr);
  1024. };
  1025. //**********************************************************************************************************************************************************
  1026. //Driver
  1027. //**********************************************************************************************************************************************************
  1028. /**
  1029. * Extends mxShape.
  1030. */
  1031. function mxArchiMate3Driver(bounds, fill, stroke, strokewidth)
  1032. {
  1033. mxShape.call(this);
  1034. this.bounds = bounds;
  1035. this.fill = fill;
  1036. this.stroke = stroke;
  1037. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1038. };
  1039. /**
  1040. * Extends mxShape.
  1041. */
  1042. mxUtils.extend(mxArchiMate3Driver, mxShape);
  1043. mxArchiMate3Driver.prototype.cst = {
  1044. DRIVER : 'mxgraph.archimate3.driver'
  1045. };
  1046. /**
  1047. * Function: paintVertexShape
  1048. *
  1049. * Paints the vertex shape.
  1050. */
  1051. mxArchiMate3Driver.prototype.paintVertexShape = function(c, x, y, w, h)
  1052. {
  1053. c.translate(x, y);
  1054. this.background(c, 0, 0, w, h);
  1055. c.setShadow(false);
  1056. };
  1057. mxArchiMate3Driver.prototype.background = function(c, x, y, w, h)
  1058. {
  1059. c.begin();
  1060. c.moveTo(0, h * 0.5);
  1061. c.lineTo(w, h * 0.5);
  1062. c.moveTo(w * 0.5, 0);
  1063. c.lineTo(w * 0.5, h);
  1064. c.moveTo(w * 0.145, h * 0.145);
  1065. c.lineTo(w * 0.855, h * 0.855);
  1066. c.moveTo(w * 0.145, h * 0.855);
  1067. c.lineTo(w * 0.855, h * 0.145);
  1068. c.stroke();
  1069. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1070. c.setFillColor(strokeColor);
  1071. c.ellipse(w * 0.35, h * 0.35, w * 0.3, h * 0.3);
  1072. c.fillAndStroke();
  1073. c.setStrokeWidth(2);
  1074. c.ellipse(w * 0.1, h * 0.1, w * 0.8, h * 0.8);
  1075. c.stroke();
  1076. };
  1077. mxCellRenderer.registerShape(mxArchiMate3Driver.prototype.cst.DRIVER, mxArchiMate3Driver);
  1078. mxArchiMate3Driver.prototype.getConstraints = function(style, w, h)
  1079. {
  1080. var constr = [];
  1081. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  1082. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  1083. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  1084. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  1085. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1086. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  1087. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  1088. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  1089. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  1090. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1091. return (constr);
  1092. };
  1093. //**********************************************************************************************************************************************************
  1094. //Assessment
  1095. //**********************************************************************************************************************************************************
  1096. /**
  1097. * Extends mxShape.
  1098. */
  1099. function mxArchiMate3Assessment(bounds, fill, stroke, strokewidth)
  1100. {
  1101. mxShape.call(this);
  1102. this.bounds = bounds;
  1103. this.fill = fill;
  1104. this.stroke = stroke;
  1105. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1106. };
  1107. /**
  1108. * Extends mxShape.
  1109. */
  1110. mxUtils.extend(mxArchiMate3Assessment, mxShape);
  1111. mxArchiMate3Assessment.prototype.cst = {
  1112. ASSESSMENT : 'mxgraph.archimate3.assess'
  1113. };
  1114. /**
  1115. * Function: paintVertexShape
  1116. *
  1117. * Paints the vertex shape.
  1118. */
  1119. mxArchiMate3Assessment.prototype.paintVertexShape = function(c, x, y, w, h)
  1120. {
  1121. c.translate(x, y);
  1122. this.background(c, 0, 0, w, h);
  1123. c.setShadow(false);
  1124. };
  1125. mxArchiMate3Assessment.prototype.background = function(c, x, y, w, h)
  1126. {
  1127. c.ellipse(w * 0.2, 0, w * 0.8, h * 0.8);
  1128. c.fillAndStroke();
  1129. c.begin();
  1130. c.moveTo(0, h);
  1131. c.lineTo(w * 0.32, h * 0.68);
  1132. c.stroke();
  1133. };
  1134. mxCellRenderer.registerShape(mxArchiMate3Assessment.prototype.cst.ASSESSMENT, mxArchiMate3Assessment);
  1135. mxArchiMate3Assessment.prototype.getConstraints = function(style, w, h)
  1136. {
  1137. var constr = [];
  1138. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  1139. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  1140. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  1141. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  1142. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1143. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  1144. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  1145. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  1146. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  1147. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1148. return (constr);
  1149. };
  1150. //**********************************************************************************************************************************************************
  1151. //Goal
  1152. //**********************************************************************************************************************************************************
  1153. /**
  1154. * Extends mxShape.
  1155. */
  1156. function mxArchiMate3Goal(bounds, fill, stroke, strokewidth)
  1157. {
  1158. mxShape.call(this);
  1159. this.bounds = bounds;
  1160. this.fill = fill;
  1161. this.stroke = stroke;
  1162. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1163. };
  1164. /**
  1165. * Extends mxShape.
  1166. */
  1167. mxUtils.extend(mxArchiMate3Goal, mxShape);
  1168. mxArchiMate3Goal.prototype.cst = {
  1169. GOAL : 'mxgraph.archimate3.goal'
  1170. };
  1171. /**
  1172. * Function: paintVertexShape
  1173. *
  1174. * Paints the vertex shape.
  1175. */
  1176. mxArchiMate3Goal.prototype.paintVertexShape = function(c, x, y, w, h)
  1177. {
  1178. c.translate(x, y);
  1179. this.background(c, 0, 0, w, h);
  1180. c.setShadow(false);
  1181. };
  1182. mxArchiMate3Goal.prototype.background = function(c, x, y, w, h)
  1183. {
  1184. c.ellipse(0, 0, w, h);
  1185. c.fillAndStroke();
  1186. c.ellipse(w * 0.15, h * 0.15, w * 0.7, h * 0.7);
  1187. c.stroke();
  1188. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1189. c.setFillColor(strokeColor);
  1190. c.ellipse(w * 0.3, h * 0.3, w * 0.4, h * 0.4);
  1191. c.fillAndStroke();
  1192. };
  1193. mxCellRenderer.registerShape(mxArchiMate3Goal.prototype.cst.GOAL, mxArchiMate3Goal);
  1194. mxArchiMate3Goal.prototype.getConstraints = function(style, w, h)
  1195. {
  1196. var constr = [];
  1197. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  1198. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  1199. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  1200. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  1201. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1202. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  1203. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  1204. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  1205. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  1206. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1207. return (constr);
  1208. };
  1209. //**********************************************************************************************************************************************************
  1210. //Outcome
  1211. //**********************************************************************************************************************************************************
  1212. /**
  1213. * Extends mxShape.
  1214. */
  1215. function mxArchiMate3Outcome(bounds, fill, stroke, strokewidth)
  1216. {
  1217. mxShape.call(this);
  1218. this.bounds = bounds;
  1219. this.fill = fill;
  1220. this.stroke = stroke;
  1221. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1222. };
  1223. /**
  1224. * Extends mxShape.
  1225. */
  1226. mxUtils.extend(mxArchiMate3Outcome, mxShape);
  1227. mxArchiMate3Outcome.prototype.cst = {
  1228. OUTCOME : 'mxgraph.archimate3.outcome'
  1229. };
  1230. /**
  1231. * Function: paintVertexShape
  1232. *
  1233. * Paints the vertex shape.
  1234. */
  1235. mxArchiMate3Outcome.prototype.paintVertexShape = function(c, x, y, w, h)
  1236. {
  1237. c.translate(x, y);
  1238. this.background(c, 0, 0, w, h);
  1239. c.setShadow(false);
  1240. };
  1241. mxArchiMate3Outcome.prototype.background = function(c, x, y, w, h)
  1242. {
  1243. var sw = mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, 1);
  1244. c.ellipse(0, w * 0.2, w * 0.8, h * 0.8);
  1245. c.fillAndStroke();
  1246. c.ellipse(w * 0.15, w * 0.35, w * 0.5, h * 0.5);
  1247. c.stroke();
  1248. c.ellipse(w * 0.3, w * 0.5, w * 0.2, h * 0.2);
  1249. c.stroke();
  1250. c.setStrokeWidth(3 * sw);
  1251. c.setLineCap('round');
  1252. c.begin();
  1253. c.moveTo(w * 0.4, h * 0.6);
  1254. c.lineTo(w * 0.9, h * 0.1);
  1255. c.moveTo(w * 0.42, h * 0.4);
  1256. c.lineTo(w * 0.4, h * 0.6);
  1257. c.lineTo(w * 0.6, h * 0.58);
  1258. c.moveTo(w * 0.8, 0);
  1259. c.lineTo(w * 0.75, h * 0.25);
  1260. c.lineTo(w, h * 0.2);
  1261. c.stroke();
  1262. };
  1263. mxCellRenderer.registerShape(mxArchiMate3Outcome.prototype.cst.OUTCOME, mxArchiMate3Outcome);
  1264. mxArchiMate3Outcome.prototype.getConstraints = function(style, w, h)
  1265. {
  1266. var constr = [];
  1267. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  1268. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  1269. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  1270. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  1271. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1272. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  1273. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  1274. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  1275. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  1276. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1277. return (constr);
  1278. };
  1279. //**********************************************************************************************************************************************************
  1280. //Principle
  1281. //**********************************************************************************************************************************************************
  1282. /**
  1283. * Extends mxShape.
  1284. */
  1285. function mxArchiMate3Principle(bounds, fill, stroke, strokewidth)
  1286. {
  1287. mxShape.call(this);
  1288. this.bounds = bounds;
  1289. this.fill = fill;
  1290. this.stroke = stroke;
  1291. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1292. };
  1293. /**
  1294. * Extends mxShape.
  1295. */
  1296. mxUtils.extend(mxArchiMate3Principle, mxShape);
  1297. mxArchiMate3Principle.prototype.cst = {
  1298. PRINCIPLE : 'mxgraph.archimate3.principle'
  1299. };
  1300. /**
  1301. * Function: paintVertexShape
  1302. *
  1303. * Paints the vertex shape.
  1304. */
  1305. mxArchiMate3Principle.prototype.paintVertexShape = function(c, x, y, w, h)
  1306. {
  1307. c.translate(x, y);
  1308. this.background(c, 0, 0, w, h);
  1309. c.setShadow(false);
  1310. };
  1311. mxArchiMate3Principle.prototype.background = function(c, x, y, w, h)
  1312. {
  1313. c.begin();
  1314. c.moveTo(w * 0.05, h * 0.05);
  1315. c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.95, h * 0.05);
  1316. c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.95, h * 0.95);
  1317. c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.05, h * 0.95);
  1318. c.arcTo(w * 2.3, h * 2.3, 0, 0, 1, w * 0.05, h * 0.05);
  1319. c.close();
  1320. c.fillAndStroke();
  1321. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1322. c.setFillColor(strokeColor);
  1323. c.begin();
  1324. c.moveTo(w * 0.45, h * 0.7);
  1325. c.lineTo(w * 0.42, h * 0.15);
  1326. c.lineTo(w * 0.58, h * 0.15);
  1327. c.lineTo(w * 0.55, h * 0.7);
  1328. c.close();
  1329. c.fill();
  1330. c.rect(w * 0.45, h * 0.75, w * 0.1, h * 0.1);
  1331. c.fill();
  1332. };
  1333. mxCellRenderer.registerShape(mxArchiMate3Principle.prototype.cst.PRINCIPLE, mxArchiMate3Principle);
  1334. mxArchiMate3Principle.prototype.getConstraints = function(style, w, h)
  1335. {
  1336. var constr = [];
  1337. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.3), false));
  1338. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.3), false));
  1339. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.3), false));
  1340. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0), false));
  1341. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1342. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 1), false));
  1343. constr.push(new mxConnectionConstraint(new mxPoint(0.6, 0.7), false));
  1344. constr.push(new mxConnectionConstraint(new mxPoint(0.3, 0.7), false));
  1345. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.7), false));
  1346. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1347. return (constr);
  1348. };
  1349. //**********************************************************************************************************************************************************
  1350. //Facility
  1351. //**********************************************************************************************************************************************************
  1352. /**
  1353. * Extends mxShape.
  1354. */
  1355. function mxArchiMate3Facility(bounds, fill, stroke, strokewidth)
  1356. {
  1357. mxShape.call(this);
  1358. this.bounds = bounds;
  1359. this.fill = fill;
  1360. this.stroke = stroke;
  1361. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1362. };
  1363. /**
  1364. * Extends mxShape.
  1365. */
  1366. mxUtils.extend(mxArchiMate3Facility, mxShape);
  1367. mxArchiMate3Facility.prototype.cst = {
  1368. FACILITY : 'mxgraph.archimate3.facility'
  1369. };
  1370. /**
  1371. * Function: paintVertexShape
  1372. *
  1373. * Paints the vertex shape.
  1374. */
  1375. mxArchiMate3Facility.prototype.paintVertexShape = function(c, x, y, w, h)
  1376. {
  1377. c.translate(x, y);
  1378. this.background(c, 0, 0, w, h);
  1379. c.setShadow(false);
  1380. };
  1381. mxArchiMate3Facility.prototype.background = function(c, x, y, w, h)
  1382. {
  1383. c.begin();
  1384. c.moveTo(0, h);
  1385. c.lineTo(0, 0);
  1386. c.lineTo(w * 0.13, 0);
  1387. c.lineTo(w * 0.13, h * 0.7);
  1388. c.lineTo(w * 0.42, h * 0.55);
  1389. c.lineTo(w * 0.42, h * 0.7);
  1390. c.lineTo(w * 0.71, h * 0.55);
  1391. c.lineTo(w * 0.71, h * 0.7);
  1392. c.lineTo(w, h * 0.55);
  1393. c.lineTo(w, h);
  1394. c.close();
  1395. c.fillAndStroke();
  1396. };
  1397. mxCellRenderer.registerShape(mxArchiMate3Facility.prototype.cst.FACILITY, mxArchiMate3Facility);
  1398. mxArchiMate3Facility.prototype.getConstraints = function(style, w, h)
  1399. {
  1400. var constr = [];
  1401. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1402. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.2), false));
  1403. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.6), false));
  1404. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  1405. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.8), false));
  1406. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  1407. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.6), false));
  1408. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.2), false));
  1409. return (constr);
  1410. };
  1411. //**********************************************************************************************************************************************************
  1412. //Function
  1413. //**********************************************************************************************************************************************************
  1414. /**
  1415. * Extends mxShape.
  1416. */
  1417. function mxArchiMate3Function(bounds, fill, stroke, strokewidth)
  1418. {
  1419. mxShape.call(this);
  1420. this.bounds = bounds;
  1421. this.fill = fill;
  1422. this.stroke = stroke;
  1423. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1424. };
  1425. /**
  1426. * Extends mxShape.
  1427. */
  1428. mxUtils.extend(mxArchiMate3Function, mxShape);
  1429. mxArchiMate3Function.prototype.cst = {
  1430. FUNCTION : 'mxgraph.archimate3.function'
  1431. };
  1432. /**
  1433. * Function: paintVertexShape
  1434. *
  1435. * Paints the vertex shape.
  1436. */
  1437. mxArchiMate3Function.prototype.paintVertexShape = function(c, x, y, w, h)
  1438. {
  1439. c.translate(x, y);
  1440. this.background(c, 0, 0, w, h);
  1441. c.setShadow(false);
  1442. };
  1443. mxArchiMate3Function.prototype.background = function(c, x, y, w, h)
  1444. {
  1445. c.begin();
  1446. c.moveTo(w * 0.5, 0);
  1447. c.lineTo(w, h * 0.2);
  1448. c.lineTo(w, h);
  1449. c.lineTo(w * 0.5, h * 0.8);
  1450. c.lineTo(0, h);
  1451. c.lineTo(0, h * 0.2);
  1452. c.close();
  1453. c.fillAndStroke();
  1454. };
  1455. mxCellRenderer.registerShape(mxArchiMate3Function.prototype.cst.FUNCTION, mxArchiMate3Function);
  1456. mxArchiMate3Function.prototype.getConstraints = function(style, w, h)
  1457. {
  1458. var constr = [];
  1459. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1460. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.2), false));
  1461. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.6), false));
  1462. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  1463. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.8), false));
  1464. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  1465. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.6), false));
  1466. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.2), false));
  1467. return (constr);
  1468. };
  1469. //**********************************************************************************************************************************************************
  1470. //Grouping
  1471. //**********************************************************************************************************************************************************
  1472. /**
  1473. * Extends mxShape.
  1474. */
  1475. function mxArchiMate3Grouping(bounds, fill, stroke, strokewidth)
  1476. {
  1477. mxShape.call(this);
  1478. this.bounds = bounds;
  1479. this.fill = fill;
  1480. this.stroke = stroke;
  1481. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1482. };
  1483. /**
  1484. * Extends mxShape.
  1485. */
  1486. mxUtils.extend(mxArchiMate3Grouping, mxShape);
  1487. mxArchiMate3Grouping.prototype.cst = {
  1488. GROUPING : 'mxgraph.archimate3.grouping'
  1489. };
  1490. /**
  1491. * Function: paintVertexShape
  1492. *
  1493. * Paints the vertex shape.
  1494. */
  1495. mxArchiMate3Grouping.prototype.paintVertexShape = function(c, x, y, w, h)
  1496. {
  1497. c.translate(x, y);
  1498. this.background(c, 0, 0, w, h);
  1499. c.setShadow(false);
  1500. };
  1501. mxArchiMate3Grouping.prototype.background = function(c, x, y, w, h)
  1502. {
  1503. c.begin();
  1504. c.moveTo(0, h * 0.3);
  1505. c.lineTo(w, h * 0.3);
  1506. c.lineTo(w, h);
  1507. c.lineTo(0, h);
  1508. c.close();
  1509. c.moveTo(0, h * 0.3);
  1510. c.lineTo(0, 0);
  1511. c.lineTo(w * 0.75, 0);
  1512. c.lineTo(w * 0.75, h * 0.3);
  1513. c.fillAndStroke();
  1514. };
  1515. mxCellRenderer.registerShape(mxArchiMate3Grouping.prototype.cst.GROUPING, mxArchiMate3Grouping);
  1516. mxArchiMate3Grouping.prototype.getConstraints = function(style, w, h)
  1517. {
  1518. var constr = [];
  1519. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1520. constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.14), false));
  1521. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1522. constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.86), false));
  1523. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  1524. constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.86), false));
  1525. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1526. constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.14), false));
  1527. return (constr);
  1528. };
  1529. //**********************************************************************************************************************************************************
  1530. //Interaction
  1531. //**********************************************************************************************************************************************************
  1532. /**
  1533. * Extends mxShape.
  1534. */
  1535. function mxArchiMate3Interaction(bounds, fill, stroke, strokewidth)
  1536. {
  1537. mxShape.call(this);
  1538. this.bounds = bounds;
  1539. this.fill = fill;
  1540. this.stroke = stroke;
  1541. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1542. };
  1543. /**
  1544. * Extends mxShape.
  1545. */
  1546. mxUtils.extend(mxArchiMate3Interaction, mxShape);
  1547. mxArchiMate3Interaction.prototype.cst = {
  1548. INTERACTION : 'mxgraph.archimate3.interaction'
  1549. };
  1550. /**
  1551. * Function: paintVertexShape
  1552. *
  1553. * Paints the vertex shape.
  1554. */
  1555. mxArchiMate3Interaction.prototype.paintVertexShape = function(c, x, y, w, h)
  1556. {
  1557. c.translate(x, y);
  1558. this.background(c, 0, 0, w, h);
  1559. c.setShadow(false);
  1560. };
  1561. mxArchiMate3Interaction.prototype.background = function(c, x, y, w, h)
  1562. {
  1563. c.begin();
  1564. c.moveTo(w * 0.55, 0);
  1565. c.arcTo(w * 0.45, h * 0.5, 0, 0, 1, w * 0.55, h);
  1566. c.close();
  1567. c.moveTo(w * 0.45, 0);
  1568. c.arcTo(w * 0.45, h * 0.5, 0, 0, 0, w * 0.45, h);
  1569. c.close();
  1570. c.fillAndStroke();
  1571. };
  1572. mxCellRenderer.registerShape(mxArchiMate3Interaction.prototype.cst.INTERACTION, mxArchiMate3Interaction);
  1573. mxArchiMate3Interaction.prototype.getConstraints = function(style, w, h)
  1574. {
  1575. var constr = [];
  1576. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1577. constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.14), false));
  1578. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1579. constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.86), false));
  1580. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  1581. constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.86), false));
  1582. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1583. constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.14), false));
  1584. return (constr);
  1585. };
  1586. //**********************************************************************************************************************************************************
  1587. //Material
  1588. //**********************************************************************************************************************************************************
  1589. /**
  1590. * Extends mxShape.
  1591. */
  1592. function mxArchiMate3Material(bounds, fill, stroke, strokewidth)
  1593. {
  1594. mxShape.call(this);
  1595. this.bounds = bounds;
  1596. this.fill = fill;
  1597. this.stroke = stroke;
  1598. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1599. };
  1600. /**
  1601. * Extends mxShape.
  1602. */
  1603. mxUtils.extend(mxArchiMate3Material, mxShape);
  1604. mxArchiMate3Material.prototype.cst = {
  1605. MATERIAL : 'mxgraph.archimate3.material'
  1606. };
  1607. /**
  1608. * Function: paintVertexShape
  1609. *
  1610. * Paints the vertex shape.
  1611. */
  1612. mxArchiMate3Material.prototype.paintVertexShape = function(c, x, y, w, h)
  1613. {
  1614. c.translate(x, y);
  1615. this.background(c, 0, 0, w, h);
  1616. c.setShadow(false);
  1617. };
  1618. mxArchiMate3Material.prototype.background = function(c, x, y, w, h)
  1619. {
  1620. c.begin();
  1621. c.moveTo(0, h * 0.5);
  1622. c.lineTo(w * 0.25, 0);
  1623. c.lineTo(w * 0.75, 0);
  1624. c.lineTo(w, h * 0.5);
  1625. c.lineTo(w * 0.75, h);
  1626. c.lineTo(w * 0.25, h);
  1627. c.close();
  1628. c.moveTo(w * 0.15, h * 0.5);
  1629. c.lineTo(w * 0.31, h * 0.2);
  1630. c.moveTo(w * 0.69, h * 0.2);
  1631. c.lineTo(w * 0.85, h * 0.5);
  1632. c.moveTo(w * 0.68, h * 0.80);
  1633. c.lineTo(w * 0.32, h * 0.80);
  1634. c.fillAndStroke();
  1635. };
  1636. mxCellRenderer.registerShape(mxArchiMate3Material.prototype.cst.MATERIAL, mxArchiMate3Material);
  1637. mxArchiMate3Material.prototype.getConstraints = function(style, w, h)
  1638. {
  1639. var constr = [];
  1640. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1641. constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.14), false));
  1642. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1643. constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.86), false));
  1644. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  1645. constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.86), false));
  1646. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1647. constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.14), false));
  1648. return (constr);
  1649. };
  1650. //**********************************************************************************************************************************************************
  1651. //Location Icon
  1652. //**********************************************************************************************************************************************************
  1653. /**
  1654. * Extends mxShape.
  1655. */
  1656. function mxArchiMate3LocationIcon(bounds, fill, stroke, strokewidth)
  1657. {
  1658. mxShape.call(this);
  1659. this.bounds = bounds;
  1660. this.fill = fill;
  1661. this.stroke = stroke;
  1662. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1663. };
  1664. /**
  1665. * Extends mxShape.
  1666. */
  1667. mxUtils.extend(mxArchiMate3LocationIcon, mxShape);
  1668. mxArchiMate3LocationIcon.prototype.cst = {
  1669. LOCATION_ICON : 'mxgraph.archimate3.locationIcon'
  1670. };
  1671. /**
  1672. * Function: paintVertexShape
  1673. *
  1674. * Paints the vertex shape.
  1675. */
  1676. mxArchiMate3LocationIcon.prototype.paintVertexShape = function(c, x, y, w, h)
  1677. {
  1678. c.translate(x, y);
  1679. this.background(c, 0, 0, w, h);
  1680. c.setShadow(false);
  1681. };
  1682. mxArchiMate3LocationIcon.prototype.background = function(c, x, y, w, h)
  1683. {
  1684. c.translate(3, 0);
  1685. w = w - 6;
  1686. c.begin();
  1687. c.moveTo(w * 0.5, 0);
  1688. c.curveTo(w * 0.2842, 0, 0, h * 0.1006, 0, h * 0.3001);
  1689. c.curveTo(0, h * 0.4071, w * 0.0776, h * 0.4777, w * 0.1524, h * 0.5485);
  1690. c.curveTo(w * 0.2901, h * 0.6788, w * 0.4275, h * 0.7993, w * 0.5, h);
  1691. c.curveTo(w * 0.5725, h * 0.7993, w * 0.7099, h * 0.6788, w * 0.8476, h * 0.5485);
  1692. c.curveTo(w * 0.9224, h * 0.4777, w, h * 0.4071, w, h * 0.3001);
  1693. c.curveTo(w, h * 0.1006, w * 0.7158, 0, w * 0.5, 0);
  1694. c.close();
  1695. c.fillAndStroke();
  1696. };
  1697. mxCellRenderer.registerShape(mxArchiMate3LocationIcon.prototype.cst.LOCATION_ICON, mxArchiMate3LocationIcon);
  1698. mxArchiMate3LocationIcon.prototype.getConstraints = function(style, w, h)
  1699. {
  1700. var constr = [];
  1701. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1702. constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.14), false));
  1703. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  1704. constr.push(new mxConnectionConstraint(new mxPoint(0.86, 0.86), false));
  1705. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  1706. constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.86), false));
  1707. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  1708. constr.push(new mxConnectionConstraint(new mxPoint(0.14, 0.14), false));
  1709. return (constr);
  1710. };
  1711. //**********************************************************************************************************************************************************
  1712. //Service
  1713. //**********************************************************************************************************************************************************
  1714. /**
  1715. * Extends mxShape.
  1716. */
  1717. function mxArchiMate3Service(bounds, fill, stroke, strokewidth)
  1718. {
  1719. mxShape.call(this);
  1720. this.bounds = bounds;
  1721. this.fill = fill;
  1722. this.stroke = stroke;
  1723. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1724. };
  1725. /**
  1726. * Extends mxShape.
  1727. */
  1728. mxUtils.extend(mxArchiMate3Service, mxShape);
  1729. mxArchiMate3Service.prototype.cst = {
  1730. SERVICE : 'mxgraph.archimate3.service'
  1731. };
  1732. /**
  1733. * Function: paintVertexShape
  1734. *
  1735. * Paints the vertex shape.
  1736. */
  1737. mxArchiMate3Service.prototype.paintVertexShape = function(c, x, y, w, h)
  1738. {
  1739. c.translate(x, y);
  1740. this.background(c, 0, 0, w, h);
  1741. c.setShadow(false);
  1742. };
  1743. mxArchiMate3Service.prototype.background = function(c, x, y, w, h)
  1744. {
  1745. var w1 = Math.max(w - h * 0.5, w * 0.5);
  1746. var w2 = Math.min(h * 0.5, w * 0.5);
  1747. c.begin();
  1748. c.moveTo(w1, 0);
  1749. c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w1, h);
  1750. c.lineTo(w2, h);
  1751. c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w2, 0);
  1752. c.close();
  1753. c.fillAndStroke();
  1754. };
  1755. mxCellRenderer.registerShape(mxArchiMate3Service.prototype.cst.SERVICE, mxArchiMate3Service);
  1756. mxArchiMate3Service.prototype.getConstraints = function(style, w, h)
  1757. {
  1758. var constr = [];
  1759. var w1 = Math.max(w - h * 0.5, w * 0.5);
  1760. var w2 = Math.min(h * 0.5, w * 0.5);
  1761. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1762. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  1763. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1, 0));
  1764. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1, h));
  1765. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2, h));
  1766. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2, 0));
  1767. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1 + h * 0.355, h * 0.145));
  1768. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1 + h * 0.5, h * 0.5));
  1769. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w1 + h * 0.355, h * 0.855));
  1770. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2 - h * 0.355, h * 0.145));
  1771. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2 - h * 0.5, h * 0.5));
  1772. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w2 - h * 0.355, h * 0.855));
  1773. return (constr);
  1774. };
  1775. //**********************************************************************************************************************************************************
  1776. //Requirement
  1777. //**********************************************************************************************************************************************************
  1778. /**
  1779. * Extends mxShape.
  1780. */
  1781. function mxArchiMate3Requirement(bounds, fill, stroke, strokewidth)
  1782. {
  1783. mxShape.call(this);
  1784. this.bounds = bounds;
  1785. this.fill = fill;
  1786. this.stroke = stroke;
  1787. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1788. };
  1789. /**
  1790. * Extends mxShape.
  1791. */
  1792. mxUtils.extend(mxArchiMate3Requirement, mxShape);
  1793. mxArchiMate3Requirement.prototype.cst = {
  1794. REQUIREMENT : 'mxgraph.archimate3.requirement'
  1795. };
  1796. /**
  1797. * Function: paintVertexShape
  1798. *
  1799. * Paints the vertex shape.
  1800. */
  1801. mxArchiMate3Requirement.prototype.paintVertexShape = function(c, x, y, w, h)
  1802. {
  1803. c.translate(x, y);
  1804. this.background(c, 0, 0, w, h);
  1805. c.setShadow(false);
  1806. };
  1807. mxArchiMate3Requirement.prototype.background = function(c, x, y, w, h)
  1808. {
  1809. c.begin();
  1810. c.moveTo(w * 0.25, 0);
  1811. c.lineTo(w, 0);
  1812. c.lineTo(w * 0.75, h);
  1813. c.lineTo(0, h);
  1814. c.close();
  1815. c.fillAndStroke();
  1816. };
  1817. mxCellRenderer.registerShape(mxArchiMate3Requirement.prototype.cst.REQUIREMENT, mxArchiMate3Requirement);
  1818. mxArchiMate3Requirement.prototype.getConstraints = function(style, w, h)
  1819. {
  1820. var constr = [];
  1821. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  1822. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1823. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  1824. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  1825. constr.push(new mxConnectionConstraint(new mxPoint(0.9375, 0.25), false));
  1826. constr.push(new mxConnectionConstraint(new mxPoint(0.875, 0.5), false));
  1827. constr.push(new mxConnectionConstraint(new mxPoint(0.8125, 0.75), false));
  1828. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  1829. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  1830. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  1831. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  1832. constr.push(new mxConnectionConstraint(new mxPoint(0.0625, 0.75), false));
  1833. constr.push(new mxConnectionConstraint(new mxPoint(0.125, 0.5), false));
  1834. constr.push(new mxConnectionConstraint(new mxPoint(0.1875, 0.25), false));
  1835. return (constr);
  1836. };
  1837. //**********************************************************************************************************************************************************
  1838. //Constraint
  1839. //**********************************************************************************************************************************************************
  1840. /**
  1841. * Extends mxShape.
  1842. */
  1843. function mxArchiMate3Constraint(bounds, fill, stroke, strokewidth)
  1844. {
  1845. mxShape.call(this);
  1846. this.bounds = bounds;
  1847. this.fill = fill;
  1848. this.stroke = stroke;
  1849. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1850. };
  1851. /**
  1852. * Extends mxShape.
  1853. */
  1854. mxUtils.extend(mxArchiMate3Constraint, mxShape);
  1855. mxArchiMate3Constraint.prototype.cst = {
  1856. CONSTRAINT : 'mxgraph.archimate3.constraint'
  1857. };
  1858. /**
  1859. * Function: paintVertexShape
  1860. *
  1861. * Paints the vertex shape.
  1862. */
  1863. mxArchiMate3Constraint.prototype.paintVertexShape = function(c, x, y, w, h)
  1864. {
  1865. c.translate(x, y);
  1866. this.background(c, 0, 0, w, h);
  1867. c.setShadow(false);
  1868. };
  1869. mxArchiMate3Constraint.prototype.background = function(c, x, y, w, h)
  1870. {
  1871. c.begin();
  1872. c.moveTo(w * 0.25, 0);
  1873. c.lineTo(w, 0);
  1874. c.lineTo(w * 0.75, h);
  1875. c.lineTo(0, h);
  1876. c.close();
  1877. c.moveTo(w * 0.45, 0);
  1878. c.lineTo(w * 0.2, h);
  1879. c.fillAndStroke();
  1880. };
  1881. mxCellRenderer.registerShape(mxArchiMate3Constraint.prototype.cst.CONSTRAINT, mxArchiMate3Constraint);
  1882. mxArchiMate3Constraint.prototype.getConstraints = function(style, w, h)
  1883. {
  1884. var constr = [];
  1885. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  1886. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  1887. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  1888. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  1889. constr.push(new mxConnectionConstraint(new mxPoint(0.9375, 0.25), false));
  1890. constr.push(new mxConnectionConstraint(new mxPoint(0.875, 0.5), false));
  1891. constr.push(new mxConnectionConstraint(new mxPoint(0.8125, 0.75), false));
  1892. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  1893. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  1894. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  1895. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  1896. constr.push(new mxConnectionConstraint(new mxPoint(0.0625, 0.75), false));
  1897. constr.push(new mxConnectionConstraint(new mxPoint(0.125, 0.5), false));
  1898. constr.push(new mxConnectionConstraint(new mxPoint(0.1875, 0.25), false));
  1899. return (constr);
  1900. };
  1901. //**********************************************************************************************************************************************************
  1902. //Equipment
  1903. //**********************************************************************************************************************************************************
  1904. /**
  1905. * Extends mxShape.
  1906. */
  1907. function mxArchiMate3Equipment(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(mxArchiMate3Equipment, mxShape);
  1919. mxArchiMate3Equipment.prototype.cst = {
  1920. EQUIPMENT : 'mxgraph.archimate3.equipment'
  1921. };
  1922. /**
  1923. * Function: paintVertexShape
  1924. *
  1925. * Paints the vertex shape.
  1926. */
  1927. mxArchiMate3Equipment.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. mxArchiMate3Equipment.prototype.background = function(c, x, y, w, h)
  1934. {
  1935. c.begin();
  1936. c.moveTo(w * 0.72, h * 0.38);
  1937. c.curveTo(w * 0.78, w * 0.38, w * 0.85, h * 0.34, w * 0.85, h * 0.26);
  1938. c.curveTo(w * 0.85, w * 0.18, w * 0.78, h * 0.14, w * 0.73, h * 0.14);
  1939. c.curveTo(w * 0.64, w * 0.14, w * 0.59, h * 0.2, w * 0.59, h * 0.26);
  1940. c.curveTo(w * 0.59, h * 0.33, w * 0.65, w * 0.38, w * 0.72, h * 0.38);
  1941. c.close();
  1942. c.moveTo(w * 0.68, h * 0.52);
  1943. c.lineTo(w * 0.67, h * 0.45);
  1944. c.lineTo(w * 0.61, h * 0.43);
  1945. c.lineTo(w * 0.56, h * 0.48);
  1946. c.lineTo(w * 0.5, h * 0.42);
  1947. c.lineTo(w * 0.54, h * 0.36);
  1948. c.lineTo(w * 0.52, h * 0.31);
  1949. c.lineTo(w * 0.45, h * 0.31);
  1950. c.lineTo(w * 0.45, h * 0.22);
  1951. c.lineTo(w * 0.52, h * 0.21);
  1952. c.lineTo(w * 0.54, h * 0.16);
  1953. c.lineTo(w * 0.5, h * 0.11);
  1954. c.lineTo(w * 0.56, h * 0.05);
  1955. c.lineTo(w * 0.62, h * 0.09);
  1956. c.lineTo(w * 0.67, h * 0.07);
  1957. c.lineTo(w * 0.68, 0);
  1958. c.lineTo(w * 0.77, 0);
  1959. c.lineTo(w * 0.78, h * 0.07);
  1960. c.lineTo(w * 0.83, h * 0.09);
  1961. c.lineTo(w * 0.89, h * 0.05);
  1962. c.lineTo(w * 0.95, h * 0.11);
  1963. c.lineTo(w * 0.91, h * 0.16);
  1964. c.lineTo(w * 0.93, h * 0.21);
  1965. c.lineTo(w, h * 0.22);
  1966. c.lineTo(w, h * 0.31);
  1967. c.lineTo(w * 0.93, h * 0.31);
  1968. c.lineTo(w * 0.91, h * 0.36);
  1969. c.lineTo(w * 0.95, h * 0.41);
  1970. c.lineTo(w * 0.89, h * 0.47);
  1971. c.lineTo(w * 0.83, h * 0.43);
  1972. c.lineTo(w * 0.78, h * 0.45);
  1973. c.lineTo(w * 0.77, h * 0.52);
  1974. c.lineTo(w * 0.68, h * 0.52);
  1975. c.close();
  1976. c.moveTo(w * 0.36, h * 0.81);
  1977. c.curveTo(w * 0.44, h * 0.81, w * 0.52, h * 0.75, w * 0.52, h * 0.67);
  1978. c.curveTo(w * 0.52, h * 0.59, w * 0.45, h * 0.51, w * 0.35, h * 0.51);
  1979. c.curveTo(w * 0.27, h * 0.51, w * 0.19, h * 0.58, w * 0.19, h * 0.67);
  1980. c.curveTo(w * 0.19, h * 0.74, w * 0.27, h * 0.82, w * 0.36, h * 0.81);
  1981. c.close();
  1982. c.moveTo(w * 0.21, h * 0.98);
  1983. c.lineTo(w * 0.22, h * 0.89);
  1984. c.lineTo(w * 0.16, h * 0.85);
  1985. c.lineTo(w * 0.08, h * 0.88);
  1986. c.lineTo(w * 0.02, h * 0.79);
  1987. c.lineTo(w * 0.09, h * 0.74);
  1988. c.lineTo(w * 0.08, h * 0.67);
  1989. c.lineTo(0, h * 0.63);
  1990. c.lineTo(w * 0.03, h * 0.53);
  1991. c.lineTo(w * 0.12, h * 0.54);
  1992. c.lineTo(w * 0.16, h * 0.48);
  1993. c.lineTo(w * 0.13, h * 0.4);
  1994. c.lineTo(w * 0.22, h * 0.35);
  1995. c.lineTo(w * 0.28, h * 0.42);
  1996. c.lineTo(w * 0.36, h * 0.41);
  1997. c.lineTo(w * 0.39, h * 0.33);
  1998. c.lineTo(w * 0.5, h * 0.36);
  1999. c.lineTo(w * 0.49, h * 0.45);
  2000. c.lineTo(w * 0.55, h * 0.49);
  2001. c.lineTo(w * 0.63, h * 0.45);
  2002. c.lineTo(w * 0.69, h * 0.54);
  2003. c.lineTo(w * 0.62, h * 0.6);
  2004. c.lineTo(w * 0.63, h * 0.67);
  2005. c.lineTo(w * 0.71, h * 0.7);
  2006. c.lineTo(w * 0.68, h * 0.8);
  2007. c.lineTo(w * 0.59, h * 0.79);
  2008. c.lineTo(w * 0.55, h * 0.85);
  2009. c.lineTo(w * 0.59, h * 0.79);
  2010. c.lineTo(w * 0.55, h * 0.85);
  2011. c.lineTo(w * 0.59, h * 0.93);
  2012. c.lineTo(w * 0.49, h * 0.98);
  2013. c.lineTo(w * 0.43, h * 0.91);
  2014. c.lineTo(w * 0.36, h * 0.92);
  2015. c.lineTo(w * 0.32, h);
  2016. c.lineTo(w * 0.21, h * 0.98);
  2017. c.close();
  2018. c.fillAndStroke();
  2019. };
  2020. mxCellRenderer.registerShape(mxArchiMate3Equipment.prototype.cst.EQUIPMENT, mxArchiMate3Equipment);
  2021. mxArchiMate3Equipment.prototype.getConstraints = function(style, w, h)
  2022. {
  2023. var constr = [];
  2024. var w1 = Math.max(w - h * 0.5, w * 0.5);
  2025. var w2 = Math.min(h * 0.5, w * 0.5);
  2026. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - h * 0.5, 0));
  2027. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - h * 0.5, h));
  2028. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h));
  2029. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, h * 0.5, h * 0.5));
  2030. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2031. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2032. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - h * 0.5) * 0.5, 0));
  2033. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - h * 0.5) * 0.5, h));
  2034. return (constr);
  2035. };
  2036. //**********************************************************************************************************************************************************
  2037. //Event
  2038. //**********************************************************************************************************************************************************
  2039. /**
  2040. * Extends mxShape.
  2041. */
  2042. function mxArchiMate3Event(bounds, fill, stroke, strokewidth)
  2043. {
  2044. mxShape.call(this);
  2045. this.bounds = bounds;
  2046. this.fill = fill;
  2047. this.stroke = stroke;
  2048. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2049. };
  2050. /**
  2051. * Extends mxShape.
  2052. */
  2053. mxUtils.extend(mxArchiMate3Event, mxShape);
  2054. mxArchiMate3Event.prototype.cst = {
  2055. EVENT : 'mxgraph.archimate3.event'
  2056. };
  2057. /**
  2058. * Function: paintVertexShape
  2059. *
  2060. * Paints the vertex shape.
  2061. */
  2062. mxArchiMate3Event.prototype.paintVertexShape = function(c, x, y, w, h)
  2063. {
  2064. c.translate(x, y);
  2065. this.background(c, 0, 0, w, h);
  2066. c.setShadow(false);
  2067. };
  2068. mxArchiMate3Event.prototype.background = function(c, x, y, w, h)
  2069. {
  2070. c.begin();
  2071. c.moveTo(w - h * 0.5, 0);
  2072. c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w - h * 0.5, h);
  2073. c.lineTo(0, h);
  2074. c.lineTo(h * 0.5, h * 0.5);
  2075. c.lineTo(0, 0);
  2076. c.close();
  2077. c.fillAndStroke();
  2078. };
  2079. mxCellRenderer.registerShape(mxArchiMate3Event.prototype.cst.EVENT, mxArchiMate3Event);
  2080. mxArchiMate3Event.prototype.getConstraints = function(style, w, h)
  2081. {
  2082. var constr = [];
  2083. var w1 = Math.max(w - h * 0.5, w * 0.5);
  2084. var w2 = Math.min(h * 0.5, w * 0.5);
  2085. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - h * 0.5, 0));
  2086. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - h * 0.5, h));
  2087. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h));
  2088. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, h * 0.5, h * 0.5));
  2089. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2090. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2091. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - h * 0.5) * 0.5, 0));
  2092. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - h * 0.5) * 0.5, h));
  2093. return (constr);
  2094. };
  2095. //**********************************************************************************************************************************************************
  2096. //Event 2
  2097. //**********************************************************************************************************************************************************
  2098. /**
  2099. * Extends mxShape.
  2100. */
  2101. function mxArchiMate3Event2(bounds, fill, stroke, strokewidth)
  2102. {
  2103. mxShape.call(this);
  2104. this.bounds = bounds;
  2105. this.fill = fill;
  2106. this.stroke = stroke;
  2107. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2108. };
  2109. /**
  2110. * Extends mxShape.
  2111. */
  2112. mxUtils.extend(mxArchiMate3Event2, mxShape);
  2113. mxArchiMate3Event2.prototype.cst = {
  2114. EVENT2 : 'mxgraph.archimate3.event2'
  2115. };
  2116. /**
  2117. * Function: paintVertexShape
  2118. *
  2119. * Paints the vertex shape.
  2120. */
  2121. mxArchiMate3Event2.prototype.paintVertexShape = function(c, x, y, w, h)
  2122. {
  2123. c.translate(x, y);
  2124. this.background(c, 0, 0, w, h);
  2125. c.setShadow(false);
  2126. };
  2127. mxArchiMate3Event2.prototype.background = function(c, x, y, w, h)
  2128. {
  2129. c.begin();
  2130. c.moveTo(w - h * 0.5, 0);
  2131. c.arcTo(h * 0.5, h * 0.5, 0, 0, 1, w - h * 0.5, h);
  2132. c.lineTo(0, h);
  2133. c.arcTo(h * 0.5, h * 0.5, 0, 0, 0, 0, 0);
  2134. c.close();
  2135. c.fillAndStroke();
  2136. };
  2137. mxCellRenderer.registerShape(mxArchiMate3Event2.prototype.cst.EVENT2, mxArchiMate3Event2);
  2138. //**********************************************************************************************************************************************************
  2139. //Actor
  2140. //**********************************************************************************************************************************************************
  2141. /**
  2142. * Extends mxShape.
  2143. */
  2144. function mxArchiMate3Actor(bounds, fill, stroke, strokewidth)
  2145. {
  2146. mxShape.call(this);
  2147. this.bounds = bounds;
  2148. this.fill = fill;
  2149. this.stroke = stroke;
  2150. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2151. };
  2152. /**
  2153. * Extends mxShape.
  2154. */
  2155. mxUtils.extend(mxArchiMate3Actor, mxShape);
  2156. mxArchiMate3Actor.prototype.cst = {
  2157. ACTOR : 'mxgraph.archimate3.actor'
  2158. };
  2159. /**
  2160. * Function: paintVertexShape
  2161. *
  2162. * Paints the vertex shape.
  2163. */
  2164. mxArchiMate3Actor.prototype.paintVertexShape = function(c, x, y, w, h)
  2165. {
  2166. c.translate(x, y);
  2167. this.background(c, 0, 0, w, h);
  2168. c.setShadow(false);
  2169. };
  2170. mxArchiMate3Actor.prototype.background = function(c, x, y, w, h)
  2171. {
  2172. c.ellipse(w * 0.2, 0, w * 0.6, h * 0.3);
  2173. c.fillAndStroke();
  2174. c.begin();
  2175. c.moveTo(w * 0.5, h * 0.3);
  2176. c.lineTo(w * 0.5, h * 0.75);
  2177. c.moveTo(0, h * 0.45);
  2178. c.lineTo(w, h * 0.45);
  2179. c.moveTo(0, h);
  2180. c.lineTo(w * 0.5, h * 0.75);
  2181. c.lineTo(w, h);
  2182. c.stroke();
  2183. };
  2184. mxCellRenderer.registerShape(mxArchiMate3Actor.prototype.cst.ACTOR, mxArchiMate3Actor);
  2185. mxArchiMate3Actor.prototype.getConstraints = function(style, w, h)
  2186. {
  2187. var constr = [];
  2188. constr.push(new mxConnectionConstraint(new mxPoint(0.2, 0.15), false));
  2189. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2190. constr.push(new mxConnectionConstraint(new mxPoint(0.8, 0.15), false));
  2191. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.45), false));
  2192. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.45), false));
  2193. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  2194. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  2195. return (constr);
  2196. };
  2197. //**********************************************************************************************************************************************************
  2198. //Role
  2199. //**********************************************************************************************************************************************************
  2200. /**
  2201. * Extends mxShape.
  2202. */
  2203. function mxArchiMate3Role(bounds, fill, stroke, strokewidth)
  2204. {
  2205. mxShape.call(this);
  2206. this.bounds = bounds;
  2207. this.fill = fill;
  2208. this.stroke = stroke;
  2209. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2210. };
  2211. /**
  2212. * Extends mxShape.
  2213. */
  2214. mxUtils.extend(mxArchiMate3Role, mxShape);
  2215. mxArchiMate3Role.prototype.cst = {
  2216. ROLE : 'mxgraph.archimate3.role'
  2217. };
  2218. /**
  2219. * Function: paintVertexShape
  2220. *
  2221. * Paints the vertex shape.
  2222. */
  2223. mxArchiMate3Role.prototype.paintVertexShape = function(c, x, y, w, h)
  2224. {
  2225. c.translate(x, y);
  2226. this.background(c, 0, 0, w, h);
  2227. c.setShadow(false);
  2228. };
  2229. mxArchiMate3Role.prototype.background = function(c, x, y, w, h)
  2230. {
  2231. c.begin();
  2232. c.moveTo(w * 0.8, 0);
  2233. c.lineTo(w * 0.2, 0);
  2234. c.arcTo(w * 0.2, h * 0.5, 0, 0, 0, w * 0.2, h);
  2235. c.lineTo(w * 0.8, h);
  2236. c.fillAndStroke();
  2237. c.ellipse(w * 0.6, 0, w * 0.4, h);
  2238. c.fillAndStroke();
  2239. };
  2240. mxCellRenderer.registerShape(mxArchiMate3Role.prototype.cst.ROLE, mxArchiMate3Role);
  2241. mxArchiMate3Role.prototype.getConstraints = function(style, w, h)
  2242. {
  2243. var constr = [];
  2244. constr.push(new mxConnectionConstraint(new mxPoint(0.2, 0), false));
  2245. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2246. constr.push(new mxConnectionConstraint(new mxPoint(0.8, 0), false));
  2247. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2248. constr.push(new mxConnectionConstraint(new mxPoint(0.8, 1), false));
  2249. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  2250. constr.push(new mxConnectionConstraint(new mxPoint(0.2, 1), false));
  2251. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  2252. return (constr);
  2253. };
  2254. //**********************************************************************************************************************************************************
  2255. //Business Object
  2256. //**********************************************************************************************************************************************************
  2257. /**
  2258. * Extends mxShape.
  2259. */
  2260. function mxArchiMate3BusinessObject(bounds, fill, stroke, strokewidth)
  2261. {
  2262. mxShape.call(this);
  2263. this.bounds = bounds;
  2264. this.fill = fill;
  2265. this.stroke = stroke;
  2266. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2267. };
  2268. /**
  2269. * Extends mxShape.
  2270. */
  2271. mxUtils.extend(mxArchiMate3BusinessObject, mxShape);
  2272. mxArchiMate3BusinessObject.prototype.cst = {
  2273. BUSINESS_OBJECT : 'mxgraph.archimate3.businessObject'
  2274. };
  2275. /**
  2276. * Function: paintVertexShape
  2277. *
  2278. * Paints the vertex shape.
  2279. */
  2280. mxArchiMate3BusinessObject.prototype.paintVertexShape = function(c, x, y, w, h)
  2281. {
  2282. c.translate(x, y);
  2283. this.background(c, 0, 0, w, h);
  2284. c.setShadow(false);
  2285. this.foreground(c, 0, 0, w, h);
  2286. };
  2287. mxArchiMate3BusinessObject.prototype.background = function(c, x, y, w, h)
  2288. {
  2289. c.rect(0, 0, w, h);
  2290. c.fillAndStroke();
  2291. };
  2292. mxArchiMate3BusinessObject.prototype.foreground = function(c, x, y, w, h)
  2293. {
  2294. if (h >= 15)
  2295. {
  2296. c.begin();
  2297. c.moveTo(0, 15);
  2298. c.lineTo(w, 15);
  2299. c.stroke();
  2300. }
  2301. };
  2302. mxCellRenderer.registerShape(mxArchiMate3BusinessObject.prototype.cst.BUSINESS_OBJECT, mxArchiMate3BusinessObject);
  2303. mxArchiMate3BusinessObject.prototype.getConstraints = function(style, w, h)
  2304. {
  2305. var constr = [];
  2306. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2307. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  2308. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2309. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  2310. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  2311. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  2312. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2313. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  2314. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  2315. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  2316. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  2317. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  2318. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  2319. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  2320. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  2321. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  2322. return (constr);
  2323. };
  2324. //**********************************************************************************************************************************************************
  2325. //Contract
  2326. //**********************************************************************************************************************************************************
  2327. /**
  2328. * Extends mxShape.
  2329. */
  2330. function mxArchiMate3Contract(bounds, fill, stroke, strokewidth)
  2331. {
  2332. mxShape.call(this);
  2333. this.bounds = bounds;
  2334. this.fill = fill;
  2335. this.stroke = stroke;
  2336. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2337. };
  2338. /**
  2339. * Extends mxShape.
  2340. */
  2341. mxUtils.extend(mxArchiMate3Contract, mxShape);
  2342. mxArchiMate3Contract.prototype.cst = {
  2343. CONTRACT : 'mxgraph.archimate3.contract'
  2344. };
  2345. /**
  2346. * Function: paintVertexShape
  2347. *
  2348. * Paints the vertex shape.
  2349. */
  2350. mxArchiMate3Contract.prototype.paintVertexShape = function(c, x, y, w, h)
  2351. {
  2352. c.translate(x, y);
  2353. this.background(c, 0, 0, w, h);
  2354. c.setShadow(false);
  2355. this.foreground(c, 0, 0, w, h);
  2356. };
  2357. mxArchiMate3Contract.prototype.background = function(c, x, y, w, h)
  2358. {
  2359. c.rect(0, 0, w, h);
  2360. c.fillAndStroke();
  2361. };
  2362. mxArchiMate3Contract.prototype.foreground = function(c, x, y, w, h)
  2363. {
  2364. if (h >= 15)
  2365. {
  2366. c.begin();
  2367. c.moveTo(0, 15);
  2368. c.lineTo(w, 15);
  2369. c.stroke();
  2370. }
  2371. if (h >= 30)
  2372. {
  2373. c.begin();
  2374. c.moveTo(0, h - 15);
  2375. c.lineTo(w, h - 15);
  2376. c.stroke();
  2377. }
  2378. };
  2379. mxCellRenderer.registerShape(mxArchiMate3Contract.prototype.cst.CONTRACT, mxArchiMate3Contract);
  2380. mxArchiMate3Contract.prototype.getConstraints = function(style, w, h)
  2381. {
  2382. var constr = [];
  2383. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2384. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  2385. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2386. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  2387. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  2388. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  2389. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2390. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  2391. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  2392. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  2393. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  2394. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  2395. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  2396. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  2397. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  2398. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  2399. return (constr);
  2400. };
  2401. //**********************************************************************************************************************************************************
  2402. //Product
  2403. //**********************************************************************************************************************************************************
  2404. /**
  2405. * Extends mxShape.
  2406. */
  2407. function mxArchiMate3Product(bounds, fill, stroke, strokewidth)
  2408. {
  2409. mxShape.call(this);
  2410. this.bounds = bounds;
  2411. this.fill = fill;
  2412. this.stroke = stroke;
  2413. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2414. };
  2415. /**
  2416. * Extends mxShape.
  2417. */
  2418. mxUtils.extend(mxArchiMate3Product, mxShape);
  2419. mxArchiMate3Product.prototype.cst = {
  2420. PRODUCT : 'mxgraph.archimate3.product'
  2421. };
  2422. /**
  2423. * Function: paintVertexShape
  2424. *
  2425. * Paints the vertex shape.
  2426. */
  2427. mxArchiMate3Product.prototype.paintVertexShape = function(c, x, y, w, h)
  2428. {
  2429. c.translate(x, y);
  2430. this.background(c, 0, 0, w, h);
  2431. c.setShadow(false);
  2432. this.foreground(c, 0, 0, w, h);
  2433. };
  2434. mxArchiMate3Product.prototype.background = function(c, x, y, w, h)
  2435. {
  2436. c.rect(0, 0, w, h);
  2437. c.fillAndStroke();
  2438. };
  2439. mxArchiMate3Product.prototype.foreground = function(c, x, y, w, h)
  2440. {
  2441. if (h >= 15)
  2442. {
  2443. c.begin();
  2444. c.moveTo(0, 15);
  2445. c.lineTo(w * 0.6, 15);
  2446. c.lineTo(w * 0.6, 0);
  2447. c.stroke();
  2448. }
  2449. };
  2450. mxCellRenderer.registerShape(mxArchiMate3Product.prototype.cst.PRODUCT, mxArchiMate3Product);
  2451. mxArchiMate3Product.prototype.getConstraints = function(style, w, h)
  2452. {
  2453. var constr = [];
  2454. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2455. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  2456. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2457. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  2458. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  2459. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  2460. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2461. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  2462. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  2463. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  2464. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  2465. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  2466. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  2467. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  2468. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  2469. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  2470. return (constr);
  2471. };
  2472. //**********************************************************************************************************************************************************
  2473. //Representation
  2474. //**********************************************************************************************************************************************************
  2475. /**
  2476. * Extends mxShape.
  2477. */
  2478. function mxArchiMate3Representation(bounds, fill, stroke, strokewidth)
  2479. {
  2480. mxShape.call(this);
  2481. this.bounds = bounds;
  2482. this.fill = fill;
  2483. this.stroke = stroke;
  2484. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2485. };
  2486. /**
  2487. * Extends mxShape.
  2488. */
  2489. mxUtils.extend(mxArchiMate3Representation, mxShape);
  2490. mxArchiMate3Representation.prototype.cst = {
  2491. REPRESENTATION : 'mxgraph.archimate3.representation'
  2492. };
  2493. /**
  2494. * Function: paintVertexShape
  2495. *
  2496. * Paints the vertex shape.
  2497. */
  2498. mxArchiMate3Representation.prototype.paintVertexShape = function(c, x, y, w, h)
  2499. {
  2500. c.translate(x, y);
  2501. this.background(c, 0, 0, w, h);
  2502. };
  2503. mxArchiMate3Representation.prototype.background = function(c, x, y, w, h)
  2504. {
  2505. c.begin();
  2506. c.moveTo(0, 0);
  2507. c.lineTo(w, 0);
  2508. c.lineTo(w, h * 0.85);
  2509. c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
  2510. c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
  2511. c.close();
  2512. c.fillAndStroke();
  2513. if (h >= 20)
  2514. c.begin();
  2515. c.moveTo(0, 15);
  2516. c.lineTo(w, 15);
  2517. c.stroke();
  2518. };
  2519. mxCellRenderer.registerShape(mxArchiMate3Representation.prototype.cst.REPRESENTATION, mxArchiMate3Representation);
  2520. mxArchiMate3Representation.prototype.getConstraints = function(style, w, h)
  2521. {
  2522. var constr = [];
  2523. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2524. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  2525. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2526. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  2527. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  2528. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  2529. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2530. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  2531. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.85), false));
  2532. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0.745), false));
  2533. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.85), false));
  2534. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0.955), false));
  2535. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.85), false));
  2536. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  2537. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  2538. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  2539. return (constr);
  2540. };
  2541. //**********************************************************************************************************************************************************
  2542. //Deliverable
  2543. //**********************************************************************************************************************************************************
  2544. /**
  2545. * Extends mxShape.
  2546. */
  2547. function mxArchiMate3Deliverable(bounds, fill, stroke, strokewidth)
  2548. {
  2549. mxShape.call(this);
  2550. this.bounds = bounds;
  2551. this.fill = fill;
  2552. this.stroke = stroke;
  2553. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2554. };
  2555. /**
  2556. * Extends mxShape.
  2557. */
  2558. mxUtils.extend(mxArchiMate3Deliverable, mxShape);
  2559. mxArchiMate3Deliverable.prototype.cst = {
  2560. DELIVERABLE : 'mxgraph.archimate3.deliverable'
  2561. };
  2562. /**
  2563. * Function: paintVertexShape
  2564. *
  2565. * Paints the vertex shape.
  2566. */
  2567. mxArchiMate3Deliverable.prototype.paintVertexShape = function(c, x, y, w, h)
  2568. {
  2569. c.translate(x, y);
  2570. this.background(c, 0, 0, w, h);
  2571. };
  2572. mxArchiMate3Deliverable.prototype.background = function(c, x, y, w, h)
  2573. {
  2574. c.begin();
  2575. c.moveTo(0, 0);
  2576. c.lineTo(w, 0);
  2577. c.lineTo(w, h * 0.85);
  2578. c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
  2579. c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
  2580. c.close();
  2581. c.fillAndStroke();
  2582. };
  2583. mxCellRenderer.registerShape(mxArchiMate3Deliverable.prototype.cst.DELIVERABLE, mxArchiMate3Deliverable);
  2584. mxArchiMate3Deliverable.prototype.getConstraints = function(style, w, h)
  2585. {
  2586. var constr = [];
  2587. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2588. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  2589. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2590. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  2591. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  2592. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  2593. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2594. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  2595. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.85), false));
  2596. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0.745), false));
  2597. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.85), false));
  2598. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0.955), false));
  2599. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.85), false));
  2600. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  2601. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  2602. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  2603. return (constr);
  2604. };
  2605. //**********************************************************************************************************************************************************
  2606. //Location
  2607. //**********************************************************************************************************************************************************
  2608. /**
  2609. * Extends mxShape.
  2610. */
  2611. function mxArchiMate3Location(bounds, fill, stroke, strokewidth)
  2612. {
  2613. mxShape.call(this);
  2614. this.bounds = bounds;
  2615. this.fill = fill;
  2616. this.stroke = stroke;
  2617. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2618. };
  2619. /**
  2620. * Extends mxShape.
  2621. */
  2622. mxUtils.extend(mxArchiMate3Location, mxShape);
  2623. mxArchiMate3Location.prototype.cst = {
  2624. LOCATION : 'mxgraph.archimate3.location'
  2625. };
  2626. /**
  2627. * Function: paintVertexShape
  2628. *
  2629. * Paints the vertex shape.
  2630. */
  2631. mxArchiMate3Location.prototype.paintVertexShape = function(c, x, y, w, h)
  2632. {
  2633. c.translate(x, y);
  2634. this.background(c, 0, 0, w, h);
  2635. c.setShadow(false);
  2636. c.translate(w - 20, 5);
  2637. this.foreground(c, w - 20, 5, 15, 15);
  2638. };
  2639. mxArchiMate3Location.prototype.background = function(c, x, y, w, h)
  2640. {
  2641. c.rect(0, 0, w, h);
  2642. c.fillAndStroke();
  2643. };
  2644. mxArchiMate3Location.prototype.foreground = function(c, x, y, w, h)
  2645. {
  2646. c.setDashed(false);
  2647. c.translate(3 ,0);
  2648. w = w - 6;
  2649. c.begin();
  2650. c.moveTo(w * 0.5, h);
  2651. c.arcTo(w * 0.1775, h * 0.3, 0, 0, 0, w * 0.345, h * 0.7);
  2652. c.arcTo(w * 0.538, h * 0.364, 0, 0, 1, w * 0.5, 0);
  2653. c.arcTo(w * 0.538, h * 0.364, 0, 0, 1, w * 0.655, h * 0.7);
  2654. c.arcTo(w * 0.1775, h * 0.3, 0, 0, 0, w * 0.5, h);
  2655. c.stroke();
  2656. };
  2657. mxCellRenderer.registerShape(mxArchiMate3Location.prototype.cst.LOCATION, mxArchiMate3Location);
  2658. //**********************************************************************************************************************************************************
  2659. //Gap
  2660. //**********************************************************************************************************************************************************
  2661. /**
  2662. * Extends mxShape.
  2663. */
  2664. function mxArchiMate3Gap(bounds, fill, stroke, strokewidth)
  2665. {
  2666. mxShape.call(this);
  2667. this.bounds = bounds;
  2668. this.fill = fill;
  2669. this.stroke = stroke;
  2670. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2671. };
  2672. /**
  2673. * Extends mxShape.
  2674. */
  2675. mxUtils.extend(mxArchiMate3Gap, mxShape);
  2676. mxArchiMate3Gap.prototype.cst = {
  2677. GAP : 'mxgraph.archimate3.gap'
  2678. };
  2679. /**
  2680. * Function: paintVertexShape
  2681. *
  2682. * Paints the vertex shape.
  2683. */
  2684. mxArchiMate3Gap.prototype.paintVertexShape = function(c, x, y, w, h)
  2685. {
  2686. c.translate(x, y);
  2687. this.background(c, 0, 0, w, h);
  2688. c.setShadow(false);
  2689. c.translate(w - 20, 5);
  2690. this.foreground(c, w - 20, 5, 15, 15);
  2691. };
  2692. mxArchiMate3Gap.prototype.background = function(c, x, y, w, h)
  2693. {
  2694. c.begin();
  2695. c.moveTo(0, 0);
  2696. c.lineTo(w, 0);
  2697. c.lineTo(w, h * 0.85);
  2698. c.arcTo(w * 0.35, h * 0.35, 0, 0, 0, w * 0.5, h * 0.85);
  2699. c.arcTo(w * 0.35, h * 0.35, 0, 0, 1, 0, h * 0.85);
  2700. c.close();
  2701. c.fillAndStroke();
  2702. };
  2703. mxArchiMate3Gap.prototype.foreground = function(c, x, y, w, h)
  2704. {
  2705. c.setDashed(false);
  2706. c.translate(0, 2);
  2707. h = h - 4;
  2708. c.ellipse(w * 0.15, 0, w * 0.7, h);
  2709. c.stroke();
  2710. c.begin();
  2711. c.moveTo(0, h * 0.35);
  2712. c.lineTo(w, h * 0.35);
  2713. c.moveTo(0, h * 0.65);
  2714. c.lineTo(w, h * 0.65);
  2715. c.stroke();
  2716. };
  2717. mxCellRenderer.registerShape(mxArchiMate3Gap.prototype.cst.GAP, mxArchiMate3Gap);
  2718. mxArchiMate3Gap.prototype.getConstraints = function(style, w, h)
  2719. {
  2720. var constr = [];
  2721. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2722. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  2723. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2724. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  2725. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  2726. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  2727. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2728. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  2729. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.85), false));
  2730. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0.745), false));
  2731. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.85), false));
  2732. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0.955), false));
  2733. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.85), false));
  2734. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  2735. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  2736. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  2737. return (constr);
  2738. };
  2739. //**********************************************************************************************************************************************************
  2740. //Gap Icon
  2741. //**********************************************************************************************************************************************************
  2742. /**
  2743. * Extends mxShape.
  2744. */
  2745. function mxArchiMate3GapIcon(bounds, fill, stroke, strokewidth)
  2746. {
  2747. mxShape.call(this);
  2748. this.bounds = bounds;
  2749. this.fill = fill;
  2750. this.stroke = stroke;
  2751. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2752. };
  2753. /**
  2754. * Extends mxShape.
  2755. */
  2756. mxUtils.extend(mxArchiMate3GapIcon, mxShape);
  2757. mxArchiMate3GapIcon.prototype.cst = {
  2758. GAP_ICON : 'mxgraph.archimate3.gapIcon'
  2759. };
  2760. /**
  2761. * Function: paintVertexShape
  2762. *
  2763. * Paints the vertex shape.
  2764. */
  2765. mxArchiMate3GapIcon.prototype.paintVertexShape = function(c, x, y, w, h)
  2766. {
  2767. c.translate(x, y);
  2768. this.background(c, 0, 0, w, h);
  2769. };
  2770. mxArchiMate3GapIcon.prototype.background = function(c, x, y, w, h)
  2771. {
  2772. c.setDashed(false);
  2773. c.translate(0, 2);
  2774. h = h - 4;
  2775. c.ellipse(w * 0.15, 0, w * 0.7, h);
  2776. c.fillAndStroke();
  2777. c.begin();
  2778. c.moveTo(0, h * 0.35);
  2779. c.lineTo(w, h * 0.35);
  2780. c.moveTo(0, h * 0.65);
  2781. c.lineTo(w, h * 0.65);
  2782. c.stroke();
  2783. };
  2784. mxCellRenderer.registerShape(mxArchiMate3GapIcon.prototype.cst.GAP_ICON, mxArchiMate3GapIcon);
  2785. mxArchiMate3GapIcon.prototype.getConstraints = function(style, w, h)
  2786. {
  2787. var constr = [];
  2788. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  2789. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  2790. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2791. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  2792. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  2793. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  2794. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  2795. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  2796. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.85), false));
  2797. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0.745), false));
  2798. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.85), false));
  2799. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0.955), false));
  2800. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.85), false));
  2801. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  2802. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  2803. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  2804. return (constr);
  2805. };
  2806. //**********************************************************************************************************************************************************
  2807. //Tech
  2808. //**********************************************************************************************************************************************************
  2809. /**
  2810. * Extends mxShape.
  2811. */
  2812. function mxArchiMate3Tech(bounds, fill, stroke, strokewidth)
  2813. {
  2814. mxShape.call(this);
  2815. this.bounds = bounds;
  2816. this.fill = fill;
  2817. this.stroke = stroke;
  2818. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2819. };
  2820. /**
  2821. * Extends mxShape.
  2822. */
  2823. mxUtils.extend(mxArchiMate3Tech, mxShape);
  2824. mxArchiMate3Tech.prototype.cst = {
  2825. TECH : 'mxgraph.archimate3.tech',
  2826. TYPE : 'techType',
  2827. DEVICE : 'device',
  2828. PLATEAU : 'plateau',
  2829. FACILITY : 'facility',
  2830. EQUIPMENT : 'equipment',
  2831. SYS_SW : 'sysSw'
  2832. };
  2833. /**
  2834. * Function: paintVertexShape
  2835. *
  2836. * Paints the vertex shape.
  2837. */
  2838. mxArchiMate3Tech.prototype.paintVertexShape = function(c, x, y, w, h)
  2839. {
  2840. c.translate(x, y);
  2841. this.background(c, 0, 0, w, h);
  2842. c.setShadow(false);
  2843. c.translate(w - 30, 15);
  2844. this.foreground(c, w - 30, 15, 15, 15);
  2845. };
  2846. mxArchiMate3Tech.prototype.background = function(c, x, y, w, h)
  2847. {
  2848. c.begin();
  2849. c.moveTo(0, 10);
  2850. c.lineTo(10, 0);
  2851. c.lineTo(w, 0);
  2852. c.lineTo(w, h - 10);
  2853. c.lineTo(w - 10, h);
  2854. c.lineTo(0, h);
  2855. c.close();
  2856. c.moveTo(0, 10);
  2857. c.lineTo(w - 10, 10);
  2858. c.lineTo(w - 10, h);
  2859. c.moveTo(w, 0);
  2860. c.lineTo(w - 10, 10);
  2861. c.fillAndStroke();
  2862. };
  2863. mxArchiMate3Tech.prototype.foreground = function(c, x, y, w, h)
  2864. {
  2865. var type = mxUtils.getValue(this.style, mxArchiMate3Tech.prototype.cst.TYPE, mxArchiMate3Tech.prototype.cst.DEVICE);
  2866. c.setDashed(false);
  2867. if (type === mxArchiMate3Tech.prototype.cst.PLATEAU)
  2868. {
  2869. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  2870. c.setFillColor(strokeColor);
  2871. c.rect(w * 0.4, 0, w * 0.6, h * 0.2);
  2872. c.fill();
  2873. c.rect(w * 0.2, h * 0.4, w * 0.6, h * 0.2);
  2874. c.fill();
  2875. c.rect(0, h * 0.8, w * 0.6, h * 0.2);
  2876. c.fill();
  2877. }
  2878. else if (type === mxArchiMate3Tech.prototype.cst.FACILITY)
  2879. {
  2880. c.begin();
  2881. c.moveTo(0, h);
  2882. c.lineTo(0, 0);
  2883. c.lineTo(w * 0.13, 0);
  2884. c.lineTo(w * 0.13, h * 0.7);
  2885. c.lineTo(w * 0.42, h * 0.55);
  2886. c.lineTo(w * 0.42, h * 0.7);
  2887. c.lineTo(w * 0.71, h * 0.55);
  2888. c.lineTo(w * 0.71, h * 0.7);
  2889. c.lineTo(w, h * 0.55);
  2890. c.lineTo(w, h);
  2891. c.close();
  2892. c.stroke();
  2893. }
  2894. else if (type === mxArchiMate3Tech.prototype.cst.EQUIPMENT)
  2895. {
  2896. c.begin();
  2897. c.moveTo(w * 0.72, h * 0.38);
  2898. c.curveTo(w * 0.78, w * 0.38, w * 0.85, h * 0.34, w * 0.85, h * 0.26);
  2899. c.curveTo(w * 0.85, w * 0.18, w * 0.78, h * 0.14, w * 0.73, h * 0.14);
  2900. c.curveTo(w * 0.64, w * 0.14, w * 0.59, h * 0.2, w * 0.59, h * 0.26);
  2901. c.curveTo(w * 0.59, h * 0.33, w * 0.65, w * 0.38, w * 0.72, h * 0.38);
  2902. c.close();
  2903. c.moveTo(w * 0.68, h * 0.52);
  2904. c.lineTo(w * 0.67, h * 0.45);
  2905. c.lineTo(w * 0.61, h * 0.43);
  2906. c.lineTo(w * 0.56, h * 0.48);
  2907. c.lineTo(w * 0.5, h * 0.42);
  2908. c.lineTo(w * 0.54, h * 0.36);
  2909. c.lineTo(w * 0.52, h * 0.31);
  2910. c.lineTo(w * 0.45, h * 0.31);
  2911. c.lineTo(w * 0.45, h * 0.22);
  2912. c.lineTo(w * 0.52, h * 0.21);
  2913. c.lineTo(w * 0.54, h * 0.16);
  2914. c.lineTo(w * 0.5, h * 0.11);
  2915. c.lineTo(w * 0.56, h * 0.05);
  2916. c.lineTo(w * 0.62, h * 0.09);
  2917. c.lineTo(w * 0.67, h * 0.07);
  2918. c.lineTo(w * 0.68, 0);
  2919. c.lineTo(w * 0.77, 0);
  2920. c.lineTo(w * 0.78, h * 0.07);
  2921. c.lineTo(w * 0.83, h * 0.09);
  2922. c.lineTo(w * 0.89, h * 0.05);
  2923. c.lineTo(w * 0.95, h * 0.11);
  2924. c.lineTo(w * 0.91, h * 0.16);
  2925. c.lineTo(w * 0.93, h * 0.21);
  2926. c.lineTo(w, h * 0.22);
  2927. c.lineTo(w, h * 0.31);
  2928. c.lineTo(w * 0.93, h * 0.31);
  2929. c.lineTo(w * 0.91, h * 0.36);
  2930. c.lineTo(w * 0.95, h * 0.41);
  2931. c.lineTo(w * 0.89, h * 0.47);
  2932. c.lineTo(w * 0.83, h * 0.43);
  2933. c.lineTo(w * 0.78, h * 0.45);
  2934. c.lineTo(w * 0.77, h * 0.52);
  2935. c.lineTo(w * 0.68, h * 0.52);
  2936. c.close();
  2937. c.moveTo(w * 0.36, h * 0.81);
  2938. c.curveTo(w * 0.44, h * 0.81, w * 0.52, h * 0.75, w * 0.52, h * 0.67);
  2939. c.curveTo(w * 0.52, h * 0.59, w * 0.45, h * 0.51, w * 0.35, h * 0.51);
  2940. c.curveTo(w * 0.27, h * 0.51, w * 0.19, h * 0.58, w * 0.19, h * 0.67);
  2941. c.curveTo(w * 0.19, h * 0.74, w * 0.27, h * 0.82, w * 0.36, h * 0.81);
  2942. c.close();
  2943. c.moveTo(w * 0.21, h * 0.98);
  2944. c.lineTo(w * 0.22, h * 0.89);
  2945. c.lineTo(w * 0.16, h * 0.85);
  2946. c.lineTo(w * 0.08, h * 0.88);
  2947. c.lineTo(w * 0.02, h * 0.79);
  2948. c.lineTo(w * 0.09, h * 0.74);
  2949. c.lineTo(w * 0.08, h * 0.67);
  2950. c.lineTo(0, h * 0.63);
  2951. c.lineTo(w * 0.03, h * 0.53);
  2952. c.lineTo(w * 0.12, h * 0.54);
  2953. c.lineTo(w * 0.16, h * 0.48);
  2954. c.lineTo(w * 0.13, h * 0.4);
  2955. c.lineTo(w * 0.22, h * 0.35);
  2956. c.lineTo(w * 0.28, h * 0.42);
  2957. c.lineTo(w * 0.36, h * 0.41);
  2958. c.lineTo(w * 0.39, h * 0.33);
  2959. c.lineTo(w * 0.5, h * 0.36);
  2960. c.lineTo(w * 0.49, h * 0.45);
  2961. c.lineTo(w * 0.55, h * 0.49);
  2962. c.lineTo(w * 0.63, h * 0.45);
  2963. c.lineTo(w * 0.69, h * 0.54);
  2964. c.lineTo(w * 0.62, h * 0.6);
  2965. c.lineTo(w * 0.63, h * 0.67);
  2966. c.lineTo(w * 0.71, h * 0.7);
  2967. c.lineTo(w * 0.68, h * 0.8);
  2968. c.lineTo(w * 0.59, h * 0.79);
  2969. c.lineTo(w * 0.55, h * 0.85);
  2970. c.lineTo(w * 0.59, h * 0.79);
  2971. c.lineTo(w * 0.55, h * 0.85);
  2972. c.lineTo(w * 0.59, h * 0.93);
  2973. c.lineTo(w * 0.49, h * 0.98);
  2974. c.lineTo(w * 0.43, h * 0.91);
  2975. c.lineTo(w * 0.36, h * 0.92);
  2976. c.lineTo(w * 0.32, h);
  2977. c.lineTo(w * 0.21, h * 0.98);
  2978. c.close();
  2979. c.stroke();
  2980. }
  2981. else if (type === mxArchiMate3Tech.prototype.cst.SYS_SW)
  2982. {
  2983. mxArchiMate3SysSw.prototype.background(c, x, y, w, h);
  2984. }
  2985. else if (type === mxArchiMate3Tech.prototype.cst.DEVICE)
  2986. {
  2987. mxArchiMate3Device.prototype.background(c, x, y, w, h);
  2988. }
  2989. };
  2990. mxCellRenderer.registerShape(mxArchiMate3Tech.prototype.cst.TECH, mxArchiMate3Tech);
  2991. mxArchiMate3Tech.prototype.getConstraints = function(style, w, h)
  2992. {
  2993. var constr = [];
  2994. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 10, 0));
  2995. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  2996. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  2997. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  2998. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  2999. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  3000. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3001. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  3002. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, 0, -10));
  3003. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -10, 0));
  3004. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  3005. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  3006. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  3007. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  3008. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  3009. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3010. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  3011. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, 10));
  3012. return (constr);
  3013. };
  3014. //**********************************************************************************************************************************************************
  3015. //Distribution
  3016. //**********************************************************************************************************************************************************
  3017. /**
  3018. * Extends mxShape.
  3019. */
  3020. function mxArchiMate3Distribution(bounds, fill, stroke, strokewidth)
  3021. {
  3022. mxShape.call(this);
  3023. this.bounds = bounds;
  3024. this.fill = fill;
  3025. this.stroke = stroke;
  3026. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3027. };
  3028. /**
  3029. * Extends mxShape.
  3030. */
  3031. mxUtils.extend(mxArchiMate3Distribution, mxShape);
  3032. mxArchiMate3Distribution.prototype.cst = {
  3033. DISTRIBUTION : 'mxgraph.archimate3.distribution'
  3034. };
  3035. /**
  3036. * Function: paintVertexShape
  3037. *
  3038. * Paints the vertex shape.
  3039. */
  3040. mxArchiMate3Distribution.prototype.paintVertexShape = function(c, x, y, w, h)
  3041. {
  3042. c.translate(x, y);
  3043. this.background(c, 0, 0, w, h);
  3044. c.setShadow(false);
  3045. };
  3046. mxArchiMate3Distribution.prototype.background = function(c, x, y, w, h)
  3047. {
  3048. c.begin();
  3049. c.moveTo(w * 0.1, h * 0.25);
  3050. c.lineTo(w * 0.9, h * 0.25);
  3051. c.lineTo(w, h * 0.5);
  3052. c.lineTo(w * 0.9, h * 0.75);
  3053. c.lineTo(w * 0.1, h * 0.75);
  3054. c.lineTo(0, h * 0.5);
  3055. c.fillAndStroke();
  3056. c.begin();
  3057. c.moveTo(w * 0.2, 0);
  3058. c.lineTo(0, h * 0.5);
  3059. c.lineTo(w * 0.2, h);
  3060. c.moveTo(w * 0.8, 0);
  3061. c.lineTo(w, h * 0.5);
  3062. c.lineTo(w * 0.8, h);
  3063. c.stroke();
  3064. };
  3065. mxCellRenderer.registerShape(mxArchiMate3Distribution.prototype.cst.DISTRIBUTION, mxArchiMate3Distribution);
  3066. mxArchiMate3Distribution.prototype.getConstraints = function(style, w, h)
  3067. {
  3068. var constr = [];
  3069. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3070. constr.push(new mxConnectionConstraint(new mxPoint(0.2, 0), false));
  3071. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.25), false));
  3072. constr.push(new mxConnectionConstraint(new mxPoint(0.8, 0), false));
  3073. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3074. constr.push(new mxConnectionConstraint(new mxPoint(0.8, 1), false));
  3075. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.75), false));
  3076. constr.push(new mxConnectionConstraint(new mxPoint(0.2, 1), false));
  3077. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3078. return (constr);
  3079. };
  3080. //**********************************************************************************************************************************************************
  3081. //Resource
  3082. //**********************************************************************************************************************************************************
  3083. /**
  3084. * Extends mxShape.
  3085. */
  3086. function mxArchiMate3Resource(bounds, fill, stroke, strokewidth)
  3087. {
  3088. mxShape.call(this);
  3089. this.bounds = bounds;
  3090. this.fill = fill;
  3091. this.stroke = stroke;
  3092. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3093. };
  3094. /**
  3095. * Extends mxShape.
  3096. */
  3097. mxUtils.extend(mxArchiMate3Resource, mxShape);
  3098. mxArchiMate3Resource.prototype.cst = {
  3099. RESOURCE : 'mxgraph.archimate3.resource'
  3100. };
  3101. /**
  3102. * Function: paintVertexShape
  3103. *
  3104. * Paints the vertex shape.
  3105. */
  3106. mxArchiMate3Resource.prototype.paintVertexShape = function(c, x, y, w, h)
  3107. {
  3108. c.translate(x, y);
  3109. this.background(c, 0, 0, w, h);
  3110. c.setShadow(false);
  3111. };
  3112. mxArchiMate3Resource.prototype.background = function(c, x, y, w, h)
  3113. {
  3114. c.begin();
  3115. c.moveTo(w * 0.51, h * 0.34);
  3116. c.lineTo(w * 0.51, h * 0.65);
  3117. c.moveTo(w * 0.35, h * 0.34);
  3118. c.lineTo(w * 0.35, h * 0.65);
  3119. c.moveTo(w * 0.19, h * 0.34);
  3120. c.lineTo(w * 0.19, h * 0.65);
  3121. c.moveTo(w * 0.91, h * 0.4);
  3122. c.curveTo(w * 0.93, h * 0.39, w * 0.95, h * 0.39, w * 0.97, h * 0.40);
  3123. c.curveTo(w * 0.99, h * 0.4, w, h * 0.41, w, h * 0.43);
  3124. c.curveTo(w, h * 0.48, w, h * 0.52, w, h * 0.57);
  3125. c.curveTo(w, h * 0.58, w * 0.99, h * 0.59, w * 0.98, h * 0.6);
  3126. c.curveTo(w * 0.96, h * 0.6, w * 0.93, h * 0.6, w * 0.91, h * 0.6);
  3127. c.moveTo(0, h * 0.73);
  3128. c.curveTo(0, h * 0.6, 0, h * 0.43, 0, h * 0.27);
  3129. c.curveTo(0, h * 0.24, w * 0.03, h * 0.21, w * 0.08, h * 0.21);
  3130. c.curveTo(w * 0.33, h * 0.2, w * 0.61, h * 0.2, w * 0.84, h * 0.21);
  3131. c.curveTo(w * 0.88, h * 0.22, w * 0.89, h * 0.24, w * 0.9, h * 0.26);
  3132. c.curveTo(w * 0.91, h * 0.41, w * 0.91, h * 0.57, w * 0.9, h * 0.72);
  3133. c.curveTo(w * 0.9, h * 0.74, w * 0.88, h * 0.78, w * 0.83, h * 0.79);
  3134. c.curveTo(w * 0.57, h * 0.79, w * 0.32, h * 0.79, w * 0.06, h * 0.79);
  3135. c.curveTo(w * 0.02, h * 0.78, 0, h * 0.76, 0, h * 0.73);
  3136. c.close();
  3137. c.fillAndStroke();
  3138. };
  3139. mxCellRenderer.registerShape(mxArchiMate3Resource.prototype.cst.RESOURCE, mxArchiMate3Resource);
  3140. //**********************************************************************************************************************************************************
  3141. //Capability
  3142. //**********************************************************************************************************************************************************
  3143. /**
  3144. * Extends mxShape.
  3145. */
  3146. function mxArchiMate3Capability(bounds, fill, stroke, strokewidth)
  3147. {
  3148. mxShape.call(this);
  3149. this.bounds = bounds;
  3150. this.fill = fill;
  3151. this.stroke = stroke;
  3152. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3153. };
  3154. /**
  3155. * Extends mxShape.
  3156. */
  3157. mxUtils.extend(mxArchiMate3Capability, mxShape);
  3158. mxArchiMate3Capability.prototype.cst = {
  3159. CAPABILITY : 'mxgraph.archimate3.capability'
  3160. };
  3161. /**
  3162. * Function: paintVertexShape
  3163. *
  3164. * Paints the vertex shape.
  3165. */
  3166. mxArchiMate3Capability.prototype.paintVertexShape = function(c, x, y, w, h)
  3167. {
  3168. c.translate(x, y);
  3169. this.background(c, 0, 0, w, h);
  3170. c.setShadow(false);
  3171. };
  3172. mxArchiMate3Capability.prototype.background = function(c, x, y, w, h)
  3173. {
  3174. c.begin();
  3175. c.moveTo(w, 0);
  3176. c.lineTo(w, h);
  3177. c.lineTo(0, h);
  3178. c.lineTo(0, h * 0.67);
  3179. c.lineTo(w * 0.33, h * 0.67);
  3180. c.lineTo(w * 0.33, h * 0.33);
  3181. c.lineTo(w * 0.67, h * 0.33);
  3182. c.lineTo(w * 0.67, 0);
  3183. c.close();
  3184. c.moveTo(w * 0.67, h * 0.33);
  3185. c.lineTo(w, h * 0.33);
  3186. c.moveTo(w * 0.33, h * 0.67);
  3187. c.lineTo(w, h * 0.67);
  3188. c.moveTo(w * 0.33, h * 0.67);
  3189. c.lineTo(w * 0.33, h);
  3190. c.moveTo(w * 0.67, h * 0.33);
  3191. c.lineTo(w * 0.67, h);
  3192. c.fillAndStroke();
  3193. };
  3194. mxCellRenderer.registerShape(mxArchiMate3Capability.prototype.cst.CAPABILITY, mxArchiMate3Capability);
  3195. //**********************************************************************************************************************************************************
  3196. //Course of Action
  3197. //**********************************************************************************************************************************************************
  3198. /**
  3199. * Extends mxShape.
  3200. */
  3201. function mxArchiMate3Course(bounds, fill, stroke, strokewidth)
  3202. {
  3203. mxShape.call(this);
  3204. this.bounds = bounds;
  3205. this.fill = fill;
  3206. this.stroke = stroke;
  3207. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3208. };
  3209. /**
  3210. * Extends mxShape.
  3211. */
  3212. mxUtils.extend(mxArchiMate3Course, mxShape);
  3213. mxArchiMate3Course.prototype.cst = {
  3214. COURSE : 'mxgraph.archimate3.course'
  3215. };
  3216. /**
  3217. * Function: paintVertexShape
  3218. *
  3219. * Paints the vertex shape.
  3220. */
  3221. mxArchiMate3Course.prototype.paintVertexShape = function(c, x, y, w, h)
  3222. {
  3223. c.translate(x, y);
  3224. this.background(c, 0, 0, w, h);
  3225. c.setShadow(false);
  3226. };
  3227. mxArchiMate3Course.prototype.background = function(c, x, y, w, h)
  3228. {
  3229. var sw = mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, 1);
  3230. c.ellipse(w * 0.4, 0, w * 0.6, h * 0.6);
  3231. c.fillAndStroke();
  3232. c.ellipse(w * 0.5, h * 0.1, w * 0.4, h * 0.4);
  3233. c.stroke();
  3234. c.setStrokeWidth(3 * sw);
  3235. c.setLineCap('round');
  3236. c.begin();
  3237. c.moveTo(0, h);
  3238. c.arcTo(w * 0.7, h * 0.7, 0, 0, 1, w * 0.41, h * 0.56);
  3239. c.moveTo(w * 0.14, h * 0.54);
  3240. c.lineTo(w * 0.41, h * 0.56);
  3241. c.lineTo(w * 0.3, h * 0.78);
  3242. c.stroke();
  3243. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  3244. c.setFillColor(strokeColor);
  3245. c.ellipse(w * 0.6, h * 0.2, w * 0.2, h * 0.2);
  3246. c.fill();
  3247. /*
  3248. var sw = mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, 1);
  3249. c.ellipse(0, w * 0.2, w * 0.8, h * 0.8);
  3250. c.fillAndStroke();
  3251. c.ellipse(w * 0.15, w * 0.35, w * 0.5, h * 0.5);
  3252. c.stroke();
  3253. c.ellipse(w * 0.3, w * 0.5, w * 0.2, h * 0.2);
  3254. c.stroke();
  3255. c.begin();
  3256. c.moveTo(w * 0.4, h * 0.6);
  3257. c.lineTo(w * 0.9, h * 0.1);
  3258. c.moveTo(w * 0.42, h * 0.4);
  3259. c.lineTo(w * 0.4, h * 0.6);
  3260. c.lineTo(w * 0.6, h * 0.58);
  3261. c.moveTo(w * 0.8, 0);
  3262. c.lineTo(w * 0.75, h * 0.25);
  3263. c.lineTo(w, h * 0.2);
  3264. c.stroke();
  3265. */
  3266. };
  3267. mxCellRenderer.registerShape(mxArchiMate3Course.prototype.cst.COURSE, mxArchiMate3Course);
  3268. //**********************************************************************************************************************************************************
  3269. //Node
  3270. //**********************************************************************************************************************************************************
  3271. /**
  3272. * Extends mxShape.
  3273. */
  3274. function mxArchiMate3Node(bounds, fill, stroke, strokewidth)
  3275. {
  3276. mxShape.call(this);
  3277. this.bounds = bounds;
  3278. this.fill = fill;
  3279. this.stroke = stroke;
  3280. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3281. };
  3282. /**
  3283. * Extends mxShape.
  3284. */
  3285. mxUtils.extend(mxArchiMate3Node, mxShape);
  3286. mxArchiMate3Node.prototype.cst = {
  3287. NODE : 'mxgraph.archimate3.node'
  3288. };
  3289. /**
  3290. * Function: paintVertexShape
  3291. *
  3292. * Paints the vertex shape.
  3293. */
  3294. mxArchiMate3Node.prototype.paintVertexShape = function(c, x, y, w, h)
  3295. {
  3296. c.translate(x, y);
  3297. this.background(c, 0, 0, w, h);
  3298. c.setShadow(false);
  3299. };
  3300. mxArchiMate3Node.prototype.background = function(c, x, y, w, h)
  3301. {
  3302. c.begin();
  3303. c.moveTo(0, h * 0.25);
  3304. c.lineTo(w * 0.25, 0);
  3305. c.lineTo(w, 0);
  3306. c.lineTo(w, h * 0.75);
  3307. c.lineTo(w * 0.75, h);
  3308. c.lineTo(0, h);
  3309. c.close();
  3310. c.moveTo(0, h * 0.25);
  3311. c.lineTo(w * 0.75, h * 0.25);
  3312. c.lineTo(w * 0.75, h);
  3313. c.moveTo(w, 0);
  3314. c.lineTo(w * 0.75, h * 0.25);
  3315. c.fillAndStroke();
  3316. };
  3317. mxCellRenderer.registerShape(mxArchiMate3Node.prototype.cst.NODE, mxArchiMate3Node);
  3318. mxArchiMate3Node.prototype.getConstraints = function(style, w, h)
  3319. {
  3320. var constr = [];
  3321. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  3322. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  3323. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  3324. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  3325. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  3326. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3327. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  3328. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  3329. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  3330. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  3331. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  3332. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  3333. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  3334. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  3335. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  3336. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  3337. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3338. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  3339. return (constr);
  3340. };
  3341. //**********************************************************************************************************************************************************
  3342. //Network
  3343. //**********************************************************************************************************************************************************
  3344. /**
  3345. * Extends mxShape.
  3346. */
  3347. function mxArchiMate3Network(bounds, fill, stroke, strokewidth)
  3348. {
  3349. mxShape.call(this);
  3350. this.bounds = bounds;
  3351. this.fill = fill;
  3352. this.stroke = stroke;
  3353. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3354. };
  3355. /**
  3356. * Extends mxShape.
  3357. */
  3358. mxUtils.extend(mxArchiMate3Network, mxShape);
  3359. mxArchiMate3Network.prototype.cst = {
  3360. NETWORK : 'mxgraph.archimate3.network'
  3361. };
  3362. /**
  3363. * Function: paintVertexShape
  3364. *
  3365. * Paints the vertex shape.
  3366. */
  3367. mxArchiMate3Network.prototype.paintVertexShape = function(c, x, y, w, h)
  3368. {
  3369. c.translate(x, y);
  3370. this.background(c, 0, 0, w, h);
  3371. c.setShadow(false);
  3372. };
  3373. mxArchiMate3Network.prototype.background = function(c, x, y, w, h)
  3374. {
  3375. c.translate(0, 2);
  3376. h = h - 4;
  3377. c.begin();
  3378. c.moveTo(w * 0.4, h * 0.2);
  3379. c.lineTo(w * 0.85, h * 0.2);
  3380. c.lineTo(w * 0.6, h * 0.8);
  3381. c.lineTo(w * 0.15, h * 0.8);
  3382. c.close();
  3383. c.stroke();
  3384. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  3385. c.setFillColor(strokeColor);
  3386. c.ellipse(w * 0.25, 0, w * 0.3, h * 0.4);
  3387. c.fill();
  3388. c.ellipse(w * 0.7, 0, w * 0.3, h * 0.4);
  3389. c.fill();
  3390. c.ellipse(0, h * 0.6, w * 0.3, h * 0.4);
  3391. c.fill();
  3392. c.ellipse(w * 0.45, h * 0.6, w * 0.3, h * 0.4);
  3393. c.fill();
  3394. };
  3395. mxCellRenderer.registerShape(mxArchiMate3Network.prototype.cst.NETWORK, mxArchiMate3Network);
  3396. mxArchiMate3Network.prototype.getConstraints = function(style, w, h)
  3397. {
  3398. var constr = [];
  3399. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  3400. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  3401. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  3402. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  3403. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  3404. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3405. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  3406. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  3407. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  3408. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  3409. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  3410. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  3411. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  3412. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  3413. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  3414. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  3415. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3416. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  3417. return (constr);
  3418. };
  3419. //**********************************************************************************************************************************************************
  3420. //Device
  3421. //**********************************************************************************************************************************************************
  3422. /**
  3423. * Extends mxShape.
  3424. */
  3425. function mxArchiMate3Device(bounds, fill, stroke, strokewidth)
  3426. {
  3427. mxShape.call(this);
  3428. this.bounds = bounds;
  3429. this.fill = fill;
  3430. this.stroke = stroke;
  3431. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3432. };
  3433. /**
  3434. * Extends mxShape.
  3435. */
  3436. mxUtils.extend(mxArchiMate3Device, mxShape);
  3437. mxArchiMate3Device.prototype.cst = {
  3438. DEVICE : 'mxgraph.archimate3.device'
  3439. };
  3440. /**
  3441. * Function: paintVertexShape
  3442. *
  3443. * Paints the vertex shape.
  3444. */
  3445. mxArchiMate3Device.prototype.paintVertexShape = function(c, x, y, w, h)
  3446. {
  3447. c.translate(x, y);
  3448. this.background(c, 0, 0, w, h);
  3449. c.setShadow(false);
  3450. };
  3451. mxArchiMate3Device.prototype.background = function(c, x, y, w, h)
  3452. {
  3453. c.roundrect(0, 0, w, h * 0.88, w * 0.1, h * 0.1);
  3454. c.fillAndStroke();
  3455. c.begin();
  3456. c.moveTo(w * 0.1, h * 0.88);
  3457. c.lineTo(0, h);
  3458. c.lineTo(w, h);
  3459. c.lineTo(w * 0.9, h * 0.88);
  3460. c.fillAndStroke();
  3461. };
  3462. mxCellRenderer.registerShape(mxArchiMate3Device.prototype.cst.DEVICE, mxArchiMate3Device);
  3463. mxArchiMate3Device.prototype.getConstraints = function(style, w, h)
  3464. {
  3465. var constr = [];
  3466. constr.push(new mxConnectionConstraint(new mxPoint(0.03, 0.03), false));
  3467. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  3468. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  3469. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  3470. constr.push(new mxConnectionConstraint(new mxPoint(0.97, 0.03), false));
  3471. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  3472. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3473. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  3474. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  3475. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  3476. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  3477. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  3478. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  3479. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  3480. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3481. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  3482. return (constr);
  3483. };
  3484. //**********************************************************************************************************************************************************
  3485. //System Software
  3486. //**********************************************************************************************************************************************************
  3487. /**
  3488. * Extends mxShape.
  3489. */
  3490. function mxArchiMate3SysSw(bounds, fill, stroke, strokewidth)
  3491. {
  3492. mxShape.call(this);
  3493. this.bounds = bounds;
  3494. this.fill = fill;
  3495. this.stroke = stroke;
  3496. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3497. };
  3498. /**
  3499. * Extends mxShape.
  3500. */
  3501. mxUtils.extend(mxArchiMate3SysSw, mxShape);
  3502. mxArchiMate3SysSw.prototype.cst = {
  3503. SYS_SW : 'mxgraph.archimate3.sysSw'
  3504. };
  3505. /**
  3506. * Function: paintVertexShape
  3507. *
  3508. * Paints the vertex shape.
  3509. */
  3510. mxArchiMate3SysSw.prototype.paintVertexShape = function(c, x, y, w, h)
  3511. {
  3512. c.translate(x, y);
  3513. this.background(c, 0, 0, w, h);
  3514. c.setShadow(false);
  3515. };
  3516. mxArchiMate3SysSw.prototype.background = function(c, x, y, w, h)
  3517. {
  3518. c.ellipse(w * 0.3, 0, w * 0.7, h * 0.7);
  3519. c.fillAndStroke();
  3520. c.ellipse(0, h * 0.02, w * 0.98, h * 0.98);
  3521. c.fillAndStroke();
  3522. };
  3523. mxCellRenderer.registerShape(mxArchiMate3SysSw.prototype.cst.SYS_SW, mxArchiMate3SysSw);
  3524. //**********************************************************************************************************************************************************
  3525. //Artifact
  3526. //**********************************************************************************************************************************************************
  3527. /**
  3528. * Extends mxShape.
  3529. */
  3530. function mxArchiMate3Artifact(bounds, fill, stroke, strokewidth)
  3531. {
  3532. mxShape.call(this);
  3533. this.bounds = bounds;
  3534. this.fill = fill;
  3535. this.stroke = stroke;
  3536. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3537. };
  3538. /**
  3539. * Extends mxShape.
  3540. */
  3541. mxUtils.extend(mxArchiMate3Artifact, mxShape);
  3542. mxArchiMate3Artifact.prototype.cst = {
  3543. ARTIFACT : 'mxgraph.archimate3.artifact'
  3544. };
  3545. /**
  3546. * Function: paintVertexShape
  3547. *
  3548. * Paints the vertex shape.
  3549. */
  3550. mxArchiMate3Artifact.prototype.paintVertexShape = function(c, x, y, w, h)
  3551. {
  3552. c.translate(x, y);
  3553. this.background(c, 0, 0, w, h);
  3554. c.setShadow(false);
  3555. };
  3556. mxArchiMate3Artifact.prototype.background = function(c, x, y, w, h)
  3557. {
  3558. c.begin();
  3559. c.moveTo(0, 0);
  3560. c.lineTo(w * 0.7, 0);
  3561. c.lineTo(w, h * 0.22);
  3562. c.lineTo(w, h);
  3563. c.lineTo(0, h);
  3564. c.close();
  3565. c.fillAndStroke();
  3566. c.begin();
  3567. c.moveTo(w * 0.7, 0);
  3568. c.lineTo(w * 0.7, h * 0.22);
  3569. c.lineTo(w, h * 0.22);
  3570. c.stroke();
  3571. };
  3572. mxCellRenderer.registerShape(mxArchiMate3Artifact.prototype.cst.ARTIFACT, mxArchiMate3Artifact);
  3573. mxArchiMate3Artifact.prototype.getConstraints = function(style, w, h)
  3574. {
  3575. var constr = [];
  3576. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  3577. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  3578. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  3579. constr.push(new mxConnectionConstraint(new mxPoint(0.7, 0), false));
  3580. constr.push(new mxConnectionConstraint(new mxPoint(0.85, 0.11), false));
  3581. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.22), false));
  3582. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3583. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  3584. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  3585. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  3586. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  3587. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  3588. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  3589. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  3590. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3591. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  3592. return (constr);
  3593. };
  3594. //**********************************************************************************************************************************************************
  3595. //Communication Network
  3596. //**********************************************************************************************************************************************************
  3597. /**
  3598. * Extends mxShape.
  3599. */
  3600. function mxArchiMate3CommNetw(bounds, fill, stroke, strokewidth)
  3601. {
  3602. mxShape.call(this);
  3603. this.bounds = bounds;
  3604. this.fill = fill;
  3605. this.stroke = stroke;
  3606. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3607. };
  3608. /**
  3609. * Extends mxShape.
  3610. */
  3611. mxUtils.extend(mxArchiMate3CommNetw, mxShape);
  3612. mxArchiMate3CommNetw.prototype.cst = {
  3613. COMM_NETW : 'mxgraph.archimate3.commNetw'
  3614. };
  3615. /**
  3616. * Function: paintVertexShape
  3617. *
  3618. * Paints the vertex shape.
  3619. */
  3620. mxArchiMate3CommNetw.prototype.paintVertexShape = function(c, x, y, w, h)
  3621. {
  3622. c.translate(x, y);
  3623. this.background(c, 0, 0, w, h);
  3624. c.setShadow(false);
  3625. };
  3626. mxArchiMate3CommNetw.prototype.background = function(c, x, y, w, h)
  3627. {
  3628. c.begin();
  3629. c.moveTo(w * 0.2, h);
  3630. c.lineTo(0, h * 0.5);
  3631. c.lineTo(w * 0.2, 0);
  3632. c.moveTo(w * 0.8, h);
  3633. c.lineTo(w, h * 0.5);
  3634. c.lineTo(w * 0.8, 0);
  3635. c.moveTo(0, h * 0.5);
  3636. c.lineTo(w, h * 0.5);
  3637. c.stroke();
  3638. };
  3639. mxCellRenderer.registerShape(mxArchiMate3CommNetw.prototype.cst.COMM_NETW, mxArchiMate3CommNetw);
  3640. mxArchiMate3CommNetw.prototype.getConstraints = function(style, w, h)
  3641. {
  3642. var constr = [];
  3643. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3644. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3645. return (constr);
  3646. };
  3647. //**********************************************************************************************************************************************************
  3648. //Path
  3649. //**********************************************************************************************************************************************************
  3650. /**
  3651. * Extends mxShape.
  3652. */
  3653. function mxArchiMate3Path(bounds, fill, stroke, strokewidth)
  3654. {
  3655. mxShape.call(this);
  3656. this.bounds = bounds;
  3657. this.fill = fill;
  3658. this.stroke = stroke;
  3659. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3660. };
  3661. /**
  3662. * Extends mxShape.
  3663. */
  3664. mxUtils.extend(mxArchiMate3Path, mxShape);
  3665. mxArchiMate3Path.prototype.cst = {
  3666. PATH : 'mxgraph.archimate3.path'
  3667. };
  3668. /**
  3669. * Function: paintVertexShape
  3670. *
  3671. * Paints the vertex shape.
  3672. */
  3673. mxArchiMate3Path.prototype.paintVertexShape = function(c, x, y, w, h)
  3674. {
  3675. c.translate(x, y);
  3676. this.background(c, 0, 0, w, h);
  3677. c.setShadow(false);
  3678. };
  3679. mxArchiMate3Path.prototype.background = function(c, x, y, w, h)
  3680. {
  3681. c.begin();
  3682. c.moveTo(w * 0.2, h);
  3683. c.lineTo(0, h * 0.5);
  3684. c.lineTo(w * 0.2, 0);
  3685. c.moveTo(w * 0.8, h);
  3686. c.lineTo(w, h * 0.5);
  3687. c.lineTo(w * 0.8, 0);
  3688. c.stroke();
  3689. c.setDashed(true);
  3690. c.begin();
  3691. c.moveTo(0, h * 0.5);
  3692. c.lineTo(w, h * 0.5);
  3693. c.stroke();
  3694. };
  3695. mxCellRenderer.registerShape(mxArchiMate3Path.prototype.cst.PATH, mxArchiMate3Path);
  3696. mxArchiMate3Path.prototype.getConstraints = function(style, w, h)
  3697. {
  3698. var constr = [];
  3699. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3700. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3701. return (constr);
  3702. };
  3703. //**********************************************************************************************************************************************************
  3704. //Value Stream
  3705. //**********************************************************************************************************************************************************
  3706. /**
  3707. * Extends mxShape.
  3708. */
  3709. function mxArchiMate3ValueStream(bounds, fill, stroke, strokewidth)
  3710. {
  3711. mxShape.call(this);
  3712. this.bounds = bounds;
  3713. this.fill = fill;
  3714. this.stroke = stroke;
  3715. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3716. };
  3717. /**
  3718. * Extends mxShape.
  3719. */
  3720. mxUtils.extend(mxArchiMate3ValueStream, mxShape);
  3721. mxArchiMate3ValueStream.prototype.cst = {
  3722. VALUE_STREAM : 'mxgraph.archimate3.valueStream'
  3723. };
  3724. /**
  3725. * Function: paintVertexShape
  3726. *
  3727. * Paints the vertex shape.
  3728. */
  3729. mxArchiMate3ValueStream.prototype.paintVertexShape = function(c, x, y, w, h)
  3730. {
  3731. c.translate(x, y);
  3732. this.background(c, 0, 0, w, h);
  3733. c.setShadow(false);
  3734. };
  3735. mxArchiMate3ValueStream.prototype.background = function(c, x, y, w, h)
  3736. {
  3737. c.begin();
  3738. c.moveTo(0, 0);
  3739. c.lineTo(w * 0.75, 0);
  3740. c.lineTo(w, h * 0.5);
  3741. c.lineTo(w * 0.75, h);
  3742. c.lineTo(w * 0, h);
  3743. c.lineTo(w * 0.25, h * 0.5);
  3744. c.close();
  3745. c.fillAndStroke();
  3746. };
  3747. mxCellRenderer.registerShape(mxArchiMate3ValueStream.prototype.cst.VALUE_STREAM, mxArchiMate3ValueStream);
  3748. mxArchiMate3ValueStream.prototype.getConstraints = function(style, w, h)
  3749. {
  3750. var constr = [];
  3751. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3752. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3753. return (constr);
  3754. };
  3755. //**********************************************************************************************************************************************************
  3756. //Work Package
  3757. //**********************************************************************************************************************************************************
  3758. /**
  3759. * Extends mxShape.
  3760. */
  3761. function mxArchiMate3WorkPackage(bounds, fill, stroke, strokewidth)
  3762. {
  3763. mxShape.call(this);
  3764. this.bounds = bounds;
  3765. this.fill = fill;
  3766. this.stroke = stroke;
  3767. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3768. };
  3769. /**
  3770. * Extends mxShape.
  3771. */
  3772. mxUtils.extend(mxArchiMate3WorkPackage, mxShape);
  3773. mxArchiMate3WorkPackage.prototype.cst = {
  3774. WORK_PACKAGE : 'mxgraph.archimate3.workPackage'
  3775. };
  3776. /**
  3777. * Function: paintVertexShape
  3778. *
  3779. * Paints the vertex shape.
  3780. */
  3781. mxArchiMate3WorkPackage.prototype.paintVertexShape = function(c, x, y, w, h)
  3782. {
  3783. c.translate(x, y);
  3784. this.background(c, 0, 0, w, h);
  3785. c.setShadow(false);
  3786. };
  3787. mxArchiMate3WorkPackage.prototype.background = function(c, x, y, w, h)
  3788. {
  3789. c.begin();
  3790. c.moveTo(w * 0.733, h * 0.7765);
  3791. c.lineTo(w * 0.3308, h * 0.7765);
  3792. c.curveTo(w * 0.1856, h * 0.7765, w * 0.034, h * 0.6281, w * 0.034, h * 0.3939);
  3793. c.curveTo(w * 0.0314, h * 0.2015, w * 0.1742, h * 0.0381, w * 0.3308, h * 0.0381);
  3794. c.curveTo(w * 0.5106, h * 0.0381, w * 0.6267, h * 0.2026, w * 0.6267, h * 0.3939);
  3795. c.curveTo(w * 0.6267, h * 0.4924, w * 0.5785, h * 0.603, w * 0.4776, h * 0.6743);
  3796. c.stroke();
  3797. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  3798. c.setFillColor(strokeColor);
  3799. c.begin();
  3800. c.moveTo(w * 0.7247, h * 0.908);
  3801. c.lineTo(w * 0.7247, h * 0.6418);
  3802. c.lineTo(w * 0.9147, h * 0.7749);
  3803. c.close();
  3804. c.fillAndStroke();
  3805. };
  3806. mxCellRenderer.registerShape(mxArchiMate3WorkPackage.prototype.cst.WORK_PACKAGE, mxArchiMate3WorkPackage);
  3807. mxArchiMate3WorkPackage.prototype.getConstraints = function(style, w, h)
  3808. {
  3809. var constr = [];
  3810. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  3811. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  3812. return (constr);
  3813. };