mxLeanMap.js 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206
  1. /**
  2. * $Id: mxLeanMap.js,v 1.3 2013/05/30 14:19:14 mate Exp $
  3. * Copyright (c) 2006-2013, JGraph Ltd
  4. */
  5. //**********************************************************************************************************************************************************
  6. //Boat Shipment
  7. //**********************************************************************************************************************************************************
  8. /**
  9. * Extends mxShape.
  10. */
  11. function mxLeanBoatShipment(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(mxLeanBoatShipment, mxShape);
  23. /**
  24. * Function: paintVertexShape
  25. *
  26. * Paints the vertex shape.
  27. */
  28. mxLeanBoatShipment.prototype.paintVertexShape = function(c, x, y, w, h)
  29. {
  30. c.translate(x, y);
  31. c.begin();
  32. c.moveTo(w * 0.15, h * 0.77);
  33. c.lineTo(w * 0.5, 0);
  34. c.lineTo(w * 0.85, h * 0.77);
  35. c.close();
  36. c.moveTo(w * 0.2, h);
  37. c.lineTo(0, h * 0.8);
  38. c.lineTo(w, h * 0.8);
  39. c.lineTo(w * 0.8, h);
  40. c.close();
  41. c.fillAndStroke();
  42. };
  43. mxCellRenderer.registerShape('mxgraph.lean_mapping.boat_shipment', mxLeanBoatShipment);
  44. mxLeanBoatShipment.prototype.constraints = [
  45. new mxConnectionConstraint(new mxPoint(0.5, 0), false),
  46. new mxConnectionConstraint(new mxPoint(0.5, 1), false),
  47. new mxConnectionConstraint(new mxPoint(0, 0.8), false),
  48. new mxConnectionConstraint(new mxPoint(1, 0.8), false),
  49. new mxConnectionConstraint(new mxPoint(0.2, 1), false),
  50. new mxConnectionConstraint(new mxPoint(0.8, 1), false),
  51. new mxConnectionConstraint(new mxPoint(0.26, 0.5), false),
  52. new mxConnectionConstraint(new mxPoint(0.74, 0.5), false)
  53. ];
  54. //**********************************************************************************************************************************************************
  55. //Safety Stock
  56. //**********************************************************************************************************************************************************
  57. /**
  58. * Extends mxShape.
  59. */
  60. function mxLeanSafetyStock(bounds, fill, stroke, strokewidth)
  61. {
  62. mxShape.call(this);
  63. this.bounds = bounds;
  64. this.fill = fill;
  65. this.stroke = stroke;
  66. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  67. };
  68. /**
  69. * Extends mxShape.
  70. */
  71. mxUtils.extend(mxLeanSafetyStock, mxShape);
  72. /**
  73. * Function: paintVertexShape
  74. *
  75. * Paints the vertex shape.
  76. */
  77. mxLeanSafetyStock.prototype.paintVertexShape = function(c, x, y, w, h)
  78. {
  79. c.translate(x, y);
  80. this.background(c, w, h);
  81. c.setShadow(false);
  82. this.foreground(c, w, h);
  83. };
  84. mxLeanSafetyStock.prototype.background = function(c, w, h)
  85. {
  86. c.rect(0, 0, w, h);
  87. c.fillAndStroke();
  88. };
  89. mxLeanSafetyStock.prototype.foreground = function(c, w, h)
  90. {
  91. c.begin();
  92. c.moveTo(0, h * 0.34);
  93. c.lineTo(w, h * 0.34);
  94. c.moveTo(0, h * 0.66);
  95. c.lineTo(w, h * 0.66);
  96. c.fillAndStroke();
  97. };
  98. mxCellRenderer.registerShape('mxgraph.lean_mapping.buffer_or_safety_stock', mxLeanSafetyStock);
  99. mxLeanSafetyStock.prototype.constraints = [
  100. new mxConnectionConstraint(new mxPoint(0, 0), true),
  101. new mxConnectionConstraint(new mxPoint(1, 0), true),
  102. new mxConnectionConstraint(new mxPoint(0, 1), true),
  103. new mxConnectionConstraint(new mxPoint(1, 1), true),
  104. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  105. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  106. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  107. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  108. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  109. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  110. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  111. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  112. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  113. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  114. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  115. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  116. ];
  117. //**********************************************************************************************************************************************************
  118. //Data Box
  119. //**********************************************************************************************************************************************************
  120. /**
  121. * Extends mxShape.
  122. */
  123. function mxLeanDataBox(bounds, fill, stroke, strokewidth)
  124. {
  125. mxShape.call(this);
  126. this.bounds = bounds;
  127. this.fill = fill;
  128. this.stroke = stroke;
  129. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  130. };
  131. /**
  132. * Extends mxShape.
  133. */
  134. mxUtils.extend(mxLeanDataBox, mxShape);
  135. /**
  136. * Function: paintVertexShape
  137. *
  138. * Paints the vertex shape.
  139. */
  140. mxLeanDataBox.prototype.paintVertexShape = function(c, x, y, w, h)
  141. {
  142. c.translate(x, y);
  143. this.background(c, w, h);
  144. c.setShadow(false);
  145. this.foreground(c, w, h);
  146. };
  147. mxLeanDataBox.prototype.background = function(c, w, h)
  148. {
  149. c.begin();
  150. c.moveTo(0, h);
  151. c.lineTo(0, 0);
  152. c.lineTo(w, 0);
  153. c.lineTo(w, h);
  154. c.fillAndStroke();
  155. };
  156. mxLeanDataBox.prototype.foreground = function(c, w, h)
  157. {
  158. c.begin();
  159. c.moveTo(0, h * 0.2);
  160. c.lineTo(w, h * 0.2);
  161. c.moveTo(0, h * 0.4);
  162. c.lineTo(w, h * 0.4);
  163. c.moveTo(0, h * 0.6);
  164. c.lineTo(w, h * 0.6);
  165. c.moveTo(0, h * 0.8);
  166. c.lineTo(w, h * 0.8);
  167. c.stroke();
  168. };
  169. mxCellRenderer.registerShape('mxgraph.lean_mapping.data_box', mxLeanDataBox);
  170. mxLeanDataBox.prototype.constraints = [
  171. new mxConnectionConstraint(new mxPoint(0, 0), true),
  172. new mxConnectionConstraint(new mxPoint(1, 0), true),
  173. new mxConnectionConstraint(new mxPoint(0, 1), true),
  174. new mxConnectionConstraint(new mxPoint(1, 1), true),
  175. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  176. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  177. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  178. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  179. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  180. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  181. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  182. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  183. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  184. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  185. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  186. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  187. ];
  188. //**********************************************************************************************************************************************************
  189. //Customer / Supplier
  190. //**********************************************************************************************************************************************************
  191. /**
  192. * Extends mxShape.
  193. */
  194. function mxLeanCustomerSupplier(bounds, fill, stroke, strokewidth)
  195. {
  196. mxShape.call(this);
  197. this.bounds = bounds;
  198. this.fill = fill;
  199. this.stroke = stroke;
  200. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  201. };
  202. /**
  203. * Extends mxShape.
  204. */
  205. mxUtils.extend(mxLeanCustomerSupplier, mxShape);
  206. /**
  207. * Function: paintVertexShape
  208. *
  209. * Paints the vertex shape.
  210. */
  211. mxLeanCustomerSupplier.prototype.paintVertexShape = function(c, x, y, w, h)
  212. {
  213. c.translate(x, y);
  214. this.background(c, w, h);
  215. c.setShadow(false);
  216. };
  217. mxLeanCustomerSupplier.prototype.background = function(c, w, h)
  218. {
  219. c.begin();
  220. c.moveTo(0, h);
  221. c.lineTo(0, h * 0.3);
  222. c.lineTo(w * 0.33, h * 0.02);
  223. c.lineTo(w * 0.33, h * 0.3);
  224. c.lineTo(w * 0.67, h * 0.02);
  225. c.lineTo(w * 0.67, h * 0.3);
  226. c.lineTo(w, h * 0.02);
  227. c.lineTo(w, h);
  228. c.close();
  229. c.fillAndStroke();
  230. };
  231. mxCellRenderer.registerShape('mxgraph.lean_mapping.outside_sources', mxLeanCustomerSupplier);
  232. mxLeanCustomerSupplier.prototype.constraints = [
  233. new mxConnectionConstraint(new mxPoint(1, 0), true),
  234. new mxConnectionConstraint(new mxPoint(0, 1), true),
  235. new mxConnectionConstraint(new mxPoint(1, 1), true),
  236. new mxConnectionConstraint(new mxPoint(0.33, 0), true),
  237. new mxConnectionConstraint(new mxPoint(0.67, 0), true),
  238. new mxConnectionConstraint(new mxPoint(0, 0.3), true),
  239. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  240. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  241. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  242. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  243. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  244. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  245. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  246. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  247. ];
  248. //**********************************************************************************************************************************************************
  249. //Dedicated Process
  250. //**********************************************************************************************************************************************************
  251. /**
  252. * Extends mxShape.
  253. */
  254. function mxLeanDedicatedProcess(bounds, fill, stroke, strokewidth)
  255. {
  256. mxShape.call(this);
  257. this.bounds = bounds;
  258. this.fill = fill;
  259. this.stroke = stroke;
  260. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  261. };
  262. /**
  263. * Extends mxShape.
  264. */
  265. mxUtils.extend(mxLeanDedicatedProcess, mxShape);
  266. /**
  267. * Function: paintVertexShape
  268. *
  269. * Paints the vertex shape.
  270. */
  271. mxLeanDedicatedProcess.prototype.paintVertexShape = function(c, x, y, w, h)
  272. {
  273. c.translate(x, y);
  274. var fontSize = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8'));
  275. this.background(c, w, h);
  276. c.setShadow(false);
  277. this.foreground(c, w, h, fontSize);
  278. };
  279. mxLeanDedicatedProcess.prototype.background = function(c, w, h)
  280. {
  281. c.rect(0, 0, w, h);
  282. c.fillAndStroke();
  283. };
  284. mxLeanDedicatedProcess.prototype.foreground = function(c, w, h, fontSize)
  285. {
  286. var lineH = Math.min(fontSize * 1.5, h);
  287. c.begin();
  288. c.moveTo(0, lineH);
  289. c.lineTo(w, lineH);
  290. c.stroke();
  291. };
  292. mxCellRenderer.registerShape('mxgraph.lean_mapping.manufacturing_process', mxLeanDedicatedProcess);
  293. mxLeanDedicatedProcess.prototype.constraints = [
  294. new mxConnectionConstraint(new mxPoint(0, 0), true),
  295. new mxConnectionConstraint(new mxPoint(1, 0), true),
  296. new mxConnectionConstraint(new mxPoint(0, 1), true),
  297. new mxConnectionConstraint(new mxPoint(1, 1), true),
  298. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  299. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  300. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  301. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  302. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  303. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  304. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  305. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  306. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  307. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  308. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  309. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  310. ];
  311. //**********************************************************************************************************************************************************
  312. //Shared Process
  313. //**********************************************************************************************************************************************************
  314. /**
  315. * Extends mxShape.
  316. */
  317. function mxLeanSharedProcess(bounds, fill, stroke, strokewidth)
  318. {
  319. mxShape.call(this);
  320. this.bounds = bounds;
  321. this.fill = fill;
  322. this.stroke = stroke;
  323. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  324. };
  325. /**
  326. * Extends mxShape.
  327. */
  328. mxUtils.extend(mxLeanSharedProcess, mxShape);
  329. /**
  330. * Function: paintVertexShape
  331. *
  332. * Paints the vertex shape.
  333. */
  334. mxLeanSharedProcess.prototype.paintVertexShape = function(c, x, y, w, h)
  335. {
  336. c.translate(x, y);
  337. var fontSize = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8'));
  338. this.background(c, w, h);
  339. c.setShadow(false);
  340. this.foreground(c, w, h, fontSize);
  341. };
  342. mxLeanSharedProcess.prototype.background = function(c, w, h)
  343. {
  344. c.rect(0, 0, w, h);
  345. c.fillAndStroke();
  346. };
  347. mxLeanSharedProcess.prototype.foreground = function(c, w, h, fontSize)
  348. {
  349. var lineH = Math.min(fontSize * 1.5, h);
  350. c.begin();
  351. c.moveTo(0, lineH);
  352. c.lineTo(w, lineH);
  353. c.stroke();
  354. var start = 0;
  355. var i = 0;
  356. var s = 10;
  357. var offset = 0;
  358. c.begin();
  359. var strokeWidth = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, '2'));
  360. c.setStrokeWidth(strokeWidth * 0.5);
  361. while (start < h + w)
  362. {
  363. start = start + s;
  364. if (start > lineH)
  365. {
  366. var startX = Math.max(0, start - h);
  367. var startY = Math.min(start, h);
  368. var endX = Math.min(start - lineH, w);
  369. var endY = lineH;
  370. var endY = Math.max(start - w, lineH);
  371. if (startX < w)
  372. {
  373. c.moveTo(startX, startY);
  374. c.lineTo(endX, endY);
  375. }
  376. }
  377. };
  378. c.stroke();
  379. };
  380. mxCellRenderer.registerShape('mxgraph.lean_mapping.manufacturing_process_shared', mxLeanSharedProcess);
  381. mxLeanSharedProcess.prototype.constraints = [
  382. new mxConnectionConstraint(new mxPoint(0, 0), true),
  383. new mxConnectionConstraint(new mxPoint(1, 0), true),
  384. new mxConnectionConstraint(new mxPoint(0, 1), true),
  385. new mxConnectionConstraint(new mxPoint(1, 1), true),
  386. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  387. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  388. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  389. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  390. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  391. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  392. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  393. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  394. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  395. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  396. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  397. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  398. ];
  399. //**********************************************************************************************************************************************************
  400. // Workcell
  401. //**********************************************************************************************************************************************************
  402. /**
  403. * Extends mxShape.
  404. */
  405. function mxLeanWorkcell(bounds, fill, stroke, strokewidth)
  406. {
  407. mxShape.call(this);
  408. this.bounds = bounds;
  409. this.fill = fill;
  410. this.stroke = stroke;
  411. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  412. };
  413. /**
  414. * Extends mxShape.
  415. */
  416. mxUtils.extend(mxLeanWorkcell, mxShape);
  417. /**
  418. * Function: paintVertexShape
  419. *
  420. * Paints the vertex shape.
  421. */
  422. mxLeanWorkcell.prototype.paintVertexShape = function(c, x, y, w, h)
  423. {
  424. c.translate(x, y);
  425. c.begin();
  426. c.moveTo(0, 0);
  427. c.lineTo(w, 0);
  428. c.lineTo(w, h);
  429. c.lineTo(w * 0.65, h);
  430. c.lineTo(w * 0.65, h * 0.4);
  431. c.lineTo(w * 0.35, h * 0.4);
  432. c.lineTo(w * 0.35, h);
  433. c.lineTo(0, h);
  434. c.close();
  435. c.fillAndStroke();
  436. };
  437. mxCellRenderer.registerShape('mxgraph.lean_mapping.work_cell', mxLeanWorkcell);
  438. mxLeanWorkcell.prototype.constraints = [
  439. new mxConnectionConstraint(new mxPoint(0, 0), true),
  440. new mxConnectionConstraint(new mxPoint(1, 0), true),
  441. new mxConnectionConstraint(new mxPoint(0, 1), true),
  442. new mxConnectionConstraint(new mxPoint(1, 1), true),
  443. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  444. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  445. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  446. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  447. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  448. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  449. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  450. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  451. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  452. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  453. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  454. ];
  455. //**********************************************************************************************************************************************************
  456. //Inventory Box
  457. //**********************************************************************************************************************************************************
  458. /**
  459. * Extends mxShape.
  460. */
  461. function mxLeanInventoryBox(bounds, fill, stroke, strokewidth)
  462. {
  463. mxShape.call(this);
  464. this.bounds = bounds;
  465. this.fill = fill;
  466. this.stroke = stroke;
  467. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  468. };
  469. /**
  470. * Extends mxShape.
  471. */
  472. mxUtils.extend(mxLeanInventoryBox, mxShape);
  473. /**
  474. * Function: paintVertexShape
  475. *
  476. * Paints the vertex shape.
  477. */
  478. mxLeanInventoryBox.prototype.paintVertexShape = function(c, x, y, w, h)
  479. {
  480. c.translate(x, y);
  481. c.begin();
  482. c.moveTo(0, h);
  483. c.lineTo(w * 0.5, 0);
  484. c.lineTo(w, h);
  485. c.close();
  486. c.fillAndStroke();
  487. c.setShadow(false);
  488. c.begin();
  489. c.moveTo(w * 0.4, h * 0.45);
  490. c.lineTo(w * 0.6, h * 0.45);
  491. c.moveTo(w * 0.5, h * 0.45);
  492. c.lineTo(w * 0.5, h * 0.85);
  493. c.moveTo(w * 0.4, h * 0.85);
  494. c.lineTo(w * 0.6, h * 0.85);
  495. c.stroke();
  496. };
  497. mxCellRenderer.registerShape('mxgraph.lean_mapping.inventory_box', mxLeanInventoryBox);
  498. mxLeanInventoryBox.prototype.constraints = [
  499. new mxConnectionConstraint(new mxPoint(0, 1), true),
  500. new mxConnectionConstraint(new mxPoint(1, 1), true),
  501. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  502. new mxConnectionConstraint(new mxPoint(0.375, 0.25), false),
  503. new mxConnectionConstraint(new mxPoint(0.25, 0.5), false),
  504. new mxConnectionConstraint(new mxPoint(0.125, 0.75), false),
  505. new mxConnectionConstraint(new mxPoint(0.625, 0.25), false),
  506. new mxConnectionConstraint(new mxPoint(0.75, 0.5), false),
  507. new mxConnectionConstraint(new mxPoint(0.875, 0.75), false),
  508. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  509. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  510. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  511. ];
  512. //**********************************************************************************************************************************************************
  513. //Push Arrow
  514. //**********************************************************************************************************************************************************
  515. /**
  516. * Extends mxShape.
  517. */
  518. function mxLeanPushArrow(bounds, fill, stroke, strokewidth)
  519. {
  520. mxShape.call(this);
  521. this.bounds = bounds;
  522. this.fill = fill;
  523. this.stroke = stroke;
  524. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  525. };
  526. /**
  527. * Extends mxShape.
  528. */
  529. mxUtils.extend(mxLeanPushArrow, mxShape);
  530. /**
  531. * Function: paintVertexShape
  532. *
  533. * Paints the vertex shape.
  534. */
  535. mxLeanPushArrow.prototype.paintVertexShape = function(c, x, y, w, h)
  536. {
  537. c.translate(x, y);
  538. this.background(c, w, h);
  539. c.setShadow(false);
  540. this.foreground(c, w, h);
  541. };
  542. mxLeanPushArrow.prototype.background = function(c, w, h)
  543. {
  544. c.begin();
  545. c.moveTo(0, h * 0.17);
  546. c.lineTo(w * 0.75, h * 0.17);
  547. c.lineTo(w * 0.75, 0);
  548. c.lineTo(w, h * 0.5);
  549. c.lineTo(w * 0.75, h);
  550. c.lineTo(w * 0.75, h * 0.83);
  551. c.lineTo(0, h * 0.83);
  552. c.close();
  553. c.fillAndStroke();
  554. };
  555. mxLeanPushArrow.prototype.foreground = function(c, w, h, fontSize)
  556. {
  557. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  558. c.setFillColor(strokeColor);
  559. c.rect(0, h * 0.17, w * 0.12, h * 0.66);
  560. c.fill();
  561. c.rect(w * 0.24, h * 0.17, w * 0.12, h * 0.66);
  562. c.fill();
  563. c.rect(w * 0.48, h * 0.17, w * 0.12, h * 0.66);
  564. c.fill();
  565. c.begin();
  566. c.moveTo(w * 0.72, h * 0.17);
  567. c.lineTo(w * 0.75, h * 0.17);
  568. c.lineTo(w * 0.75, 0);
  569. c.lineTo(w, h * 0.5);
  570. c.lineTo(w * 0.75, h);
  571. c.lineTo(w * 0.75, h * 0.83);
  572. c.lineTo(w * 0.72, h * 0.83);
  573. c.close();
  574. c.fill();
  575. };
  576. mxCellRenderer.registerShape('mxgraph.lean_mapping.push_arrow', mxLeanPushArrow);
  577. mxLeanPushArrow.prototype.constraints = [
  578. new mxConnectionConstraint(new mxPoint(0.25, 0.17), false),
  579. new mxConnectionConstraint(new mxPoint(0.5, 0.17), false),
  580. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  581. new mxConnectionConstraint(new mxPoint(0, 0.17), true),
  582. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  583. new mxConnectionConstraint(new mxPoint(0, 0.83), true),
  584. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  585. new mxConnectionConstraint(new mxPoint(0.25, 0.83), false),
  586. new mxConnectionConstraint(new mxPoint(0.5, 0.83), false),
  587. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  588. ];
  589. //**********************************************************************************************************************************************************
  590. //Supermarket
  591. //**********************************************************************************************************************************************************
  592. /**
  593. * Extends mxShape.
  594. */
  595. function mxLeanSupermarket(bounds, fill, stroke, strokewidth)
  596. {
  597. mxShape.call(this);
  598. this.bounds = bounds;
  599. this.fill = fill;
  600. this.stroke = stroke;
  601. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  602. };
  603. /**
  604. * Extends mxShape.
  605. */
  606. mxUtils.extend(mxLeanSupermarket, mxShape);
  607. /**
  608. * Function: paintVertexShape
  609. *
  610. * Paints the vertex shape.
  611. */
  612. mxLeanSupermarket.prototype.paintVertexShape = function(c, x, y, w, h)
  613. {
  614. c.translate(x, y);
  615. c.begin();
  616. c.moveTo(0, 0);
  617. c.lineTo(w, 0);
  618. c.lineTo(w, h);
  619. c.lineTo(0, h);
  620. c.moveTo(0, h * 0.33);
  621. c.lineTo(w, h * 0.33);
  622. c.moveTo(0, h * 0.67);
  623. c.lineTo(w, h * 0.67);
  624. c.fillAndStroke();
  625. };
  626. mxCellRenderer.registerShape('mxgraph.lean_mapping.supermarket', mxLeanSupermarket);
  627. mxLeanSupermarket.prototype.constraints = [
  628. new mxConnectionConstraint(new mxPoint(0, 0), true),
  629. new mxConnectionConstraint(new mxPoint(1, 0), true),
  630. new mxConnectionConstraint(new mxPoint(0, 1), true),
  631. new mxConnectionConstraint(new mxPoint(1, 1), true),
  632. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  633. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  634. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  635. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  636. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  637. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  638. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  639. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  640. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  641. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  642. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  643. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  644. ];
  645. //**********************************************************************************************************************************************************
  646. //Material Pull
  647. //**********************************************************************************************************************************************************
  648. /**
  649. * Extends mxShape.
  650. */
  651. function mxLeanMaterialPull(bounds, fill, stroke, strokewidth)
  652. {
  653. mxShape.call(this);
  654. this.bounds = bounds;
  655. this.fill = fill;
  656. this.stroke = stroke;
  657. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  658. };
  659. /**
  660. * Extends mxShape.
  661. */
  662. mxUtils.extend(mxLeanMaterialPull, mxShape);
  663. /**
  664. * Function: paintVertexShape
  665. *
  666. * Paints the vertex shape.
  667. */
  668. mxLeanMaterialPull.prototype.paintVertexShape = function(c, x, y, w, h)
  669. {
  670. c.translate(x, y);
  671. c.begin();
  672. c.moveTo(w * 0.732, h * 0.0736);
  673. c.arcTo(w * 0.4827, h * 0.4959, 0, 1, 0, w * 0.9553, h * 0.6191);
  674. c.stroke();
  675. c.begin();
  676. c.moveTo(w * 0.9071, h * 0.6191);
  677. c.lineTo(w * 0.9794, h * 0.4951);
  678. c.lineTo(w, h * 0.6438);
  679. c.close();
  680. c.fillAndStroke();
  681. };
  682. mxCellRenderer.registerShape('mxgraph.lean_mapping.physical_pull', mxLeanMaterialPull);
  683. mxLeanMaterialPull.prototype.constraints = [
  684. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  685. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  686. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  687. new mxConnectionConstraint(new mxPoint(0.98, 0.5), true),
  688. new mxConnectionConstraint(new mxPoint(0.144, 0.144), false),
  689. new mxConnectionConstraint(new mxPoint(0.144, 0.845), false),
  690. new mxConnectionConstraint(new mxPoint(0.845, 0.845), false)
  691. ];
  692. //**********************************************************************************************************************************************************
  693. //FIFO Lane
  694. //**********************************************************************************************************************************************************
  695. /**
  696. * Extends mxShape.
  697. */
  698. function mxLeanFifoLane(bounds, fill, stroke, strokewidth)
  699. {
  700. mxShape.call(this);
  701. this.bounds = bounds;
  702. this.fill = fill;
  703. this.stroke = stroke;
  704. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  705. };
  706. /**
  707. * Extends mxShape.
  708. */
  709. mxUtils.extend(mxLeanFifoLane, mxShape);
  710. /**
  711. * Function: paintVertexShape
  712. *
  713. * Paints the vertex shape.
  714. */
  715. mxLeanFifoLane.prototype.paintVertexShape = function(c, x, y, w, h)
  716. {
  717. c.translate(x, y);
  718. var fontSize = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8'));
  719. this.background(c, w, h, fontSize);
  720. c.setShadow(false);
  721. };
  722. mxLeanFifoLane.prototype.background = function(c, w, h, fontSize)
  723. {
  724. var lineH = Math.min(fontSize * 1.5, h);
  725. c.begin();
  726. c.moveTo(0, lineH);
  727. c.lineTo(w, lineH);
  728. c.moveTo(0, h);
  729. c.lineTo(w, h);
  730. c.stroke();
  731. c.rect(w * 0.02, lineH + 4, w * 0.26, h - lineH - 8);
  732. c.fillAndStroke();
  733. c.ellipse(w * 0.35, lineH + 4, w * 0.26, h - lineH - 8);
  734. c.fillAndStroke();
  735. c.begin();
  736. c.moveTo(w * 0.69, lineH + 4);
  737. c.lineTo(w * 0.98, lineH + 4);
  738. c.lineTo(w * 0.835, h - 4);
  739. c.close();
  740. c.fillAndStroke();
  741. };
  742. mxCellRenderer.registerShape('mxgraph.lean_mapping.fifo_lane', mxLeanFifoLane);
  743. mxLeanFifoLane.prototype.constraints = [
  744. new mxConnectionConstraint(new mxPoint(0, 1), true),
  745. new mxConnectionConstraint(new mxPoint(1, 1), true),
  746. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  747. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  748. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  749. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  750. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  751. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  752. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  753. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  754. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  755. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  756. ];
  757. //**********************************************************************************************************************************************************
  758. //Truck Shipment
  759. //**********************************************************************************************************************************************************
  760. /**
  761. * Extends mxShape.
  762. */
  763. function mxLeanTruckShipment(bounds, fill, stroke, strokewidth)
  764. {
  765. mxShape.call(this);
  766. this.bounds = bounds;
  767. this.fill = fill;
  768. this.stroke = stroke;
  769. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  770. };
  771. /**
  772. * Extends mxShape.
  773. */
  774. mxUtils.extend(mxLeanTruckShipment, mxShape);
  775. /**
  776. * Function: paintVertexShape
  777. *
  778. * Paints the vertex shape.
  779. */
  780. mxLeanTruckShipment.prototype.paintVertexShape = function(c, x, y, w, h)
  781. {
  782. c.translate(x, y);
  783. this.background(c, w, h);
  784. c.setShadow(false);
  785. };
  786. mxLeanTruckShipment.prototype.background = function(c, w, h)
  787. {
  788. c.rect(0, 0, w * 0.6, h * 0.8);
  789. c.fillAndStroke();
  790. c.rect(w * 0.6, h * 0.35, w * 0.4, h * 0.45);
  791. c.fillAndStroke();
  792. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  793. c.setFillColor(strokeColor);
  794. c.ellipse(w * 0.15, h * 0.8, w * 0.2, h * 0.2);
  795. c.fillAndStroke();
  796. c.ellipse(w * 0.65, h * 0.8, w * 0.2, h * 0.2);
  797. c.fillAndStroke();
  798. };
  799. mxCellRenderer.registerShape('mxgraph.lean_mapping.truck_shipment', mxLeanTruckShipment);
  800. mxLeanTruckShipment.prototype.constraints = [
  801. new mxConnectionConstraint(new mxPoint(0, 0), true),
  802. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  803. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  804. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  805. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  806. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  807. new mxConnectionConstraint(new mxPoint(0.6, 0.35), false),
  808. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  809. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  810. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  811. new mxConnectionConstraint(new mxPoint(0.5, 0.8), false),
  812. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  813. ];
  814. //**********************************************************************************************************************************************************
  815. //Production Control
  816. //**********************************************************************************************************************************************************
  817. /**
  818. * Extends mxShape.
  819. */
  820. function mxLeanProductionControl(bounds, fill, stroke, strokewidth)
  821. {
  822. mxShape.call(this);
  823. this.bounds = bounds;
  824. this.fill = fill;
  825. this.stroke = stroke;
  826. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  827. };
  828. /**
  829. * Extends mxShape.
  830. */
  831. mxUtils.extend(mxLeanProductionControl, mxShape);
  832. /**
  833. * Function: paintVertexShape
  834. *
  835. * Paints the vertex shape.
  836. */
  837. mxLeanProductionControl.prototype.paintVertexShape = function(c, x, y, w, h)
  838. {
  839. c.translate(x, y);
  840. c.rect(0, 0, w, h);
  841. c.fillAndStroke();
  842. };
  843. mxCellRenderer.registerShape('mxgraph.lean_mapping.schedule', mxLeanProductionControl);
  844. mxLeanProductionControl.prototype.constraints = [
  845. new mxConnectionConstraint(new mxPoint(0, 0), true),
  846. new mxConnectionConstraint(new mxPoint(1, 0), true),
  847. new mxConnectionConstraint(new mxPoint(0, 1), true),
  848. new mxConnectionConstraint(new mxPoint(1, 1), true),
  849. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  850. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  851. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  852. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  853. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  854. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  855. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  856. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  857. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  858. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  859. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  860. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  861. ];
  862. //**********************************************************************************************************************************************************
  863. //FIFO Sequence
  864. //**********************************************************************************************************************************************************
  865. /**
  866. * Extends mxShape.
  867. */
  868. function mxLeanFifoSequence(bounds, fill, stroke, strokewidth)
  869. {
  870. mxShape.call(this);
  871. this.bounds = bounds;
  872. this.fill = fill;
  873. this.stroke = stroke;
  874. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  875. };
  876. /**
  877. * Extends mxShape.
  878. */
  879. mxUtils.extend(mxLeanFifoSequence, mxShape);
  880. /**
  881. * Function: paintVertexShape
  882. *
  883. * Paints the vertex shape.
  884. */
  885. mxLeanFifoSequence.prototype.paintVertexShape = function(c, x, y, w, h)
  886. {
  887. c.translate(x, y);
  888. c.begin();
  889. c.moveTo(0, 0);
  890. c.lineTo(w, 0);
  891. c.moveTo(0, h);
  892. c.lineTo(w, h);
  893. c.moveTo(w * 0.05, h * 0.5);
  894. c.lineTo(w * 0.15, h * 0.5);
  895. c.moveTo(w * 0.75, h * 0.5);
  896. c.lineTo(w * 0.88, h * 0.5);
  897. c.stroke();
  898. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  899. c.setFillColor(strokeColor);
  900. c.begin();
  901. c.moveTo(w * 0.88, h * 0.39);
  902. c.lineTo(w * 0.98, h * 0.5);
  903. c.lineTo(w * 0.88, h * 0.61);
  904. c.fillAndStroke();
  905. // c.setFontSize(Math.min(h * 0.5, w * 0.2));
  906. // c.setFontColor(strokeColor);
  907. // c.text(w * 0.5, h * 0.5, 0, 0, 'FIFO', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  908. };
  909. mxCellRenderer.registerShape('mxgraph.lean_mapping.fifo_sequence_flow', mxLeanFifoSequence);
  910. mxLeanFifoSequence.prototype.constraints = [
  911. new mxConnectionConstraint(new mxPoint(0, 0), true),
  912. new mxConnectionConstraint(new mxPoint(1, 0), true),
  913. new mxConnectionConstraint(new mxPoint(0, 1), true),
  914. new mxConnectionConstraint(new mxPoint(1, 1), true),
  915. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  916. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  917. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  918. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  919. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  920. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  921. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  922. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  923. ];
  924. //**********************************************************************************************************************************************************
  925. //Production Kanban
  926. //**********************************************************************************************************************************************************
  927. /**
  928. * Extends mxShape.
  929. */
  930. function mxLeanProductionKanban(bounds, fill, stroke, strokewidth)
  931. {
  932. mxShape.call(this);
  933. this.bounds = bounds;
  934. this.fill = fill;
  935. this.stroke = stroke;
  936. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  937. };
  938. /**
  939. * Extends mxShape.
  940. */
  941. mxUtils.extend(mxLeanProductionKanban, mxShape);
  942. /**
  943. * Function: paintVertexShape
  944. *
  945. * Paints the vertex shape.
  946. */
  947. mxLeanProductionKanban.prototype.paintVertexShape = function(c, x, y, w, h)
  948. {
  949. c.translate(x, y);
  950. c.setDashed(true);
  951. c.begin();
  952. c.moveTo(4, h - 10);
  953. c.lineTo(4, 25);
  954. c.lineTo(w, 25);
  955. c.stroke();
  956. c.setDashed(false);
  957. c.begin();
  958. c.moveTo(w - 75, 0);
  959. c.lineTo(w - 30, 0);
  960. c.lineTo(w - 15, 15);
  961. c.lineTo(w - 15, 50);
  962. c.lineTo(w - 75, 50);
  963. c.close();
  964. c.fillAndStroke();
  965. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  966. c.setFillColor(strokeColor);
  967. c.begin();
  968. c.moveTo(0, h - 10);
  969. c.lineTo(4, h);
  970. c.lineTo(8, h - 10);
  971. c.close();
  972. c.fillAndStroke();
  973. };
  974. mxCellRenderer.registerShape('mxgraph.lean_mapping.production_kanban', mxLeanProductionKanban);
  975. //**********************************************************************************************************************************************************
  976. //Withdrawal Kanban
  977. //**********************************************************************************************************************************************************
  978. /**
  979. * Extends mxShape.
  980. */
  981. function mxLeanWithdrawalKanban(bounds, fill, stroke, strokewidth)
  982. {
  983. mxShape.call(this);
  984. this.bounds = bounds;
  985. this.fill = fill;
  986. this.stroke = stroke;
  987. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  988. };
  989. /**
  990. * Extends mxShape.
  991. */
  992. mxUtils.extend(mxLeanWithdrawalKanban, mxShape);
  993. /**
  994. * Function: paintVertexShape
  995. *
  996. * Paints the vertex shape.
  997. */
  998. mxLeanWithdrawalKanban.prototype.paintVertexShape = function(c, x, y, w, h)
  999. {
  1000. c.translate(x, y);
  1001. c.setDashed(true);
  1002. c.begin();
  1003. c.moveTo(4, h - 10);
  1004. c.lineTo(4, 25);
  1005. c.lineTo(w, 25);
  1006. c.stroke();
  1007. c.setDashed(false);
  1008. c.begin();
  1009. c.moveTo(w - 75, 0);
  1010. c.lineTo(w - 30, 0);
  1011. c.lineTo(w - 15, 15);
  1012. c.lineTo(w - 15, 50);
  1013. c.lineTo(w - 75, 50);
  1014. c.close();
  1015. c.fillAndStroke();
  1016. c.begin();
  1017. c.moveTo(w - 75, 45);
  1018. c.lineTo(w - 70, 50);
  1019. c.moveTo(w - 75, 35);
  1020. c.lineTo(w - 60, 50);
  1021. c.moveTo(w - 75, 25);
  1022. c.lineTo(w - 50, 50);
  1023. c.moveTo(w - 75, 15);
  1024. c.lineTo(w - 40, 50);
  1025. c.moveTo(w - 75, 5);
  1026. c.lineTo(w - 30, 50);
  1027. c.moveTo(w - 70, 0);
  1028. c.lineTo(w - 20, 50);
  1029. c.moveTo(w - 60, 0);
  1030. c.lineTo(w - 15, 45);
  1031. c.moveTo(w - 50, 0);
  1032. c.lineTo(w - 15, 35);
  1033. c.moveTo(w - 40, 0);
  1034. c.lineTo(w - 15, 25);
  1035. c.stroke();
  1036. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1037. c.setFillColor(strokeColor);
  1038. c.begin();
  1039. c.moveTo(0, h - 10);
  1040. c.lineTo(4, h);
  1041. c.lineTo(8, h - 10);
  1042. c.close();
  1043. c.fillAndStroke();
  1044. };
  1045. mxCellRenderer.registerShape('mxgraph.lean_mapping.withdrawal_kanban', mxLeanWithdrawalKanban);
  1046. //**********************************************************************************************************************************************************
  1047. //Signal Kanban
  1048. //**********************************************************************************************************************************************************
  1049. /**
  1050. * Extends mxShape.
  1051. */
  1052. function mxLeanSignalKanban(bounds, fill, stroke, strokewidth)
  1053. {
  1054. mxShape.call(this);
  1055. this.bounds = bounds;
  1056. this.fill = fill;
  1057. this.stroke = stroke;
  1058. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1059. };
  1060. /**
  1061. * Extends mxShape.
  1062. */
  1063. mxUtils.extend(mxLeanSignalKanban, mxShape);
  1064. /**
  1065. * Function: paintVertexShape
  1066. *
  1067. * Paints the vertex shape.
  1068. */
  1069. mxLeanSignalKanban.prototype.paintVertexShape = function(c, x, y, w, h)
  1070. {
  1071. c.translate(x, y);
  1072. c.setDashed(true);
  1073. c.begin();
  1074. c.moveTo(4, h - 10);
  1075. c.lineTo(4, 15);
  1076. c.lineTo(w, 15);
  1077. c.stroke();
  1078. c.setDashed(false);
  1079. c.begin();
  1080. c.moveTo(w - 65, 0);
  1081. c.lineTo(w - 25, 0);
  1082. c.lineTo(w - 45, 45);
  1083. c.close();
  1084. c.fillAndStroke();
  1085. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1086. c.setFillColor(strokeColor);
  1087. c.begin();
  1088. c.moveTo(0, h - 10);
  1089. c.lineTo(4, h);
  1090. c.lineTo(8, h - 10);
  1091. c.close();
  1092. c.fillAndStroke();
  1093. };
  1094. mxCellRenderer.registerShape('mxgraph.lean_mapping.signal_kanban', mxLeanSignalKanban);
  1095. //**********************************************************************************************************************************************************
  1096. //Sequenced Pull Ball
  1097. //**********************************************************************************************************************************************************
  1098. /**
  1099. * Extends mxShape.
  1100. */
  1101. function mxLeanSequencedPullBall(bounds, fill, stroke, strokewidth)
  1102. {
  1103. mxShape.call(this);
  1104. this.bounds = bounds;
  1105. this.fill = fill;
  1106. this.stroke = stroke;
  1107. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1108. };
  1109. /**
  1110. * Extends mxShape.
  1111. */
  1112. mxUtils.extend(mxLeanSequencedPullBall, mxShape);
  1113. /**
  1114. * Function: paintVertexShape
  1115. *
  1116. * Paints the vertex shape.
  1117. */
  1118. mxLeanSequencedPullBall.prototype.paintVertexShape = function(c, x, y, w, h)
  1119. {
  1120. c.translate(x, y);
  1121. c.ellipse(0, 0, w, h);
  1122. c.fillAndStroke();
  1123. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1124. c.setFillColor(strokeColor);
  1125. c.setShadow(false);
  1126. c.ellipse(w * 0.15, h * 0.15, w * 0.7, h * 0.7);
  1127. c.fillAndStroke();
  1128. };
  1129. mxCellRenderer.registerShape('mxgraph.lean_mapping.sequenced_pull_ball', mxLeanSequencedPullBall);
  1130. mxLeanSequencedPullBall.prototype.constraints = [
  1131. new mxConnectionConstraint(new mxPoint(0.144, 0.144), false),
  1132. new mxConnectionConstraint(new mxPoint(0.856, 0.144), false),
  1133. new mxConnectionConstraint(new mxPoint(0.856, 0.856), false),
  1134. new mxConnectionConstraint(new mxPoint(0.144, 0.856), false),
  1135. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  1136. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  1137. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1138. new mxConnectionConstraint(new mxPoint(0.5, 1), true)
  1139. ];
  1140. //**********************************************************************************************************************************************************
  1141. //Rail Shipment
  1142. //**********************************************************************************************************************************************************
  1143. /**
  1144. * Extends mxShape.
  1145. */
  1146. function mxLeanRailShipment(bounds, fill, stroke, strokewidth)
  1147. {
  1148. mxShape.call(this);
  1149. this.bounds = bounds;
  1150. this.fill = fill;
  1151. this.stroke = stroke;
  1152. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1153. };
  1154. /**
  1155. * Extends mxShape.
  1156. */
  1157. mxUtils.extend(mxLeanRailShipment, mxShape);
  1158. /**
  1159. * Function: paintVertexShape
  1160. *
  1161. * Paints the vertex shape.
  1162. */
  1163. mxLeanRailShipment.prototype.paintVertexShape = function(c, x, y, w, h)
  1164. {
  1165. c.translate(x, y);
  1166. c.rect(w * 0.1, 0, w * 0.35, h * 0.8);
  1167. c.fillAndStroke();
  1168. c.rect(w * 0.55, 0, w * 0.35, h * 0.8);
  1169. c.fillAndStroke();
  1170. c.begin();
  1171. c.moveTo(0, h);
  1172. c.lineTo(w, h);
  1173. c.moveTo(w * 0.45, h * 0.7);
  1174. c.lineTo(w * 0.55, h * 0.7);
  1175. c.stroke();
  1176. c.ellipse(w * 0.15, h * 0.8, w * 0.06, h * 0.2);
  1177. c.fillAndStroke();
  1178. c.ellipse(w * 0.34, h * 0.8, w * 0.06, h * 0.2);
  1179. c.fillAndStroke();
  1180. c.ellipse(w * 0.6, h * 0.8, w * 0.06, h * 0.2);
  1181. c.fillAndStroke();
  1182. c.ellipse(w * 0.79, h * 0.8, w * 0.06, h * 0.2);
  1183. c.fillAndStroke();
  1184. };
  1185. mxCellRenderer.registerShape('mxgraph.lean_mapping.rail_shipment', mxLeanRailShipment);
  1186. mxLeanRailShipment.prototype.constraints = [
  1187. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1188. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1189. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  1190. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1191. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  1192. new mxConnectionConstraint(new mxPoint(0.1, 0.25), false),
  1193. new mxConnectionConstraint(new mxPoint(0.1, 0.5), false),
  1194. new mxConnectionConstraint(new mxPoint(0.1, 0.75), false),
  1195. new mxConnectionConstraint(new mxPoint(0.9, 0.25), false),
  1196. new mxConnectionConstraint(new mxPoint(0.9, 0.5), false),
  1197. new mxConnectionConstraint(new mxPoint(0.9, 0.75), false),
  1198. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1199. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1200. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1201. ];
  1202. //**********************************************************************************************************************************************************
  1203. //Warehouse
  1204. //**********************************************************************************************************************************************************
  1205. /**
  1206. * Extends mxShape.
  1207. */
  1208. function mxLeanWarehouse(bounds, fill, stroke, strokewidth)
  1209. {
  1210. mxShape.call(this);
  1211. this.bounds = bounds;
  1212. this.fill = fill;
  1213. this.stroke = stroke;
  1214. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1215. };
  1216. /**
  1217. * Extends mxShape.
  1218. */
  1219. mxUtils.extend(mxLeanWarehouse, mxShape);
  1220. /**
  1221. * Function: paintVertexShape
  1222. *
  1223. * Paints the vertex shape.
  1224. */
  1225. mxLeanWarehouse.prototype.paintVertexShape = function(c, x, y, w, h)
  1226. {
  1227. c.translate(x, y);
  1228. c.rect(0, 0, w, h);
  1229. c.fillAndStroke();
  1230. c.setShadow(false);
  1231. c.begin();
  1232. c.moveTo(0, h * 0.4);
  1233. c.lineTo(w, h * 0.4);
  1234. c.moveTo(w * 0.15, h);
  1235. c.lineTo(w * 0.15, h * 0.55);
  1236. c.lineTo(w * 0.3, h * 0.55);
  1237. c.lineTo(w * 0.3, h);
  1238. c.stroke();
  1239. c.ellipse(w * 0.27, h * 0.75, w * 0.02, w * 0.02);
  1240. c.stroke();
  1241. };
  1242. mxCellRenderer.registerShape('mxgraph.lean_mapping.warehouse', mxLeanWarehouse);
  1243. mxLeanWarehouse.prototype.constraints = [
  1244. new mxConnectionConstraint(new mxPoint(0, 0), true),
  1245. new mxConnectionConstraint(new mxPoint(1, 0), true),
  1246. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1247. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1248. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  1249. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1250. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  1251. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  1252. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  1253. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  1254. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  1255. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  1256. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  1257. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1258. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1259. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1260. ];
  1261. //**********************************************************************************************************************************************************
  1262. //Timeline
  1263. //**********************************************************************************************************************************************************
  1264. /**
  1265. * Extends mxShape.
  1266. */
  1267. function mxLeanTimeline(bounds, fill, stroke, strokewidth)
  1268. {
  1269. mxShape.call(this);
  1270. this.bounds = bounds;
  1271. this.fill = fill;
  1272. this.stroke = stroke;
  1273. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1274. };
  1275. /**
  1276. * Extends mxShape.
  1277. */
  1278. mxUtils.extend(mxLeanTimeline, mxShape);
  1279. /**
  1280. * Function: paintVertexShape
  1281. *
  1282. * Paints the vertex shape.
  1283. */
  1284. mxLeanTimeline.prototype.paintVertexShape = function(c, x, y, w, h)
  1285. {
  1286. c.translate(x, y);
  1287. var shapeInfo = mxUtils.getValue(this.style, 'mainText', '20,Time 1,50,Time 2,30,Time 3,40,Time 4,30,Time 5,50,Time 6,20,Time 7').toString().split(',');
  1288. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '12');
  1289. var times = new Array();
  1290. var totalTime = 0;
  1291. for (var i = 0; i < shapeInfo.length; i = i + 2)
  1292. {
  1293. var currTime = parseFloat(shapeInfo[i]);
  1294. times.push(currTime);
  1295. totalTime = totalTime + currTime;
  1296. };
  1297. var scaleX = w / totalTime;
  1298. var names = new Array();
  1299. for (var i = 1; i < shapeInfo.length; i = i + 2)
  1300. {
  1301. names.push(shapeInfo[i]);
  1302. };
  1303. c.begin();
  1304. var currX = 0;
  1305. c.moveTo(0, h);
  1306. for (var i = 0; i < names.length; i++)
  1307. {
  1308. var currTime = times[i] * scaleX;
  1309. currX = currX + currTime;
  1310. if (i % 2 === 0)
  1311. {
  1312. c.lineTo(currX, h);
  1313. c.lineTo(currX, fontSize * 1.5);
  1314. c.text(currX - currTime * 0.5, h - fontSize * 0.75, 0, 0, names[i], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1315. }
  1316. else
  1317. {
  1318. c.lineTo(currX, fontSize * 1.5);
  1319. c.lineTo(currX, h);
  1320. c.text(currX - currTime * 0.5, fontSize * 0.75, 0, 0, names[i], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1321. }
  1322. };
  1323. c.stroke();
  1324. };
  1325. mxCellRenderer.registerShape('mxgraph.lean_mapping.timeline', mxLeanTimeline);
  1326. //**********************************************************************************************************************************************************
  1327. //Cross Dock
  1328. //**********************************************************************************************************************************************************
  1329. /**
  1330. * Extends mxShape.
  1331. */
  1332. function mxLeanCrossDock(bounds, fill, stroke, strokewidth)
  1333. {
  1334. mxShape.call(this);
  1335. this.bounds = bounds;
  1336. this.fill = fill;
  1337. this.stroke = stroke;
  1338. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1339. };
  1340. /**
  1341. * Extends mxShape.
  1342. */
  1343. mxUtils.extend(mxLeanCrossDock, mxShape);
  1344. /**
  1345. * Function: paintVertexShape
  1346. *
  1347. * Paints the vertex shape.
  1348. */
  1349. mxLeanCrossDock.prototype.paintVertexShape = function(c, x, y, w, h)
  1350. {
  1351. c.translate(x, y);
  1352. c.rect(0, 0, w, h);
  1353. c.fillAndStroke();
  1354. c.setShadow(false);
  1355. c.begin();
  1356. c.moveTo(0, h * 0.25);
  1357. c.lineTo(w, h * 0.25);
  1358. c.moveTo(w * 0.1, h * 0.4);
  1359. c.lineTo(w * 0.35, h * 0.4);
  1360. c.arcTo(w * 0.15, h * 0.15, 0, 0, 1, w * 0.5, h * 0.5);
  1361. c.arcTo(w * 0.15, h * 0.15, 0, 0, 0, w * 0.65, h * 0.6);
  1362. c.lineTo(w * 0.9, h * 0.6);
  1363. c.stroke();
  1364. c.moveTo(w * 0.1, h * 0.4);
  1365. c.lineTo(w * 0.35, h * 0.4);
  1366. c.arcTo(w * 0.15, h * 0.25, 0, 0, 1, w * 0.5, h * 0.55);
  1367. c.arcTo(w * 0.15, h * 0.25, 0, 0, 0, w * 0.65, h * 0.7);
  1368. c.lineTo(w * 0.9, h * 0.7);
  1369. c.stroke();
  1370. c.moveTo(w * 0.1, h * 0.4);
  1371. c.lineTo(w * 0.35, h * 0.4);
  1372. c.arcTo(w * 0.15, h * 0.3, 0, 0, 1, w * 0.5, h * 0.6);
  1373. c.arcTo(w * 0.15, h * 0.3, 0, 0, 0, w * 0.65, h * 0.8);
  1374. c.lineTo(w * 0.9, h * 0.8);
  1375. c.stroke();
  1376. c.moveTo(w * 0.1, h * 0.8);
  1377. c.lineTo(w * 0.35, h * 0.8);
  1378. c.arcTo(w * 0.15, h * 0.3, 0, 0, 0, w * 0.5, h * 0.6);
  1379. c.arcTo(w * 0.15, h * 0.3, 0, 0, 1, w * 0.65, h * 0.4);
  1380. c.lineTo(w * 0.9, h * 0.4);
  1381. c.stroke();
  1382. c.moveTo(w * 0.1, h * 0.8);
  1383. c.lineTo(w * 0.35, h * 0.8);
  1384. c.arcTo(w * 0.15, h * 0.1, 0, 0, 0, w * 0.5, h * 0.75);
  1385. c.arcTo(w * 0.15, h * 0.1, 0, 0, 1, w * 0.65, h * 0.7);
  1386. c.lineTo(w * 0.9, h * 0.7);
  1387. c.stroke();
  1388. };
  1389. mxCellRenderer.registerShape('mxgraph.lean_mapping.crossDock', mxLeanCrossDock);
  1390. mxLeanCrossDock.prototype.constraints = [
  1391. new mxConnectionConstraint(new mxPoint(0, 0), true),
  1392. new mxConnectionConstraint(new mxPoint(1, 0), true),
  1393. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1394. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1395. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  1396. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1397. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  1398. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  1399. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  1400. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  1401. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  1402. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  1403. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  1404. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1405. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1406. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1407. ];
  1408. //**********************************************************************************************************************************************************
  1409. //Orders
  1410. //**********************************************************************************************************************************************************
  1411. /**
  1412. * Extends mxShape.
  1413. */
  1414. function mxLeanOrders(bounds, fill, stroke, strokewidth)
  1415. {
  1416. mxShape.call(this);
  1417. this.bounds = bounds;
  1418. this.fill = fill;
  1419. this.stroke = stroke;
  1420. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1421. };
  1422. /**
  1423. * Extends mxShape.
  1424. */
  1425. mxUtils.extend(mxLeanOrders, mxShape);
  1426. /**
  1427. * Function: paintVertexShape
  1428. *
  1429. * Paints the vertex shape.
  1430. */
  1431. mxLeanOrders.prototype.paintVertexShape = function(c, x, y, w, h)
  1432. {
  1433. c.translate(x, y);
  1434. c.rect(0, h * 0.56, w, h * 0.44);
  1435. c.fillAndStroke();
  1436. var strokeWidth = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, '2'));
  1437. c.setStrokeWidth(strokeWidth * 0.5);
  1438. c.begin();
  1439. c.moveTo(w * 0.04, h * 0.5418);
  1440. c.lineTo(w * 0.94, h * 0.5418);
  1441. c.moveTo(w * 0.0522, h * 0.5088);
  1442. c.lineTo(w * 0.9522, h * 0.5088);
  1443. c.moveTo(w * 0.05, h * 0.4738);
  1444. c.lineTo(w * 0.95, h * 0.4738);
  1445. c.moveTo(w * 0.0456, h * 0.4427);
  1446. c.lineTo(w * 0.9456, h * 0.4427);
  1447. c.moveTo(w * 0.0422, h * 0.4135);
  1448. c.lineTo(w * 0.9422, h * 0.4135);
  1449. c.moveTo(w * 0.0533, h * 0.3804);
  1450. c.lineTo(w * 0.9533, h * 0.3804);
  1451. c.moveTo(w * 0.0556, h * 0.3454);
  1452. c.lineTo(w * 0.9556, h * 0.3454);
  1453. c.moveTo(w * 0.05, h * 0.3143);
  1454. c.lineTo(w * 0.95, h * 0.3143);
  1455. c.moveTo(w * 0.0489, h * 0.2832);
  1456. c.lineTo(w * 0.0489, h * 0.2832);
  1457. c.moveTo(w * 0.0544, h * 0.254);
  1458. c.lineTo(w * 0.9544, h * 0.254);
  1459. c.moveTo(w * 0.0489, h * 0.221);
  1460. c.lineTo(w * 0.9489, h * 0.221);
  1461. c.moveTo(w * 0.0556, h * 0.1918);
  1462. c.lineTo(w * 0.9556, h * 0.1918);
  1463. c.moveTo(w * 0.0522, h * 0.1587);
  1464. c.lineTo(w * 0.9522, h * 0.1587);
  1465. c.moveTo(w * 0.0544, h * 0.1276);
  1466. c.lineTo(w * 0.9544, h * 0.1276);
  1467. c.moveTo(w * 0.0544, h * 0.0965);
  1468. c.lineTo(w * 0.9544, h * 0.0965);
  1469. c.moveTo(w * 0.0556, h * 0.0654);
  1470. c.lineTo(w * 0.9556, h * 0.0654);
  1471. c.moveTo(w * 0.0533, h * 0.0304);
  1472. c.lineTo(w * 0.9533, h * 0.0304);
  1473. c.moveTo(w * 0.0556, 0);
  1474. c.lineTo(w * 0.9556, 0);
  1475. c.stroke();
  1476. // var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1477. // c.setFontSize(Math.min(h * 0.5, w * 0.2));
  1478. // c.setFontColor(strokeColor);
  1479. // c.setFontStyle(mxConstants.FONT_BOLD);
  1480. // c.text(w * 0.5, h * 0.78, 0, 0, 'IN', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1481. };
  1482. mxCellRenderer.registerShape('mxgraph.lean_mapping.orders', mxLeanOrders);
  1483. mxLeanOrders.prototype.constraints = [
  1484. new mxConnectionConstraint(new mxPoint(0.05, 0), true),
  1485. new mxConnectionConstraint(new mxPoint(0.95, 0), true),
  1486. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1487. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1488. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  1489. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1490. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  1491. new mxConnectionConstraint(new mxPoint(0.05, 0.25), false),
  1492. new mxConnectionConstraint(new mxPoint(0.05, 0.5), false),
  1493. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  1494. new mxConnectionConstraint(new mxPoint(0.95, 0.25), false),
  1495. new mxConnectionConstraint(new mxPoint(0.95, 0.5), false),
  1496. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  1497. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1498. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1499. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1500. ];
  1501. //**********************************************************************************************************************************************************
  1502. //Batched Kanban
  1503. //**********************************************************************************************************************************************************
  1504. /**
  1505. * Extends mxShape.
  1506. */
  1507. function mxLeanBatchedKanban(bounds, fill, stroke, strokewidth)
  1508. {
  1509. mxShape.call(this);
  1510. this.bounds = bounds;
  1511. this.fill = fill;
  1512. this.stroke = stroke;
  1513. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1514. };
  1515. /**
  1516. * Extends mxShape.
  1517. */
  1518. mxUtils.extend(mxLeanBatchedKanban, mxShape);
  1519. /**
  1520. * Function: paintVertexShape
  1521. *
  1522. * Paints the vertex shape.
  1523. */
  1524. mxLeanBatchedKanban.prototype.paintVertexShape = function(c, x, y, w, h)
  1525. {
  1526. w = Math.max(110, w);
  1527. c.translate(x, y);
  1528. c.begin();
  1529. c.moveTo(4, h * 0.5);
  1530. c.lineTo(w, h * 0.5);
  1531. c.stroke();
  1532. c.begin();
  1533. c.moveTo(w * 0.5 - 20, h * 0.5 - 35);
  1534. c.lineTo(w * 0.5 + 25, h * 0.5 - 35);
  1535. c.lineTo(w * 0.5 + 40, h * 0.5 - 20);
  1536. c.lineTo(w * 0.5 + 40, h * 0.5 + 15);
  1537. c.lineTo(w * 0.5 - 20, h * 0.5 + 15);
  1538. c.close();
  1539. c.fillAndStroke();
  1540. c.begin();
  1541. c.moveTo(w * 0.5 - 30, h * 0.5 - 25);
  1542. c.lineTo(w * 0.5 + 15, h * 0.5 - 25);
  1543. c.lineTo(w * 0.5 + 30, h * 0.5 - 10);
  1544. c.lineTo(w * 0.5 + 30, h * 0.5 + 25);
  1545. c.lineTo(w * 0.5 - 30, h * 0.5 + 25);
  1546. c.close();
  1547. c.fillAndStroke();
  1548. c.begin();
  1549. c.moveTo(w * 0.5 - 40, h * 0.5 - 15);
  1550. c.lineTo(w * 0.5 + 5, h * 0.5 - 15);
  1551. c.lineTo(w * 0.5 + 20, h * 0.5);
  1552. c.lineTo(w * 0.5 + 20, h * 0.5 + 35);
  1553. c.lineTo(w * 0.5 - 40, h * 0.5 + 35);
  1554. c.close();
  1555. c.fillAndStroke();
  1556. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1557. c.setFillColor(strokeColor);
  1558. c.begin();
  1559. c.moveTo(w - 10, h * 0.5 - 4);
  1560. c.lineTo(w, h * 0.5);
  1561. c.lineTo(w - 10, h * 0.5 + 4);
  1562. c.close();
  1563. c.fillAndStroke();
  1564. };
  1565. mxCellRenderer.registerShape('mxgraph.lean_mapping.batched_kanban', mxLeanBatchedKanban);
  1566. mxLeanBatchedKanban.prototype.constraints = [
  1567. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  1568. new mxConnectionConstraint(new mxPoint(1, 0.5), true)
  1569. ];
  1570. //**********************************************************************************************************************************************************
  1571. //Control Center
  1572. //**********************************************************************************************************************************************************
  1573. /**
  1574. * Extends mxShape.
  1575. */
  1576. function mxLeanControlCenter(bounds, fill, stroke, strokewidth)
  1577. {
  1578. mxShape.call(this);
  1579. this.bounds = bounds;
  1580. this.fill = fill;
  1581. this.stroke = stroke;
  1582. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1583. };
  1584. /**
  1585. * Extends mxShape.
  1586. */
  1587. mxUtils.extend(mxLeanControlCenter, mxShape);
  1588. /**
  1589. * Function: paintVertexShape
  1590. *
  1591. * Paints the vertex shape.
  1592. */
  1593. mxLeanControlCenter.prototype.paintVertexShape = function(c, x, y, w, h)
  1594. {
  1595. c.translate(x, y);
  1596. c.rect(w * 0.15, 0, w * 0.7, h * 0.8);
  1597. c.fillAndStroke();
  1598. c.rect(0, h * 0.8, w, h * 0.2);
  1599. c.fillAndStroke();
  1600. };
  1601. mxCellRenderer.registerShape('mxgraph.lean_mapping.control_center', mxLeanControlCenter);
  1602. mxLeanControlCenter.prototype.constraints = [
  1603. new mxConnectionConstraint(new mxPoint(0.15, 0), true),
  1604. new mxConnectionConstraint(new mxPoint(0.85, 0), true),
  1605. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1606. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1607. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1608. new mxConnectionConstraint(new mxPoint(0.15, 0.25), false),
  1609. new mxConnectionConstraint(new mxPoint(0.15, 0.5), false),
  1610. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  1611. new mxConnectionConstraint(new mxPoint(0.85, 0.25), false),
  1612. new mxConnectionConstraint(new mxPoint(0.85, 0.5), false),
  1613. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  1614. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1615. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1616. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1617. ];
  1618. //**********************************************************************************************************************************************************
  1619. //Electronical Info
  1620. //**********************************************************************************************************************************************************
  1621. function LeanElectronicInfoShape()
  1622. {
  1623. mxArrow.call(this);
  1624. };
  1625. mxUtils.extend(LeanElectronicInfoShape, mxArrow);
  1626. LeanElectronicInfoShape.prototype.paintEdgeShape = function(c, pts)
  1627. {
  1628. // Base vector (between end points)
  1629. var p0 = pts[0];
  1630. var pe = pts[pts.length - 1];
  1631. var dx = pe.x - p0.x;
  1632. var dy = pe.y - p0.y;
  1633. p0.x = p0.x + dx * 0.05;
  1634. p0.y = p0.y + dy * 0.05;
  1635. pe.x = pe.x - dx * 0.05;
  1636. pe.y = pe.y - dy * 0.05;
  1637. dx = pe.x - p0.x;
  1638. dy = pe.y - p0.y;
  1639. var dist = Math.sqrt(dx * dx + dy * dy);
  1640. var nx = dx / dist;
  1641. var ny = dy / dist;
  1642. var midX = p0.x + dx * 0.5;
  1643. var midY = p0.y + dy * 0.5;
  1644. var p1x = midX - nx * dist * 0.1 - ny / 3 * dist * 0.1;
  1645. var p1y = midY - ny * dist * 0.1 + nx / 3 * dist * 0.1;
  1646. var p4x = midX + nx * dist * 0.1 + ny / 3 * dist * 0.1;
  1647. var p4y = midY + ny * dist * 0.1 - nx / 3 * dist * 0.1;
  1648. c.begin();
  1649. c.moveTo(p0.x, p0.y);
  1650. c.lineTo(p4x, p4y);
  1651. c.lineTo(p1x, p1y);
  1652. c.lineTo(pe.x, pe.y);
  1653. c.stroke();
  1654. var dx = pe.x - p1x;
  1655. var dy = pe.y - p1y;
  1656. var dist = Math.sqrt(dx * dx + dy * dy);
  1657. var nx = dx / dist;
  1658. var ny = dy / dist;
  1659. c.setFillColor(mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000'));
  1660. c.begin();
  1661. c.moveTo(pe.x - nx * 10 - ny * 5, pe.y - ny * 10 + nx * 5);
  1662. c.lineTo(pe.x, pe.y);
  1663. c.lineTo(pe.x - nx * 10 + ny * 5, pe.y - ny * 10 - nx * 5);
  1664. c.fillAndStroke();
  1665. };
  1666. // Registers the electronic info shape
  1667. mxCellRenderer.prototype.defaultShapes['mxgraph.lean_mapping.electronic_info_flow_edge'] = LeanElectronicInfoShape;
  1668. //**********************************************************************************************************************************************************
  1669. //Manual Info
  1670. //**********************************************************************************************************************************************************
  1671. function LeanManualInfoShape()
  1672. {
  1673. mxArrow.call(this);
  1674. };
  1675. mxUtils.extend(LeanManualInfoShape, mxArrow);
  1676. LeanManualInfoShape.prototype.paintEdgeShape = function(c, pts)
  1677. {
  1678. // Base vector (between end points)
  1679. var p0 = pts[0];
  1680. var pe = pts[pts.length - 1];
  1681. var dx = pe.x - p0.x;
  1682. var dy = pe.y - p0.y;
  1683. p0.x = p0.x + dx * 0.05;
  1684. p0.y = p0.y + dy * 0.05;
  1685. pe.x = pe.x - dx * 0.05;
  1686. pe.y = pe.y - dy * 0.05;
  1687. dx = pe.x - p0.x;
  1688. dy = pe.y - p0.y;
  1689. var dist = Math.sqrt(dx * dx + dy * dy);
  1690. var nx = dx / dist;
  1691. var ny = dy / dist;
  1692. c.begin();
  1693. c.moveTo(p0.x, p0.y);
  1694. c.lineTo(pe.x, pe.y);
  1695. c.stroke();
  1696. c.setFillColor(mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000'));
  1697. c.begin();
  1698. c.moveTo(pe.x - nx * 10 - ny * 5, pe.y - ny * 10 + nx * 5);
  1699. c.lineTo(pe.x, pe.y);
  1700. c.lineTo(pe.x - nx * 10 + ny * 5, pe.y - ny * 10 - nx * 5);
  1701. c.fillAndStroke();
  1702. };
  1703. //Registers the electronic info shape
  1704. mxCellRenderer.prototype.defaultShapes['mxgraph.lean_mapping.manual_info_flow_edge'] = LeanManualInfoShape;
  1705. //**********************************************************************************************************************************************************
  1706. //Timeline
  1707. //**********************************************************************************************************************************************************
  1708. /**
  1709. * Extends mxShape.
  1710. */
  1711. function mxShapeLeanTimeline(bounds, fill, stroke, strokewidth)
  1712. {
  1713. mxShape.call(this);
  1714. this.bounds = bounds;
  1715. this.fill = fill;
  1716. this.stroke = stroke;
  1717. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1718. };
  1719. /**
  1720. * Extends mxShape.
  1721. */
  1722. mxUtils.extend(mxShapeLeanTimeline, mxShape);
  1723. mxShapeLeanTimeline.prototype.cst = {
  1724. SHAPE_TIMELINE : 'mxgraph.lean_mapping.timeline2'
  1725. };
  1726. /**
  1727. * Function: paintVertexShape
  1728. *
  1729. * Paints the vertex shape.
  1730. */
  1731. mxShapeLeanTimeline.prototype.paintVertexShape = function(c, x, y, w, h)
  1732. {
  1733. c.translate(x, y);
  1734. var dy1 = mxUtils.getValue(this.style, 'dy1', '0');
  1735. var dx2 = mxUtils.getValue(this.style, 'dx2', '0');
  1736. var dy2 = mxUtils.getValue(this.style, 'dy2', '0');
  1737. var dx3 = mxUtils.getValue(this.style, 'dx3', '0');
  1738. var dy3 = mxUtils.getValue(this.style, 'dy3', '0');
  1739. var dx4 = mxUtils.getValue(this.style, 'dx4', '0');
  1740. var dy4 = mxUtils.getValue(this.style, 'dy4', '0');
  1741. var dx5 = mxUtils.getValue(this.style, 'dx5', '0');
  1742. var dy5 = mxUtils.getValue(this.style, 'dy5', '0');
  1743. var dy6 = mxUtils.getValue(this.style, 'dy6', '0');
  1744. var lastUp = true;
  1745. c.begin();
  1746. if (dy1 <= 0.5)
  1747. {
  1748. c.moveTo(0, 0);
  1749. lastUp = true;
  1750. }
  1751. else
  1752. {
  1753. c.moveTo(0, h);
  1754. lastUp = false;
  1755. }
  1756. //2
  1757. if (dy2 <= 0.5 && lastUp)
  1758. {
  1759. c.lineTo(dx2, 0);
  1760. lastUp = true;
  1761. }
  1762. else if (dy2 > 0.5 && !lastUp)
  1763. {
  1764. c.lineTo(dx2, h);
  1765. lastUp = false;
  1766. }
  1767. else if (dy2 <= 0.5 && !lastUp)
  1768. {
  1769. c.lineTo(dx2, h);
  1770. c.lineTo(dx2, 0);
  1771. lastUp = true;
  1772. }
  1773. else
  1774. {
  1775. c.lineTo(dx2, 0);
  1776. c.lineTo(dx2, h);
  1777. lastUp = false;
  1778. }
  1779. //3
  1780. if (dy3 <= 0.5 && lastUp)
  1781. {
  1782. c.lineTo(dx3, 0);
  1783. lastUp = true;
  1784. }
  1785. else if (dy3 > 0.5 && !lastUp)
  1786. {
  1787. c.lineTo(dx3, h);
  1788. lastUp = false;
  1789. }
  1790. else if (dy3 <= 0.5 && !lastUp)
  1791. {
  1792. c.lineTo(dx3, h);
  1793. c.lineTo(dx3, 0);
  1794. lastUp = true;
  1795. }
  1796. else
  1797. {
  1798. c.lineTo(dx3, 0);
  1799. c.lineTo(dx3, h);
  1800. lastUp = false;
  1801. }
  1802. //4
  1803. if (dy4 <= 0.5 && lastUp)
  1804. {
  1805. c.lineTo(dx4, 0);
  1806. lastUp = true;
  1807. }
  1808. else if (dy4 > 0.5 && !lastUp)
  1809. {
  1810. c.lineTo(dx4, h);
  1811. lastUp = false;
  1812. }
  1813. else if (dy4 <= 0.5 && !lastUp)
  1814. {
  1815. c.lineTo(dx4, h);
  1816. c.lineTo(dx4, 0);
  1817. lastUp = true;
  1818. }
  1819. else
  1820. {
  1821. c.lineTo(dx4, 0);
  1822. c.lineTo(dx4, h);
  1823. lastUp = false;
  1824. }
  1825. //5
  1826. if (dy5 <= 0.5 && lastUp)
  1827. {
  1828. c.lineTo(dx5, 0);
  1829. lastUp = true;
  1830. }
  1831. else if (dy5 > 0.5 && !lastUp)
  1832. {
  1833. c.lineTo(dx5, h);
  1834. lastUp = false;
  1835. }
  1836. else if (dy5 <= 0.5 && !lastUp)
  1837. {
  1838. c.lineTo(dx5, h);
  1839. c.lineTo(dx5, 0);
  1840. lastUp = true;
  1841. }
  1842. else
  1843. {
  1844. c.lineTo(dx5, 0);
  1845. c.lineTo(dx5, h);
  1846. lastUp = false;
  1847. }
  1848. //6
  1849. if (dy6 <= 0.5 && lastUp)
  1850. {
  1851. c.lineTo(w, 0);
  1852. lastUp = true;
  1853. }
  1854. else if (dy6 > 0.5 && !lastUp)
  1855. {
  1856. c.lineTo(w, h);
  1857. lastUp = false;
  1858. }
  1859. else if (dy6 <= 0.5 && !lastUp)
  1860. {
  1861. c.lineTo(w, h);
  1862. c.lineTo(w, 0);
  1863. lastUp = true;
  1864. }
  1865. else
  1866. {
  1867. c.lineTo(w, 0);
  1868. c.lineTo(w, h);
  1869. lastUp = false;
  1870. }
  1871. //end
  1872. c.stroke();
  1873. };
  1874. mxCellRenderer.prototype.defaultShapes[mxShapeLeanTimeline.prototype.cst.SHAPE_TIMELINE] = mxShapeLeanTimeline;
  1875. Graph.handleFactory[mxShapeLeanTimeline.prototype.cst.SHAPE_TIMELINE] = function(state)
  1876. {
  1877. var handles = [Graph.createHandle(state, ['dy1'], function(bounds)
  1878. {
  1879. var dy1 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy1', 0))));
  1880. return new mxPoint(bounds.x, bounds.y + dy1 * bounds.height);
  1881. }, function(bounds, pt)
  1882. {
  1883. this.state.style['dy1'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1884. })];
  1885. var handle2 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds)
  1886. {
  1887. var dx2 = Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dx3', 0)), parseFloat(mxUtils.getValue(this.state.style, 'dx2', 0))));
  1888. var dy2 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy2', 0))));
  1889. return new mxPoint(bounds.x + dx2, bounds.y + dy2 * bounds.height);
  1890. }, function(bounds, pt)
  1891. {
  1892. this.state.style['dx2'] = Math.round(1000 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dx3', 0)), (pt.x - bounds.x)))) / 1000;
  1893. this.state.style['dy2'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1894. });
  1895. handles.push(handle2);
  1896. var handle3 = Graph.createHandle(state, ['dx3', 'dy3'], function(bounds)
  1897. {
  1898. var dx3 = Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx2', 0)), Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dx4', 0)), parseFloat(mxUtils.getValue(this.state.style, 'dx3', 0))));
  1899. var dy3 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy3', 0))));
  1900. return new mxPoint(bounds.x + dx3, bounds.y + dy3 * bounds.height);
  1901. }, function(bounds, pt)
  1902. {
  1903. this.state.style['dx3'] = Math.round(1000 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx2', 0)), Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dx4', 0)), (pt.x - bounds.x)))) / 1000;
  1904. this.state.style['dy3'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1905. });
  1906. handles.push(handle3);
  1907. var handle4 = Graph.createHandle(state, ['dx4', 'dy4'], function(bounds)
  1908. {
  1909. var dx4 = Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx3', 0)), Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dx5', 0)), parseFloat(mxUtils.getValue(this.state.style, 'dx4', 0))));
  1910. var dy4 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy4', 0))));
  1911. return new mxPoint(bounds.x + dx4, bounds.y + dy4 * bounds.height);
  1912. }, function(bounds, pt)
  1913. {
  1914. this.state.style['dx4'] = Math.round(1000 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx3', 0)), Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dx5', 0)), (pt.x - bounds.x)))) / 1000;
  1915. this.state.style['dy4'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1916. });
  1917. handles.push(handle4);
  1918. var handle5 = Graph.createHandle(state, ['dx5', 'dy5'], function(bounds)
  1919. {
  1920. var dx5 = Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx4', 0)), Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx5', 0))));
  1921. var dy5 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy5', 0))));
  1922. return new mxPoint(bounds.x + dx5, bounds.y + dy5 * bounds.height);
  1923. }, function(bounds, pt)
  1924. {
  1925. this.state.style['dx5'] = Math.round(1000 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx4', 0)), Math.min(bounds.width, (pt.x - bounds.x)))) / 1000;
  1926. this.state.style['dy5'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1927. });
  1928. handles.push(handle5);
  1929. var handle6 = Graph.createHandle(state, ['dy6'], function(bounds)
  1930. {
  1931. var dy6 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy6', 0))));
  1932. return new mxPoint(bounds.x + bounds.width, bounds.y + dy6 * bounds.height);
  1933. }, function(bounds, pt)
  1934. {
  1935. this.state.style['dy6'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1936. });
  1937. handles.push(handle6);
  1938. return handles;
  1939. }