mxLeanMap.js 78 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229
  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. mxLeanProductionKanban.prototype.getConstraints = function(style, w, h)
  976. {
  977. var constr = [];
  978. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 4, h));
  979. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, 25));
  980. return (constr);
  981. };
  982. //**********************************************************************************************************************************************************
  983. //Withdrawal Kanban
  984. //**********************************************************************************************************************************************************
  985. /**
  986. * Extends mxShape.
  987. */
  988. function mxLeanWithdrawalKanban(bounds, fill, stroke, strokewidth)
  989. {
  990. mxShape.call(this);
  991. this.bounds = bounds;
  992. this.fill = fill;
  993. this.stroke = stroke;
  994. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  995. };
  996. /**
  997. * Extends mxShape.
  998. */
  999. mxUtils.extend(mxLeanWithdrawalKanban, mxShape);
  1000. /**
  1001. * Function: paintVertexShape
  1002. *
  1003. * Paints the vertex shape.
  1004. */
  1005. mxLeanWithdrawalKanban.prototype.paintVertexShape = function(c, x, y, w, h)
  1006. {
  1007. c.translate(x, y);
  1008. c.setDashed(true);
  1009. c.begin();
  1010. c.moveTo(4, h - 10);
  1011. c.lineTo(4, 25);
  1012. c.lineTo(w, 25);
  1013. c.stroke();
  1014. c.setDashed(false);
  1015. c.begin();
  1016. c.moveTo(w - 75, 0);
  1017. c.lineTo(w - 30, 0);
  1018. c.lineTo(w - 15, 15);
  1019. c.lineTo(w - 15, 50);
  1020. c.lineTo(w - 75, 50);
  1021. c.close();
  1022. c.fillAndStroke();
  1023. c.begin();
  1024. c.moveTo(w - 75, 45);
  1025. c.lineTo(w - 70, 50);
  1026. c.moveTo(w - 75, 35);
  1027. c.lineTo(w - 60, 50);
  1028. c.moveTo(w - 75, 25);
  1029. c.lineTo(w - 50, 50);
  1030. c.moveTo(w - 75, 15);
  1031. c.lineTo(w - 40, 50);
  1032. c.moveTo(w - 75, 5);
  1033. c.lineTo(w - 30, 50);
  1034. c.moveTo(w - 70, 0);
  1035. c.lineTo(w - 20, 50);
  1036. c.moveTo(w - 60, 0);
  1037. c.lineTo(w - 15, 45);
  1038. c.moveTo(w - 50, 0);
  1039. c.lineTo(w - 15, 35);
  1040. c.moveTo(w - 40, 0);
  1041. c.lineTo(w - 15, 25);
  1042. c.stroke();
  1043. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1044. c.setFillColor(strokeColor);
  1045. c.begin();
  1046. c.moveTo(0, h - 10);
  1047. c.lineTo(4, h);
  1048. c.lineTo(8, h - 10);
  1049. c.close();
  1050. c.fillAndStroke();
  1051. };
  1052. mxCellRenderer.registerShape('mxgraph.lean_mapping.withdrawal_kanban', mxLeanWithdrawalKanban);
  1053. mxLeanWithdrawalKanban.prototype.getConstraints = function(style, w, h)
  1054. {
  1055. var constr = [];
  1056. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 4, h));
  1057. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, 25));
  1058. return (constr);
  1059. };
  1060. //**********************************************************************************************************************************************************
  1061. //Signal Kanban
  1062. //**********************************************************************************************************************************************************
  1063. /**
  1064. * Extends mxShape.
  1065. */
  1066. function mxLeanSignalKanban(bounds, fill, stroke, strokewidth)
  1067. {
  1068. mxShape.call(this);
  1069. this.bounds = bounds;
  1070. this.fill = fill;
  1071. this.stroke = stroke;
  1072. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1073. };
  1074. /**
  1075. * Extends mxShape.
  1076. */
  1077. mxUtils.extend(mxLeanSignalKanban, mxShape);
  1078. /**
  1079. * Function: paintVertexShape
  1080. *
  1081. * Paints the vertex shape.
  1082. */
  1083. mxLeanSignalKanban.prototype.paintVertexShape = function(c, x, y, w, h)
  1084. {
  1085. c.translate(x, y);
  1086. c.setDashed(true);
  1087. c.begin();
  1088. c.moveTo(4, h - 10);
  1089. c.lineTo(4, 15);
  1090. c.lineTo(w, 15);
  1091. c.stroke();
  1092. c.setDashed(false);
  1093. c.begin();
  1094. c.moveTo(w - 65, 0);
  1095. c.lineTo(w - 25, 0);
  1096. c.lineTo(w - 45, 45);
  1097. c.close();
  1098. c.fillAndStroke();
  1099. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1100. c.setFillColor(strokeColor);
  1101. c.begin();
  1102. c.moveTo(0, h - 10);
  1103. c.lineTo(4, h);
  1104. c.lineTo(8, h - 10);
  1105. c.close();
  1106. c.fillAndStroke();
  1107. };
  1108. mxCellRenderer.registerShape('mxgraph.lean_mapping.signal_kanban', mxLeanSignalKanban);
  1109. mxLeanSignalKanban.prototype.getConstraints = function(style, w, h)
  1110. {
  1111. var constr = [];
  1112. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 4, h));
  1113. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, 15));
  1114. return (constr);
  1115. };
  1116. //**********************************************************************************************************************************************************
  1117. //Sequenced Pull Ball
  1118. //**********************************************************************************************************************************************************
  1119. /**
  1120. * Extends mxShape.
  1121. */
  1122. function mxLeanSequencedPullBall(bounds, fill, stroke, strokewidth)
  1123. {
  1124. mxShape.call(this);
  1125. this.bounds = bounds;
  1126. this.fill = fill;
  1127. this.stroke = stroke;
  1128. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1129. };
  1130. /**
  1131. * Extends mxShape.
  1132. */
  1133. mxUtils.extend(mxLeanSequencedPullBall, mxShape);
  1134. /**
  1135. * Function: paintVertexShape
  1136. *
  1137. * Paints the vertex shape.
  1138. */
  1139. mxLeanSequencedPullBall.prototype.paintVertexShape = function(c, x, y, w, h)
  1140. {
  1141. c.translate(x, y);
  1142. c.ellipse(0, 0, w, h);
  1143. c.fillAndStroke();
  1144. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1145. c.setFillColor(strokeColor);
  1146. c.setShadow(false);
  1147. c.ellipse(w * 0.15, h * 0.15, w * 0.7, h * 0.7);
  1148. c.fillAndStroke();
  1149. };
  1150. mxCellRenderer.registerShape('mxgraph.lean_mapping.sequenced_pull_ball', mxLeanSequencedPullBall);
  1151. mxLeanSequencedPullBall.prototype.constraints = [
  1152. new mxConnectionConstraint(new mxPoint(0.144, 0.144), false),
  1153. new mxConnectionConstraint(new mxPoint(0.856, 0.144), false),
  1154. new mxConnectionConstraint(new mxPoint(0.856, 0.856), false),
  1155. new mxConnectionConstraint(new mxPoint(0.144, 0.856), false),
  1156. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  1157. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  1158. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1159. new mxConnectionConstraint(new mxPoint(0.5, 1), true)
  1160. ];
  1161. //**********************************************************************************************************************************************************
  1162. //Rail Shipment
  1163. //**********************************************************************************************************************************************************
  1164. /**
  1165. * Extends mxShape.
  1166. */
  1167. function mxLeanRailShipment(bounds, fill, stroke, strokewidth)
  1168. {
  1169. mxShape.call(this);
  1170. this.bounds = bounds;
  1171. this.fill = fill;
  1172. this.stroke = stroke;
  1173. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1174. };
  1175. /**
  1176. * Extends mxShape.
  1177. */
  1178. mxUtils.extend(mxLeanRailShipment, mxShape);
  1179. /**
  1180. * Function: paintVertexShape
  1181. *
  1182. * Paints the vertex shape.
  1183. */
  1184. mxLeanRailShipment.prototype.paintVertexShape = function(c, x, y, w, h)
  1185. {
  1186. c.translate(x, y);
  1187. c.rect(w * 0.1, 0, w * 0.35, h * 0.8);
  1188. c.fillAndStroke();
  1189. c.rect(w * 0.55, 0, w * 0.35, h * 0.8);
  1190. c.fillAndStroke();
  1191. c.begin();
  1192. c.moveTo(0, h);
  1193. c.lineTo(w, h);
  1194. c.moveTo(w * 0.45, h * 0.7);
  1195. c.lineTo(w * 0.55, h * 0.7);
  1196. c.stroke();
  1197. c.ellipse(w * 0.15, h * 0.8, w * 0.06, h * 0.2);
  1198. c.fillAndStroke();
  1199. c.ellipse(w * 0.34, h * 0.8, w * 0.06, h * 0.2);
  1200. c.fillAndStroke();
  1201. c.ellipse(w * 0.6, h * 0.8, w * 0.06, h * 0.2);
  1202. c.fillAndStroke();
  1203. c.ellipse(w * 0.79, h * 0.8, w * 0.06, h * 0.2);
  1204. c.fillAndStroke();
  1205. };
  1206. mxCellRenderer.registerShape('mxgraph.lean_mapping.rail_shipment', mxLeanRailShipment);
  1207. mxLeanRailShipment.prototype.constraints = [
  1208. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1209. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1210. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  1211. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1212. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  1213. new mxConnectionConstraint(new mxPoint(0.1, 0.25), false),
  1214. new mxConnectionConstraint(new mxPoint(0.1, 0.5), false),
  1215. new mxConnectionConstraint(new mxPoint(0.1, 0.75), false),
  1216. new mxConnectionConstraint(new mxPoint(0.9, 0.25), false),
  1217. new mxConnectionConstraint(new mxPoint(0.9, 0.5), false),
  1218. new mxConnectionConstraint(new mxPoint(0.9, 0.75), false),
  1219. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1220. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1221. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1222. ];
  1223. //**********************************************************************************************************************************************************
  1224. //Warehouse
  1225. //**********************************************************************************************************************************************************
  1226. /**
  1227. * Extends mxShape.
  1228. */
  1229. function mxLeanWarehouse(bounds, fill, stroke, strokewidth)
  1230. {
  1231. mxShape.call(this);
  1232. this.bounds = bounds;
  1233. this.fill = fill;
  1234. this.stroke = stroke;
  1235. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1236. };
  1237. /**
  1238. * Extends mxShape.
  1239. */
  1240. mxUtils.extend(mxLeanWarehouse, mxShape);
  1241. /**
  1242. * Function: paintVertexShape
  1243. *
  1244. * Paints the vertex shape.
  1245. */
  1246. mxLeanWarehouse.prototype.paintVertexShape = function(c, x, y, w, h)
  1247. {
  1248. c.translate(x, y);
  1249. c.rect(0, 0, w, h);
  1250. c.fillAndStroke();
  1251. c.setShadow(false);
  1252. c.begin();
  1253. c.moveTo(0, h * 0.4);
  1254. c.lineTo(w, h * 0.4);
  1255. c.moveTo(w * 0.15, h);
  1256. c.lineTo(w * 0.15, h * 0.55);
  1257. c.lineTo(w * 0.3, h * 0.55);
  1258. c.lineTo(w * 0.3, h);
  1259. c.stroke();
  1260. c.ellipse(w * 0.27, h * 0.75, w * 0.02, w * 0.02);
  1261. c.stroke();
  1262. };
  1263. mxCellRenderer.registerShape('mxgraph.lean_mapping.warehouse', mxLeanWarehouse);
  1264. mxLeanWarehouse.prototype.constraints = [
  1265. new mxConnectionConstraint(new mxPoint(0, 0), true),
  1266. new mxConnectionConstraint(new mxPoint(1, 0), true),
  1267. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1268. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1269. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  1270. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1271. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  1272. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  1273. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  1274. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  1275. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  1276. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  1277. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  1278. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1279. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1280. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1281. ];
  1282. //**********************************************************************************************************************************************************
  1283. //Timeline
  1284. //**********************************************************************************************************************************************************
  1285. /**
  1286. * Extends mxShape.
  1287. */
  1288. function mxLeanTimeline(bounds, fill, stroke, strokewidth)
  1289. {
  1290. mxShape.call(this);
  1291. this.bounds = bounds;
  1292. this.fill = fill;
  1293. this.stroke = stroke;
  1294. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1295. };
  1296. /**
  1297. * Extends mxShape.
  1298. */
  1299. mxUtils.extend(mxLeanTimeline, mxShape);
  1300. /**
  1301. * Function: paintVertexShape
  1302. *
  1303. * Paints the vertex shape.
  1304. */
  1305. mxLeanTimeline.prototype.paintVertexShape = function(c, x, y, w, h)
  1306. {
  1307. c.translate(x, y);
  1308. 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(',');
  1309. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '12');
  1310. var times = new Array();
  1311. var totalTime = 0;
  1312. for (var i = 0; i < shapeInfo.length; i = i + 2)
  1313. {
  1314. var currTime = parseFloat(shapeInfo[i]);
  1315. times.push(currTime);
  1316. totalTime = totalTime + currTime;
  1317. };
  1318. var scaleX = w / totalTime;
  1319. var names = new Array();
  1320. for (var i = 1; i < shapeInfo.length; i = i + 2)
  1321. {
  1322. names.push(shapeInfo[i]);
  1323. };
  1324. c.begin();
  1325. var currX = 0;
  1326. c.moveTo(0, h);
  1327. for (var i = 0; i < names.length; i++)
  1328. {
  1329. var currTime = times[i] * scaleX;
  1330. currX = currX + currTime;
  1331. if (i % 2 === 0)
  1332. {
  1333. c.lineTo(currX, h);
  1334. c.lineTo(currX, fontSize * 1.5);
  1335. 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);
  1336. }
  1337. else
  1338. {
  1339. c.lineTo(currX, fontSize * 1.5);
  1340. c.lineTo(currX, h);
  1341. c.text(currX - currTime * 0.5, fontSize * 0.75, 0, 0, names[i], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1342. }
  1343. };
  1344. c.stroke();
  1345. };
  1346. mxCellRenderer.registerShape('mxgraph.lean_mapping.timeline', mxLeanTimeline);
  1347. //**********************************************************************************************************************************************************
  1348. //Cross Dock
  1349. //**********************************************************************************************************************************************************
  1350. /**
  1351. * Extends mxShape.
  1352. */
  1353. function mxLeanCrossDock(bounds, fill, stroke, strokewidth)
  1354. {
  1355. mxShape.call(this);
  1356. this.bounds = bounds;
  1357. this.fill = fill;
  1358. this.stroke = stroke;
  1359. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1360. };
  1361. /**
  1362. * Extends mxShape.
  1363. */
  1364. mxUtils.extend(mxLeanCrossDock, mxShape);
  1365. /**
  1366. * Function: paintVertexShape
  1367. *
  1368. * Paints the vertex shape.
  1369. */
  1370. mxLeanCrossDock.prototype.paintVertexShape = function(c, x, y, w, h)
  1371. {
  1372. c.translate(x, y);
  1373. c.rect(0, 0, w, h);
  1374. c.fillAndStroke();
  1375. c.setShadow(false);
  1376. c.begin();
  1377. c.moveTo(0, h * 0.25);
  1378. c.lineTo(w, h * 0.25);
  1379. c.moveTo(w * 0.1, h * 0.4);
  1380. c.lineTo(w * 0.35, h * 0.4);
  1381. c.arcTo(w * 0.15, h * 0.15, 0, 0, 1, w * 0.5, h * 0.5);
  1382. c.arcTo(w * 0.15, h * 0.15, 0, 0, 0, w * 0.65, h * 0.6);
  1383. c.lineTo(w * 0.9, h * 0.6);
  1384. c.stroke();
  1385. c.moveTo(w * 0.1, h * 0.4);
  1386. c.lineTo(w * 0.35, h * 0.4);
  1387. c.arcTo(w * 0.15, h * 0.25, 0, 0, 1, w * 0.5, h * 0.55);
  1388. c.arcTo(w * 0.15, h * 0.25, 0, 0, 0, w * 0.65, h * 0.7);
  1389. c.lineTo(w * 0.9, h * 0.7);
  1390. c.stroke();
  1391. c.moveTo(w * 0.1, h * 0.4);
  1392. c.lineTo(w * 0.35, h * 0.4);
  1393. c.arcTo(w * 0.15, h * 0.3, 0, 0, 1, w * 0.5, h * 0.6);
  1394. c.arcTo(w * 0.15, h * 0.3, 0, 0, 0, w * 0.65, h * 0.8);
  1395. c.lineTo(w * 0.9, h * 0.8);
  1396. c.stroke();
  1397. c.moveTo(w * 0.1, h * 0.8);
  1398. c.lineTo(w * 0.35, h * 0.8);
  1399. c.arcTo(w * 0.15, h * 0.3, 0, 0, 0, w * 0.5, h * 0.6);
  1400. c.arcTo(w * 0.15, h * 0.3, 0, 0, 1, w * 0.65, h * 0.4);
  1401. c.lineTo(w * 0.9, h * 0.4);
  1402. c.stroke();
  1403. c.moveTo(w * 0.1, h * 0.8);
  1404. c.lineTo(w * 0.35, h * 0.8);
  1405. c.arcTo(w * 0.15, h * 0.1, 0, 0, 0, w * 0.5, h * 0.75);
  1406. c.arcTo(w * 0.15, h * 0.1, 0, 0, 1, w * 0.65, h * 0.7);
  1407. c.lineTo(w * 0.9, h * 0.7);
  1408. c.stroke();
  1409. };
  1410. mxCellRenderer.registerShape('mxgraph.lean_mapping.crossDock', mxLeanCrossDock);
  1411. mxLeanCrossDock.prototype.constraints = [
  1412. new mxConnectionConstraint(new mxPoint(0, 0), true),
  1413. new mxConnectionConstraint(new mxPoint(1, 0), true),
  1414. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1415. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1416. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  1417. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1418. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  1419. new mxConnectionConstraint(new mxPoint(0, 0.25), true),
  1420. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  1421. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  1422. new mxConnectionConstraint(new mxPoint(1, 0.25), true),
  1423. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  1424. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  1425. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1426. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1427. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1428. ];
  1429. //**********************************************************************************************************************************************************
  1430. //Orders
  1431. //**********************************************************************************************************************************************************
  1432. /**
  1433. * Extends mxShape.
  1434. */
  1435. function mxLeanOrders(bounds, fill, stroke, strokewidth)
  1436. {
  1437. mxShape.call(this);
  1438. this.bounds = bounds;
  1439. this.fill = fill;
  1440. this.stroke = stroke;
  1441. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1442. };
  1443. /**
  1444. * Extends mxShape.
  1445. */
  1446. mxUtils.extend(mxLeanOrders, mxShape);
  1447. /**
  1448. * Function: paintVertexShape
  1449. *
  1450. * Paints the vertex shape.
  1451. */
  1452. mxLeanOrders.prototype.paintVertexShape = function(c, x, y, w, h)
  1453. {
  1454. c.translate(x, y);
  1455. c.rect(0, h * 0.56, w, h * 0.44);
  1456. c.fillAndStroke();
  1457. var strokeWidth = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, '2'));
  1458. c.setStrokeWidth(strokeWidth * 0.5);
  1459. c.begin();
  1460. c.moveTo(w * 0.04, h * 0.5418);
  1461. c.lineTo(w * 0.94, h * 0.5418);
  1462. c.moveTo(w * 0.0522, h * 0.5088);
  1463. c.lineTo(w * 0.9522, h * 0.5088);
  1464. c.moveTo(w * 0.05, h * 0.4738);
  1465. c.lineTo(w * 0.95, h * 0.4738);
  1466. c.moveTo(w * 0.0456, h * 0.4427);
  1467. c.lineTo(w * 0.9456, h * 0.4427);
  1468. c.moveTo(w * 0.0422, h * 0.4135);
  1469. c.lineTo(w * 0.9422, h * 0.4135);
  1470. c.moveTo(w * 0.0533, h * 0.3804);
  1471. c.lineTo(w * 0.9533, h * 0.3804);
  1472. c.moveTo(w * 0.0556, h * 0.3454);
  1473. c.lineTo(w * 0.9556, h * 0.3454);
  1474. c.moveTo(w * 0.05, h * 0.3143);
  1475. c.lineTo(w * 0.95, h * 0.3143);
  1476. c.moveTo(w * 0.0489, h * 0.2832);
  1477. c.lineTo(w * 0.0489, h * 0.2832);
  1478. c.moveTo(w * 0.0544, h * 0.254);
  1479. c.lineTo(w * 0.9544, h * 0.254);
  1480. c.moveTo(w * 0.0489, h * 0.221);
  1481. c.lineTo(w * 0.9489, h * 0.221);
  1482. c.moveTo(w * 0.0556, h * 0.1918);
  1483. c.lineTo(w * 0.9556, h * 0.1918);
  1484. c.moveTo(w * 0.0522, h * 0.1587);
  1485. c.lineTo(w * 0.9522, h * 0.1587);
  1486. c.moveTo(w * 0.0544, h * 0.1276);
  1487. c.lineTo(w * 0.9544, h * 0.1276);
  1488. c.moveTo(w * 0.0544, h * 0.0965);
  1489. c.lineTo(w * 0.9544, h * 0.0965);
  1490. c.moveTo(w * 0.0556, h * 0.0654);
  1491. c.lineTo(w * 0.9556, h * 0.0654);
  1492. c.moveTo(w * 0.0533, h * 0.0304);
  1493. c.lineTo(w * 0.9533, h * 0.0304);
  1494. c.moveTo(w * 0.0556, 0);
  1495. c.lineTo(w * 0.9556, 0);
  1496. c.stroke();
  1497. };
  1498. mxCellRenderer.registerShape('mxgraph.lean_mapping.orders', mxLeanOrders);
  1499. mxLeanOrders.prototype.constraints = [
  1500. new mxConnectionConstraint(new mxPoint(0.05, 0), true),
  1501. new mxConnectionConstraint(new mxPoint(0.95, 0), true),
  1502. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1503. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1504. new mxConnectionConstraint(new mxPoint(0.25, 0), true),
  1505. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1506. new mxConnectionConstraint(new mxPoint(0.75, 0), true),
  1507. new mxConnectionConstraint(new mxPoint(0.05, 0.25), false),
  1508. new mxConnectionConstraint(new mxPoint(0.05, 0.5), false),
  1509. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  1510. new mxConnectionConstraint(new mxPoint(0.95, 0.25), false),
  1511. new mxConnectionConstraint(new mxPoint(0.95, 0.5), false),
  1512. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  1513. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1514. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1515. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1516. ];
  1517. //**********************************************************************************************************************************************************
  1518. //Batched Kanban
  1519. //**********************************************************************************************************************************************************
  1520. /**
  1521. * Extends mxShape.
  1522. */
  1523. function mxLeanBatchedKanban(bounds, fill, stroke, strokewidth)
  1524. {
  1525. mxShape.call(this);
  1526. this.bounds = bounds;
  1527. this.fill = fill;
  1528. this.stroke = stroke;
  1529. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1530. };
  1531. /**
  1532. * Extends mxShape.
  1533. */
  1534. mxUtils.extend(mxLeanBatchedKanban, mxShape);
  1535. /**
  1536. * Function: paintVertexShape
  1537. *
  1538. * Paints the vertex shape.
  1539. */
  1540. mxLeanBatchedKanban.prototype.paintVertexShape = function(c, x, y, w, h)
  1541. {
  1542. w = Math.max(110, w);
  1543. c.translate(x, y);
  1544. c.begin();
  1545. c.moveTo(4, h * 0.5);
  1546. c.lineTo(w, h * 0.5);
  1547. c.stroke();
  1548. c.begin();
  1549. c.moveTo(w * 0.5 - 20, h * 0.5 - 35);
  1550. c.lineTo(w * 0.5 + 25, h * 0.5 - 35);
  1551. c.lineTo(w * 0.5 + 40, h * 0.5 - 20);
  1552. c.lineTo(w * 0.5 + 40, h * 0.5 + 15);
  1553. c.lineTo(w * 0.5 - 20, h * 0.5 + 15);
  1554. c.close();
  1555. c.fillAndStroke();
  1556. c.begin();
  1557. c.moveTo(w * 0.5 - 30, h * 0.5 - 25);
  1558. c.lineTo(w * 0.5 + 15, h * 0.5 - 25);
  1559. c.lineTo(w * 0.5 + 30, h * 0.5 - 10);
  1560. c.lineTo(w * 0.5 + 30, h * 0.5 + 25);
  1561. c.lineTo(w * 0.5 - 30, h * 0.5 + 25);
  1562. c.close();
  1563. c.fillAndStroke();
  1564. c.begin();
  1565. c.moveTo(w * 0.5 - 40, h * 0.5 - 15);
  1566. c.lineTo(w * 0.5 + 5, h * 0.5 - 15);
  1567. c.lineTo(w * 0.5 + 20, h * 0.5);
  1568. c.lineTo(w * 0.5 + 20, h * 0.5 + 35);
  1569. c.lineTo(w * 0.5 - 40, h * 0.5 + 35);
  1570. c.close();
  1571. c.fillAndStroke();
  1572. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1573. c.setFillColor(strokeColor);
  1574. c.begin();
  1575. c.moveTo(w - 10, h * 0.5 - 4);
  1576. c.lineTo(w, h * 0.5);
  1577. c.lineTo(w - 10, h * 0.5 + 4);
  1578. c.close();
  1579. c.fillAndStroke();
  1580. };
  1581. mxCellRenderer.registerShape('mxgraph.lean_mapping.batched_kanban', mxLeanBatchedKanban);
  1582. mxLeanBatchedKanban.prototype.constraints = [
  1583. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  1584. new mxConnectionConstraint(new mxPoint(1, 0.5), true)
  1585. ];
  1586. //**********************************************************************************************************************************************************
  1587. //Control Center
  1588. //**********************************************************************************************************************************************************
  1589. /**
  1590. * Extends mxShape.
  1591. */
  1592. function mxLeanControlCenter(bounds, fill, stroke, strokewidth)
  1593. {
  1594. mxShape.call(this);
  1595. this.bounds = bounds;
  1596. this.fill = fill;
  1597. this.stroke = stroke;
  1598. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1599. };
  1600. /**
  1601. * Extends mxShape.
  1602. */
  1603. mxUtils.extend(mxLeanControlCenter, mxShape);
  1604. /**
  1605. * Function: paintVertexShape
  1606. *
  1607. * Paints the vertex shape.
  1608. */
  1609. mxLeanControlCenter.prototype.paintVertexShape = function(c, x, y, w, h)
  1610. {
  1611. c.translate(x, y);
  1612. c.rect(w * 0.15, 0, w * 0.7, h * 0.8);
  1613. c.fillAndStroke();
  1614. c.rect(0, h * 0.8, w, h * 0.2);
  1615. c.fillAndStroke();
  1616. };
  1617. mxCellRenderer.registerShape('mxgraph.lean_mapping.control_center', mxLeanControlCenter);
  1618. mxLeanControlCenter.prototype.constraints = [
  1619. new mxConnectionConstraint(new mxPoint(0.15, 0), true),
  1620. new mxConnectionConstraint(new mxPoint(0.85, 0), true),
  1621. new mxConnectionConstraint(new mxPoint(0, 1), true),
  1622. new mxConnectionConstraint(new mxPoint(1, 1), true),
  1623. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  1624. new mxConnectionConstraint(new mxPoint(0.15, 0.25), false),
  1625. new mxConnectionConstraint(new mxPoint(0.15, 0.5), false),
  1626. new mxConnectionConstraint(new mxPoint(0, 0.75), true),
  1627. new mxConnectionConstraint(new mxPoint(0.85, 0.25), false),
  1628. new mxConnectionConstraint(new mxPoint(0.85, 0.5), false),
  1629. new mxConnectionConstraint(new mxPoint(1, 0.75), true),
  1630. new mxConnectionConstraint(new mxPoint(0.25, 1), true),
  1631. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  1632. new mxConnectionConstraint(new mxPoint(0.75, 1), true)
  1633. ];
  1634. //**********************************************************************************************************************************************************
  1635. //Electronical Info
  1636. //**********************************************************************************************************************************************************
  1637. function mxLeanElectronicInfoShape()
  1638. {
  1639. mxArrow.call(this);
  1640. };
  1641. mxUtils.extend(mxLeanElectronicInfoShape, mxArrow);
  1642. mxLeanElectronicInfoShape.prototype.paintEdgeShape = function(c, pts)
  1643. {
  1644. // Base vector (between end points)
  1645. var p0 = pts[0];
  1646. var pe = pts[pts.length - 1];
  1647. var dx = pe.x - p0.x;
  1648. var dy = pe.y - p0.y;
  1649. p0.x = p0.x + dx * 0.05;
  1650. p0.y = p0.y + dy * 0.05;
  1651. pe.x = pe.x - dx * 0.05;
  1652. pe.y = pe.y - dy * 0.05;
  1653. dx = pe.x - p0.x;
  1654. dy = pe.y - p0.y;
  1655. var dist = Math.sqrt(dx * dx + dy * dy);
  1656. var nx = dx / dist;
  1657. var ny = dy / dist;
  1658. var midX = p0.x + dx * 0.5;
  1659. var midY = p0.y + dy * 0.5;
  1660. var p1x = midX - nx * dist * 0.1 - ny / 3 * dist * 0.1;
  1661. var p1y = midY - ny * dist * 0.1 + nx / 3 * dist * 0.1;
  1662. var p4x = midX + nx * dist * 0.1 + ny / 3 * dist * 0.1;
  1663. var p4y = midY + ny * dist * 0.1 - nx / 3 * dist * 0.1;
  1664. c.begin();
  1665. c.moveTo(p0.x, p0.y);
  1666. c.lineTo(p4x, p4y);
  1667. c.lineTo(p1x, p1y);
  1668. c.lineTo(pe.x, pe.y);
  1669. c.stroke();
  1670. var dx = pe.x - p1x;
  1671. var dy = pe.y - p1y;
  1672. var dist = Math.sqrt(dx * dx + dy * dy);
  1673. var nx = dx / dist;
  1674. var ny = dy / dist;
  1675. c.setFillColor(mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000'));
  1676. c.begin();
  1677. c.moveTo(pe.x - nx * 10 - ny * 5, pe.y - ny * 10 + nx * 5);
  1678. c.lineTo(pe.x, pe.y);
  1679. c.lineTo(pe.x - nx * 10 + ny * 5, pe.y - ny * 10 - nx * 5);
  1680. c.fillAndStroke();
  1681. };
  1682. // Registers the electronic info shape
  1683. mxCellRenderer.registerShape('mxgraph.lean_mapping.electronic_info_flow_edge', mxLeanElectronicInfoShape);
  1684. //**********************************************************************************************************************************************************
  1685. //Manual Info
  1686. //**********************************************************************************************************************************************************
  1687. function mxLeanManualInfoShape()
  1688. {
  1689. mxArrow.call(this);
  1690. };
  1691. mxUtils.extend(mxLeanManualInfoShape, mxArrow);
  1692. mxLeanManualInfoShape.prototype.paintEdgeShape = function(c, pts)
  1693. {
  1694. // Base vector (between end points)
  1695. var p0 = pts[0];
  1696. var pe = pts[pts.length - 1];
  1697. var dx = pe.x - p0.x;
  1698. var dy = pe.y - p0.y;
  1699. p0.x = p0.x + dx * 0.05;
  1700. p0.y = p0.y + dy * 0.05;
  1701. pe.x = pe.x - dx * 0.05;
  1702. pe.y = pe.y - dy * 0.05;
  1703. dx = pe.x - p0.x;
  1704. dy = pe.y - p0.y;
  1705. var dist = Math.sqrt(dx * dx + dy * dy);
  1706. var nx = dx / dist;
  1707. var ny = dy / dist;
  1708. c.begin();
  1709. c.moveTo(p0.x, p0.y);
  1710. c.lineTo(pe.x, pe.y);
  1711. c.stroke();
  1712. c.setFillColor(mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000'));
  1713. c.begin();
  1714. c.moveTo(pe.x - nx * 10 - ny * 5, pe.y - ny * 10 + nx * 5);
  1715. c.lineTo(pe.x, pe.y);
  1716. c.lineTo(pe.x - nx * 10 + ny * 5, pe.y - ny * 10 - nx * 5);
  1717. c.fillAndStroke();
  1718. };
  1719. //Registers the electronic info shape
  1720. mxCellRenderer.registerShape('mxgraph.lean_mapping.manual_info_flow_edge', mxLeanManualInfoShape);
  1721. //**********************************************************************************************************************************************************
  1722. //Timeline
  1723. //**********************************************************************************************************************************************************
  1724. /**
  1725. * Extends mxShape.
  1726. */
  1727. function mxShapeLeanTimeline(bounds, fill, stroke, strokewidth)
  1728. {
  1729. mxShape.call(this);
  1730. this.bounds = bounds;
  1731. this.fill = fill;
  1732. this.stroke = stroke;
  1733. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1734. };
  1735. /**
  1736. * Extends mxShape.
  1737. */
  1738. mxUtils.extend(mxShapeLeanTimeline, mxShape);
  1739. mxShapeLeanTimeline.prototype.cst = {
  1740. SHAPE_TIMELINE : 'mxgraph.lean_mapping.timeline2'
  1741. };
  1742. /**
  1743. * Function: paintVertexShape
  1744. *
  1745. * Paints the vertex shape.
  1746. */
  1747. mxShapeLeanTimeline.prototype.paintVertexShape = function(c, x, y, w, h)
  1748. {
  1749. c.translate(x, y);
  1750. var dy1 = mxUtils.getValue(this.style, 'dy1', '0');
  1751. var dx2 = mxUtils.getValue(this.style, 'dx2', '0');
  1752. var dy2 = mxUtils.getValue(this.style, 'dy2', '0');
  1753. var dx3 = mxUtils.getValue(this.style, 'dx3', '0');
  1754. var dy3 = mxUtils.getValue(this.style, 'dy3', '0');
  1755. var dx4 = mxUtils.getValue(this.style, 'dx4', '0');
  1756. var dy4 = mxUtils.getValue(this.style, 'dy4', '0');
  1757. var dx5 = mxUtils.getValue(this.style, 'dx5', '0');
  1758. var dy5 = mxUtils.getValue(this.style, 'dy5', '0');
  1759. var dy6 = mxUtils.getValue(this.style, 'dy6', '0');
  1760. var lastUp = true;
  1761. c.begin();
  1762. if (dy1 <= 0.5)
  1763. {
  1764. c.moveTo(0, 0);
  1765. lastUp = true;
  1766. }
  1767. else
  1768. {
  1769. c.moveTo(0, h);
  1770. lastUp = false;
  1771. }
  1772. //2
  1773. if (dy2 <= 0.5 && lastUp)
  1774. {
  1775. c.lineTo(dx2, 0);
  1776. lastUp = true;
  1777. }
  1778. else if (dy2 > 0.5 && !lastUp)
  1779. {
  1780. c.lineTo(dx2, h);
  1781. lastUp = false;
  1782. }
  1783. else if (dy2 <= 0.5 && !lastUp)
  1784. {
  1785. c.lineTo(dx2, h);
  1786. c.lineTo(dx2, 0);
  1787. lastUp = true;
  1788. }
  1789. else
  1790. {
  1791. c.lineTo(dx2, 0);
  1792. c.lineTo(dx2, h);
  1793. lastUp = false;
  1794. }
  1795. //3
  1796. if (dy3 <= 0.5 && lastUp)
  1797. {
  1798. c.lineTo(dx3, 0);
  1799. lastUp = true;
  1800. }
  1801. else if (dy3 > 0.5 && !lastUp)
  1802. {
  1803. c.lineTo(dx3, h);
  1804. lastUp = false;
  1805. }
  1806. else if (dy3 <= 0.5 && !lastUp)
  1807. {
  1808. c.lineTo(dx3, h);
  1809. c.lineTo(dx3, 0);
  1810. lastUp = true;
  1811. }
  1812. else
  1813. {
  1814. c.lineTo(dx3, 0);
  1815. c.lineTo(dx3, h);
  1816. lastUp = false;
  1817. }
  1818. //4
  1819. if (dy4 <= 0.5 && lastUp)
  1820. {
  1821. c.lineTo(dx4, 0);
  1822. lastUp = true;
  1823. }
  1824. else if (dy4 > 0.5 && !lastUp)
  1825. {
  1826. c.lineTo(dx4, h);
  1827. lastUp = false;
  1828. }
  1829. else if (dy4 <= 0.5 && !lastUp)
  1830. {
  1831. c.lineTo(dx4, h);
  1832. c.lineTo(dx4, 0);
  1833. lastUp = true;
  1834. }
  1835. else
  1836. {
  1837. c.lineTo(dx4, 0);
  1838. c.lineTo(dx4, h);
  1839. lastUp = false;
  1840. }
  1841. //5
  1842. if (dy5 <= 0.5 && lastUp)
  1843. {
  1844. c.lineTo(dx5, 0);
  1845. lastUp = true;
  1846. }
  1847. else if (dy5 > 0.5 && !lastUp)
  1848. {
  1849. c.lineTo(dx5, h);
  1850. lastUp = false;
  1851. }
  1852. else if (dy5 <= 0.5 && !lastUp)
  1853. {
  1854. c.lineTo(dx5, h);
  1855. c.lineTo(dx5, 0);
  1856. lastUp = true;
  1857. }
  1858. else
  1859. {
  1860. c.lineTo(dx5, 0);
  1861. c.lineTo(dx5, h);
  1862. lastUp = false;
  1863. }
  1864. //6
  1865. if (dy6 <= 0.5 && lastUp)
  1866. {
  1867. c.lineTo(w, 0);
  1868. lastUp = true;
  1869. }
  1870. else if (dy6 > 0.5 && !lastUp)
  1871. {
  1872. c.lineTo(w, h);
  1873. lastUp = false;
  1874. }
  1875. else if (dy6 <= 0.5 && !lastUp)
  1876. {
  1877. c.lineTo(w, h);
  1878. c.lineTo(w, 0);
  1879. lastUp = true;
  1880. }
  1881. else
  1882. {
  1883. c.lineTo(w, 0);
  1884. c.lineTo(w, h);
  1885. lastUp = false;
  1886. }
  1887. //end
  1888. c.stroke();
  1889. };
  1890. mxCellRenderer.registerShape(mxShapeLeanTimeline.prototype.cst.SHAPE_TIMELINE, mxShapeLeanTimeline);
  1891. Graph.handleFactory[mxShapeLeanTimeline.prototype.cst.SHAPE_TIMELINE] = function(state)
  1892. {
  1893. var handles = [Graph.createHandle(state, ['dy1'], function(bounds)
  1894. {
  1895. var dy1 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy1', 0))));
  1896. return new mxPoint(bounds.x, bounds.y + dy1 * bounds.height);
  1897. }, function(bounds, pt)
  1898. {
  1899. this.state.style['dy1'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1900. })];
  1901. var handle2 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds)
  1902. {
  1903. var dx2 = Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dx3', 0)), parseFloat(mxUtils.getValue(this.state.style, 'dx2', 0))));
  1904. var dy2 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy2', 0))));
  1905. return new mxPoint(bounds.x + dx2, bounds.y + dy2 * bounds.height);
  1906. }, function(bounds, pt)
  1907. {
  1908. 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;
  1909. this.state.style['dy2'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1910. });
  1911. handles.push(handle2);
  1912. var handle3 = Graph.createHandle(state, ['dx3', 'dy3'], function(bounds)
  1913. {
  1914. 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))));
  1915. var dy3 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy3', 0))));
  1916. return new mxPoint(bounds.x + dx3, bounds.y + dy3 * bounds.height);
  1917. }, function(bounds, pt)
  1918. {
  1919. 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;
  1920. this.state.style['dy3'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1921. });
  1922. handles.push(handle3);
  1923. var handle4 = Graph.createHandle(state, ['dx4', 'dy4'], function(bounds)
  1924. {
  1925. 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))));
  1926. var dy4 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy4', 0))));
  1927. return new mxPoint(bounds.x + dx4, bounds.y + dy4 * bounds.height);
  1928. }, function(bounds, pt)
  1929. {
  1930. 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;
  1931. this.state.style['dy4'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1932. });
  1933. handles.push(handle4);
  1934. var handle5 = Graph.createHandle(state, ['dx5', 'dy5'], function(bounds)
  1935. {
  1936. var dx5 = Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx4', 0)), Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx5', 0))));
  1937. var dy5 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy5', 0))));
  1938. return new mxPoint(bounds.x + dx5, bounds.y + dy5 * bounds.height);
  1939. }, function(bounds, pt)
  1940. {
  1941. 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;
  1942. this.state.style['dy5'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1943. });
  1944. handles.push(handle5);
  1945. var handle6 = Graph.createHandle(state, ['dy6'], function(bounds)
  1946. {
  1947. var dy6 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy6', 0))));
  1948. return new mxPoint(bounds.x + bounds.width, bounds.y + dy6 * bounds.height);
  1949. }, function(bounds, pt)
  1950. {
  1951. this.state.style['dy6'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;
  1952. });
  1953. handles.push(handle6);
  1954. return handles;
  1955. };