mxLeanMap.js 78 KB

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