mxArchiMate3.js 131 KB

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