1/**2 * Copyright (c) 2006-2013, JGraph Holdings Ltd3 */45//**********************************************************************************************************************************************************6//Boat Shipment7//**********************************************************************************************************************************************************8/**9 * Extends mxShape.10 */11function 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};1920/**21 * Extends mxShape.22 */23mxUtils.extend(mxLeanBoatShipment, mxShape);2425/**26 * Function: paintVertexShape27 * 28 * Paints the vertex shape.29 */30mxLeanBoatShipment.prototype.paintVertexShape = function(c, x, y, w, h)31{32 c.translate(x, y);33 c.begin();34 c.moveTo(w * 0.15, h * 0.77);35 c.lineTo(w * 0.5, 0);36 c.lineTo(w * 0.85, h * 0.77);37 c.close();38 c.moveTo(w * 0.2, h);39 c.lineTo(0, h * 0.8);40 c.lineTo(w, h * 0.8);41 c.lineTo(w * 0.8, h);42 c.close();43 c.fillAndStroke();44};4546mxCellRenderer.registerShape('mxgraph.lean_mapping.boat_shipment', mxLeanBoatShipment);4748mxLeanBoatShipment.prototype.constraints = [49 new mxConnectionConstraint(new mxPoint(0.5, 0), false),50 new mxConnectionConstraint(new mxPoint(0.5, 1), false),51 new mxConnectionConstraint(new mxPoint(0, 0.8), false),52 new mxConnectionConstraint(new mxPoint(1, 0.8), false),53 new mxConnectionConstraint(new mxPoint(0.2, 1), false),54 new mxConnectionConstraint(new mxPoint(0.8, 1), false),55 new mxConnectionConstraint(new mxPoint(0.26, 0.5), false),56 new mxConnectionConstraint(new mxPoint(0.74, 0.5), false)57 ];5859//**********************************************************************************************************************************************************60//Safety Stock61//**********************************************************************************************************************************************************62/**63 * Extends mxShape.64 */65function mxLeanSafetyStock(bounds, fill, stroke, strokewidth)66{67 mxShape.call(this);68 this.bounds = bounds;69 this.fill = fill;70 this.stroke = stroke;71 this.strokewidth = (strokewidth != null) ? strokewidth : 1;72};7374/**75 * Extends mxShape.76 */77mxUtils.extend(mxLeanSafetyStock, mxShape);7879/**80 * Function: paintVertexShape81 * 82 * Paints the vertex shape.83 */84mxLeanSafetyStock.prototype.paintVertexShape = function(c, x, y, w, h)85{86 c.translate(x, y);8788 this.background(c, w, h);89 c.setShadow(false);90 this.foreground(c, w, h);91};9293mxLeanSafetyStock.prototype.background = function(c, w, h)94{95 c.rect(0, 0, w, h);96 c.fillAndStroke();97};9899mxLeanSafetyStock.prototype.foreground = function(c, w, h)100{101 c.begin();102 c.moveTo(0, h * 0.34);103 c.lineTo(w, h * 0.34);104 c.moveTo(0, h * 0.66);105 c.lineTo(w, h * 0.66);106 c.fillAndStroke();107};108109mxCellRenderer.registerShape('mxgraph.lean_mapping.buffer_or_safety_stock', mxLeanSafetyStock);110111mxLeanSafetyStock.prototype.constraints = [112 new mxConnectionConstraint(new mxPoint(0, 0), true),113 new mxConnectionConstraint(new mxPoint(1, 0), true),114 new mxConnectionConstraint(new mxPoint(0, 1), true),115 new mxConnectionConstraint(new mxPoint(1, 1), true),116 new mxConnectionConstraint(new mxPoint(0.25, 0), true),117 new mxConnectionConstraint(new mxPoint(0.5, 0), true),118 new mxConnectionConstraint(new mxPoint(0.75, 0), true),119 new mxConnectionConstraint(new mxPoint(0, 0.25), true),120 new mxConnectionConstraint(new mxPoint(0, 0.5), true),121 new mxConnectionConstraint(new mxPoint(0, 0.75), true),122 new mxConnectionConstraint(new mxPoint(1, 0.25), true),123 new mxConnectionConstraint(new mxPoint(1, 0.5), true),124 new mxConnectionConstraint(new mxPoint(1, 0.75), true),125 new mxConnectionConstraint(new mxPoint(0.25, 1), true),126 new mxConnectionConstraint(new mxPoint(0.5, 1), true),127 new mxConnectionConstraint(new mxPoint(0.75, 1), true)128 ];129130//**********************************************************************************************************************************************************131//Data Box132//**********************************************************************************************************************************************************133/**134 * Extends mxShape.135 */136function mxLeanDataBox(bounds, fill, stroke, strokewidth)137{138 mxShape.call(this);139 this.bounds = bounds;140 this.fill = fill;141 this.stroke = stroke;142 this.strokewidth = (strokewidth != null) ? strokewidth : 1;143};144145/**146 * Extends mxShape.147 */148mxUtils.extend(mxLeanDataBox, mxShape);149150/**151 * Function: paintVertexShape152 * 153 * Paints the vertex shape.154 */155mxLeanDataBox.prototype.paintVertexShape = function(c, x, y, w, h)156{157 c.translate(x, y);158159 this.background(c, w, h);160 c.setShadow(false);161 this.foreground(c, w, h);162};163164mxLeanDataBox.prototype.background = function(c, w, h)165{166 c.begin();167 c.moveTo(0, h);168 c.lineTo(0, 0);169 c.lineTo(w, 0);170 c.lineTo(w, h);171 c.fillAndStroke();172};173174mxLeanDataBox.prototype.foreground = function(c, w, h)175{176 c.begin();177 c.moveTo(0, h * 0.2);178 c.lineTo(w, h * 0.2);179 c.moveTo(0, h * 0.4);180 c.lineTo(w, h * 0.4);181 c.moveTo(0, h * 0.6);182 c.lineTo(w, h * 0.6);183 c.moveTo(0, h * 0.8);184 c.lineTo(w, h * 0.8);185 c.stroke();186};187188mxCellRenderer.registerShape('mxgraph.lean_mapping.data_box', mxLeanDataBox);189190mxLeanDataBox.prototype.constraints = [191 new mxConnectionConstraint(new mxPoint(0, 0), true),192 new mxConnectionConstraint(new mxPoint(1, 0), true),193 new mxConnectionConstraint(new mxPoint(0, 1), true),194 new mxConnectionConstraint(new mxPoint(1, 1), true),195 new mxConnectionConstraint(new mxPoint(0.25, 0), true),196 new mxConnectionConstraint(new mxPoint(0.5, 0), true),197 new mxConnectionConstraint(new mxPoint(0.75, 0), true),198 new mxConnectionConstraint(new mxPoint(0, 0.25), true),199 new mxConnectionConstraint(new mxPoint(0, 0.5), true),200 new mxConnectionConstraint(new mxPoint(0, 0.75), true),201 new mxConnectionConstraint(new mxPoint(1, 0.25), true),202 new mxConnectionConstraint(new mxPoint(1, 0.5), true),203 new mxConnectionConstraint(new mxPoint(1, 0.75), true),204 new mxConnectionConstraint(new mxPoint(0.25, 1), true),205 new mxConnectionConstraint(new mxPoint(0.5, 1), true),206 new mxConnectionConstraint(new mxPoint(0.75, 1), true)207 ];208209//**********************************************************************************************************************************************************210//Customer / Supplier211//**********************************************************************************************************************************************************212/**213 * Extends mxShape.214 */215function mxLeanCustomerSupplier(bounds, fill, stroke, strokewidth)216{217 mxShape.call(this);218 this.bounds = bounds;219 this.fill = fill;220 this.stroke = stroke;221 this.strokewidth = (strokewidth != null) ? strokewidth : 1;222};223224/**225 * Extends mxShape.226 */227mxUtils.extend(mxLeanCustomerSupplier, mxShape);228229/**230 * Function: paintVertexShape231 * 232 * Paints the vertex shape.233 */234mxLeanCustomerSupplier.prototype.paintVertexShape = function(c, x, y, w, h)235{236 c.translate(x, y);237238 this.background(c, w, h);239 c.setShadow(false);240};241242mxLeanCustomerSupplier.prototype.background = function(c, w, h)243{244 c.begin();245 c.moveTo(0, h);246 c.lineTo(0, h * 0.3);247 c.lineTo(w * 0.33, h * 0.02);248 c.lineTo(w * 0.33, h * 0.3);249 c.lineTo(w * 0.67, h * 0.02);250 c.lineTo(w * 0.67, h * 0.3);251 c.lineTo(w, h * 0.02);252 c.lineTo(w, h);253 c.close();254 c.fillAndStroke();255};256257mxCellRenderer.registerShape('mxgraph.lean_mapping.outside_sources', mxLeanCustomerSupplier);258259mxLeanCustomerSupplier.prototype.constraints = [260 new mxConnectionConstraint(new mxPoint(1, 0), true),261 new mxConnectionConstraint(new mxPoint(0, 1), true),262 new mxConnectionConstraint(new mxPoint(1, 1), true),263 new mxConnectionConstraint(new mxPoint(0.33, 0), true),264 new mxConnectionConstraint(new mxPoint(0.67, 0), true),265 new mxConnectionConstraint(new mxPoint(0, 0.3), true),266 new mxConnectionConstraint(new mxPoint(0, 0.5), true),267 new mxConnectionConstraint(new mxPoint(0, 0.75), true),268 new mxConnectionConstraint(new mxPoint(1, 0.25), true),269 new mxConnectionConstraint(new mxPoint(1, 0.5), true),270 new mxConnectionConstraint(new mxPoint(1, 0.75), true),271 new mxConnectionConstraint(new mxPoint(0.25, 1), true),272 new mxConnectionConstraint(new mxPoint(0.5, 1), true),273 new mxConnectionConstraint(new mxPoint(0.75, 1), true)274 ];275276//**********************************************************************************************************************************************************277//Dedicated Process278//**********************************************************************************************************************************************************279/**280 * Extends mxShape.281 */282function mxLeanDedicatedProcess(bounds, fill, stroke, strokewidth)283{284 mxShape.call(this);285 this.bounds = bounds;286 this.fill = fill;287 this.stroke = stroke;288 this.strokewidth = (strokewidth != null) ? strokewidth : 1;289};290291/**292 * Extends mxShape.293 */294mxUtils.extend(mxLeanDedicatedProcess, mxShape);295296/**297 * Function: paintVertexShape298 * 299 * Paints the vertex shape.300 */301mxLeanDedicatedProcess.prototype.paintVertexShape = function(c, x, y, w, h)302{303 c.translate(x, y);304 var fontSize = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8'));305306 this.background(c, w, h);307 c.setShadow(false);308 this.foreground(c, w, h, fontSize);309};310311mxLeanDedicatedProcess.prototype.background = function(c, w, h)312{313 c.rect(0, 0, w, h);314 c.fillAndStroke();315};316317mxLeanDedicatedProcess.prototype.foreground = function(c, w, h, fontSize)318{319 var lineH = Math.min(fontSize * 1.5, h);320 c.begin();321 c.moveTo(0, lineH);322 c.lineTo(w, lineH);323 c.stroke();324};325326mxCellRenderer.registerShape('mxgraph.lean_mapping.manufacturing_process', mxLeanDedicatedProcess);327328mxLeanDedicatedProcess.prototype.constraints = [329 new mxConnectionConstraint(new mxPoint(0, 0), true),330 new mxConnectionConstraint(new mxPoint(1, 0), true),331 new mxConnectionConstraint(new mxPoint(0, 1), true),332 new mxConnectionConstraint(new mxPoint(1, 1), true),333 new mxConnectionConstraint(new mxPoint(0.25, 0), true),334 new mxConnectionConstraint(new mxPoint(0.5, 0), true),335 new mxConnectionConstraint(new mxPoint(0.75, 0), true),336 new mxConnectionConstraint(new mxPoint(0, 0.25), true),337 new mxConnectionConstraint(new mxPoint(0, 0.5), true),338 new mxConnectionConstraint(new mxPoint(0, 0.75), true),339 new mxConnectionConstraint(new mxPoint(1, 0.25), true),340 new mxConnectionConstraint(new mxPoint(1, 0.5), true),341 new mxConnectionConstraint(new mxPoint(1, 0.75), true),342 new mxConnectionConstraint(new mxPoint(0.25, 1), true),343 new mxConnectionConstraint(new mxPoint(0.5, 1), true),344 new mxConnectionConstraint(new mxPoint(0.75, 1), true)345 ];346347//**********************************************************************************************************************************************************348//Shared Process349//**********************************************************************************************************************************************************350/**351 * Extends mxShape.352 */353function mxLeanSharedProcess(bounds, fill, stroke, strokewidth)354{355 mxShape.call(this);356 this.bounds = bounds;357 this.fill = fill;358 this.stroke = stroke;359 this.strokewidth = (strokewidth != null) ? strokewidth : 1;360};361362/**363 * Extends mxShape.364 */365mxUtils.extend(mxLeanSharedProcess, mxShape);366367/**368 * Function: paintVertexShape369 * 370 * Paints the vertex shape.371 */372mxLeanSharedProcess.prototype.paintVertexShape = function(c, x, y, w, h)373{374 c.translate(x, y);375 var fontSize = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8'));376377 this.background(c, w, h);378 c.setShadow(false);379 this.foreground(c, w, h, fontSize);380};381382mxLeanSharedProcess.prototype.background = function(c, w, h)383{384 c.rect(0, 0, w, h);385 c.fillAndStroke();386};387388mxLeanSharedProcess.prototype.foreground = function(c, w, h, fontSize)389{390 var lineH = Math.min(fontSize * 1.5, h);391 c.begin();392 c.moveTo(0, lineH);393 c.lineTo(w, lineH);394 c.stroke();395396 var start = 0;397 var i = 0;398 var s = 10;399 var offset = 0;400 c.begin();401 var strokeWidth = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, '2'));402 c.setStrokeWidth(strokeWidth * 0.5);403404 while (start < h + w)405 {406 start = start + s;407 if (start > lineH)408 {409 var startX = Math.max(0, start - h); 410 var startY = Math.min(start, h); 411412 var endX = Math.min(start - lineH, w);413414 var endY = lineH;415 var endY = Math.max(start - w, lineH);416 417 if (startX < w)418 {419 c.moveTo(startX, startY);420 c.lineTo(endX, endY);421 }422 }423 };424425 c.stroke();426};427428mxCellRenderer.registerShape('mxgraph.lean_mapping.manufacturing_process_shared', mxLeanSharedProcess);429430mxLeanSharedProcess.prototype.constraints = [431 new mxConnectionConstraint(new mxPoint(0, 0), true),432 new mxConnectionConstraint(new mxPoint(1, 0), true),433 new mxConnectionConstraint(new mxPoint(0, 1), true),434 new mxConnectionConstraint(new mxPoint(1, 1), true),435 new mxConnectionConstraint(new mxPoint(0.25, 0), true),436 new mxConnectionConstraint(new mxPoint(0.5, 0), true),437 new mxConnectionConstraint(new mxPoint(0.75, 0), true),438 new mxConnectionConstraint(new mxPoint(0, 0.25), true),439 new mxConnectionConstraint(new mxPoint(0, 0.5), true),440 new mxConnectionConstraint(new mxPoint(0, 0.75), true),441 new mxConnectionConstraint(new mxPoint(1, 0.25), true),442 new mxConnectionConstraint(new mxPoint(1, 0.5), true),443 new mxConnectionConstraint(new mxPoint(1, 0.75), true),444 new mxConnectionConstraint(new mxPoint(0.25, 1), true),445 new mxConnectionConstraint(new mxPoint(0.5, 1), true),446 new mxConnectionConstraint(new mxPoint(0.75, 1), true)447 ];448449//**********************************************************************************************************************************************************450// Workcell451//**********************************************************************************************************************************************************452/**453* Extends mxShape.454*/455function mxLeanWorkcell(bounds, fill, stroke, strokewidth)456{457 mxShape.call(this);458 this.bounds = bounds;459 this.fill = fill;460 this.stroke = stroke;461 this.strokewidth = (strokewidth != null) ? strokewidth : 1;462};463464/**465* Extends mxShape.466*/467mxUtils.extend(mxLeanWorkcell, mxShape);468469/**470* Function: paintVertexShape471* 472* Paints the vertex shape.473*/474mxLeanWorkcell.prototype.paintVertexShape = function(c, x, y, w, h)475{476 c.translate(x, y);477 478 c.begin();479 c.moveTo(0, 0);480 c.lineTo(w, 0);481 c.lineTo(w, h);482 c.lineTo(w * 0.65, h);483 c.lineTo(w * 0.65, h * 0.4);484 c.lineTo(w * 0.35, h * 0.4);485 c.lineTo(w * 0.35, h);486 c.lineTo(0, h);487 c.close();488 c.fillAndStroke();489};490491mxCellRenderer.registerShape('mxgraph.lean_mapping.work_cell', mxLeanWorkcell);492493mxLeanWorkcell.prototype.constraints = [494 new mxConnectionConstraint(new mxPoint(0, 0), true),495 new mxConnectionConstraint(new mxPoint(1, 0), true),496 new mxConnectionConstraint(new mxPoint(0, 1), true),497 new mxConnectionConstraint(new mxPoint(1, 1), true),498 new mxConnectionConstraint(new mxPoint(0.25, 0), true),499 new mxConnectionConstraint(new mxPoint(0.5, 0), true),500 new mxConnectionConstraint(new mxPoint(0.75, 0), true),501 new mxConnectionConstraint(new mxPoint(0, 0.25), true),502 new mxConnectionConstraint(new mxPoint(0, 0.5), true),503 new mxConnectionConstraint(new mxPoint(0, 0.75), true),504 new mxConnectionConstraint(new mxPoint(1, 0.25), true),505 new mxConnectionConstraint(new mxPoint(1, 0.5), true),506 new mxConnectionConstraint(new mxPoint(1, 0.75), true),507 new mxConnectionConstraint(new mxPoint(0.25, 1), true),508 new mxConnectionConstraint(new mxPoint(0.75, 1), true)509 ];510511//**********************************************************************************************************************************************************512//Inventory Box513//**********************************************************************************************************************************************************514/**515* Extends mxShape.516*/517function mxLeanInventoryBox(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};525526/**527* Extends mxShape.528*/529mxUtils.extend(mxLeanInventoryBox, mxShape);530531/**532* Function: paintVertexShape533* 534* Paints the vertex shape.535*/536mxLeanInventoryBox.prototype.paintVertexShape = function(c, x, y, w, h)537{538 c.translate(x, y);539540 c.begin();541 c.moveTo(0, h);542 c.lineTo(w * 0.5, 0);543 c.lineTo(w, h);544 c.close();545 c.fillAndStroke();546 c.setShadow(false);547 c.begin();548 c.moveTo(w * 0.4, h * 0.45);549 c.lineTo(w * 0.6, h * 0.45);550 c.moveTo(w * 0.5, h * 0.45);551 c.lineTo(w * 0.5, h * 0.85);552 c.moveTo(w * 0.4, h * 0.85);553 c.lineTo(w * 0.6, h * 0.85);554 c.stroke();555};556557mxCellRenderer.registerShape('mxgraph.lean_mapping.inventory_box', mxLeanInventoryBox);558559mxLeanInventoryBox.prototype.constraints = [560 new mxConnectionConstraint(new mxPoint(0, 1), true),561 new mxConnectionConstraint(new mxPoint(1, 1), true),562 new mxConnectionConstraint(new mxPoint(0.5, 0), true),563 new mxConnectionConstraint(new mxPoint(0.375, 0.25), false),564 new mxConnectionConstraint(new mxPoint(0.25, 0.5), false),565 new mxConnectionConstraint(new mxPoint(0.125, 0.75), false),566 new mxConnectionConstraint(new mxPoint(0.625, 0.25), false),567 new mxConnectionConstraint(new mxPoint(0.75, 0.5), false),568 new mxConnectionConstraint(new mxPoint(0.875, 0.75), false),569 new mxConnectionConstraint(new mxPoint(0.25, 1), true),570 new mxConnectionConstraint(new mxPoint(0.5, 1), true),571 new mxConnectionConstraint(new mxPoint(0.75, 1), true)572 ];573574//**********************************************************************************************************************************************************575//Push Arrow576//**********************************************************************************************************************************************************577/**578* Extends mxShape.579*/580function mxLeanPushArrow(bounds, fill, stroke, strokewidth)581{582 mxShape.call(this);583 this.bounds = bounds;584 this.fill = fill;585 this.stroke = stroke;586 this.strokewidth = (strokewidth != null) ? strokewidth : 1;587};588589/**590* Extends mxShape.591*/592mxUtils.extend(mxLeanPushArrow, mxShape);593594/**595* Function: paintVertexShape596* 597* Paints the vertex shape.598*/599mxLeanPushArrow.prototype.paintVertexShape = function(c, x, y, w, h)600{601 c.translate(x, y);602 this.background(c, w, h);603 c.setShadow(false);604 this.foreground(c, w, h);605};606607mxLeanPushArrow.prototype.background = function(c, w, h)608{609 c.begin();610 c.moveTo(0, h * 0.17);611 c.lineTo(w * 0.75, h * 0.17);612 c.lineTo(w * 0.75, 0);613 c.lineTo(w, h * 0.5);614 c.lineTo(w * 0.75, h);615 c.lineTo(w * 0.75, h * 0.83);616 c.lineTo(0, h * 0.83);617 c.close();618 c.fillAndStroke();619};620621mxLeanPushArrow.prototype.foreground = function(c, w, h, fontSize)622{623 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');624 c.setFillColor(strokeColor);625 c.rect(0, h * 0.17, w * 0.12, h * 0.66);626 c.fill();627 c.rect(w * 0.24, h * 0.17, w * 0.12, h * 0.66);628 c.fill();629 c.rect(w * 0.48, h * 0.17, w * 0.12, h * 0.66);630 c.fill();631 632 c.begin();633 c.moveTo(w * 0.72, h * 0.17);634 c.lineTo(w * 0.75, h * 0.17);635 c.lineTo(w * 0.75, 0);636 c.lineTo(w, h * 0.5);637 c.lineTo(w * 0.75, h);638 c.lineTo(w * 0.75, h * 0.83);639 c.lineTo(w * 0.72, h * 0.83);640 c.close();641 c.fill();642};643644mxCellRenderer.registerShape('mxgraph.lean_mapping.push_arrow', mxLeanPushArrow);645646mxLeanPushArrow.prototype.constraints = [647 new mxConnectionConstraint(new mxPoint(0.25, 0.17), false),648 new mxConnectionConstraint(new mxPoint(0.5, 0.17), false),649 new mxConnectionConstraint(new mxPoint(0.75, 0), true),650 new mxConnectionConstraint(new mxPoint(0, 0.17), true),651 new mxConnectionConstraint(new mxPoint(0, 0.5), true),652 new mxConnectionConstraint(new mxPoint(0, 0.83), true),653 new mxConnectionConstraint(new mxPoint(1, 0.5), true),654 new mxConnectionConstraint(new mxPoint(0.25, 0.83), false),655 new mxConnectionConstraint(new mxPoint(0.5, 0.83), false),656 new mxConnectionConstraint(new mxPoint(0.75, 1), true)657 ];658659//**********************************************************************************************************************************************************660//Supermarket661//**********************************************************************************************************************************************************662/**663* Extends mxShape.664*/665function mxLeanSupermarket(bounds, fill, stroke, strokewidth)666{667 mxShape.call(this);668 this.bounds = bounds;669 this.fill = fill;670 this.stroke = stroke;671 this.strokewidth = (strokewidth != null) ? strokewidth : 1;672};673674/**675* Extends mxShape.676*/677mxUtils.extend(mxLeanSupermarket, mxShape);678679/**680* Function: paintVertexShape681* 682* Paints the vertex shape.683*/684mxLeanSupermarket.prototype.paintVertexShape = function(c, x, y, w, h)685{686 c.translate(x, y);687 688 c.begin();689 c.moveTo(0, 0);690 c.lineTo(w, 0);691 c.lineTo(w, h);692 c.lineTo(0, h);693 c.moveTo(0, h * 0.33);694 c.lineTo(w, h * 0.33);695 c.moveTo(0, h * 0.67);696 c.lineTo(w, h * 0.67);697 c.fillAndStroke();698};699700mxCellRenderer.registerShape('mxgraph.lean_mapping.supermarket', mxLeanSupermarket);701702mxLeanSupermarket.prototype.constraints = [703 new mxConnectionConstraint(new mxPoint(0, 0), true),704 new mxConnectionConstraint(new mxPoint(1, 0), true),705 new mxConnectionConstraint(new mxPoint(0, 1), true),706 new mxConnectionConstraint(new mxPoint(1, 1), true),707 new mxConnectionConstraint(new mxPoint(0.25, 0), true),708 new mxConnectionConstraint(new mxPoint(0.5, 0), true),709 new mxConnectionConstraint(new mxPoint(0.75, 0), true),710 new mxConnectionConstraint(new mxPoint(0, 0.25), true),711 new mxConnectionConstraint(new mxPoint(0, 0.5), true),712 new mxConnectionConstraint(new mxPoint(0, 0.75), true),713 new mxConnectionConstraint(new mxPoint(1, 0.25), true),714 new mxConnectionConstraint(new mxPoint(1, 0.5), true),715 new mxConnectionConstraint(new mxPoint(1, 0.75), true),716 new mxConnectionConstraint(new mxPoint(0.25, 1), true),717 new mxConnectionConstraint(new mxPoint(0.5, 1), true),718 new mxConnectionConstraint(new mxPoint(0.75, 1), true)719 ];720721//**********************************************************************************************************************************************************722//Material Pull723//**********************************************************************************************************************************************************724/**725* Extends mxShape.726*/727function mxLeanMaterialPull(bounds, fill, stroke, strokewidth)728{729 mxShape.call(this);730 this.bounds = bounds;731 this.fill = fill;732 this.stroke = stroke;733 this.strokewidth = (strokewidth != null) ? strokewidth : 1;734};735736/**737* Extends mxShape.738*/739mxUtils.extend(mxLeanMaterialPull, mxShape);740741/**742* Function: paintVertexShape743* 744* Paints the vertex shape.745*/746mxLeanMaterialPull.prototype.paintVertexShape = function(c, x, y, w, h)747{748 c.translate(x, y);749 750 c.begin();751 c.moveTo(w * 0.732, h * 0.0736);752 c.arcTo(w * 0.4827, h * 0.4959, 0, 1, 0, w * 0.9553, h * 0.6191);753 c.stroke();754 755 c.begin();756 c.moveTo(w * 0.9071, h * 0.6191);757 c.lineTo(w * 0.9794, h * 0.4951);758 c.lineTo(w, h * 0.6438);759 c.close();760 c.fillAndStroke();761};762763mxCellRenderer.registerShape('mxgraph.lean_mapping.physical_pull', mxLeanMaterialPull);764765mxLeanMaterialPull.prototype.constraints = [766 new mxConnectionConstraint(new mxPoint(0.5, 0), true),767 new mxConnectionConstraint(new mxPoint(0.5, 1), true),768 new mxConnectionConstraint(new mxPoint(0, 0.5), true),769 new mxConnectionConstraint(new mxPoint(0.98, 0.5), true),770 new mxConnectionConstraint(new mxPoint(0.144, 0.144), false),771 new mxConnectionConstraint(new mxPoint(0.144, 0.845), false),772 new mxConnectionConstraint(new mxPoint(0.845, 0.845), false)773 ];774775//**********************************************************************************************************************************************************776//FIFO Lane777//**********************************************************************************************************************************************************778/**779* Extends mxShape.780*/781function mxLeanFifoLane(bounds, fill, stroke, strokewidth)782{783 mxShape.call(this);784 this.bounds = bounds;785 this.fill = fill;786 this.stroke = stroke;787 this.strokewidth = (strokewidth != null) ? strokewidth : 1;788};789790/**791* Extends mxShape.792*/793mxUtils.extend(mxLeanFifoLane, mxShape);794795/**796* Function: paintVertexShape797* 798* Paints the vertex shape.799*/800mxLeanFifoLane.prototype.paintVertexShape = function(c, x, y, w, h)801{802 c.translate(x, y);803 var fontSize = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8'));804805 this.background(c, w, h, fontSize);806 c.setShadow(false);807};808809mxLeanFifoLane.prototype.background = function(c, w, h, fontSize)810{811 var lineH = Math.min(fontSize * 1.5, h);812 c.begin();813 c.moveTo(0, lineH);814 c.lineTo(w, lineH);815 c.moveTo(0, h);816 c.lineTo(w, h);817 c.stroke();818819 c.rect(w * 0.02, lineH + 4, w * 0.26, h - lineH - 8);820 c.fillAndStroke();821 822 c.ellipse(w * 0.35, lineH + 4, w * 0.26, h - lineH - 8);823 c.fillAndStroke();824 825 c.begin();826 c.moveTo(w * 0.69, lineH + 4);827 c.lineTo(w * 0.98, lineH + 4);828 c.lineTo(w * 0.835, h - 4);829 c.close();830 c.fillAndStroke();831};832833mxCellRenderer.registerShape('mxgraph.lean_mapping.fifo_lane', mxLeanFifoLane);834835mxLeanFifoLane.prototype.constraints = [836 new mxConnectionConstraint(new mxPoint(0, 1), true),837 new mxConnectionConstraint(new mxPoint(1, 1), true),838 new mxConnectionConstraint(new mxPoint(0.5, 0), true),839 new mxConnectionConstraint(new mxPoint(0, 0.25), true),840 new mxConnectionConstraint(new mxPoint(0, 0.5), true),841 new mxConnectionConstraint(new mxPoint(0, 0.75), true),842 new mxConnectionConstraint(new mxPoint(1, 0.25), true),843 new mxConnectionConstraint(new mxPoint(1, 0.5), true),844 new mxConnectionConstraint(new mxPoint(1, 0.75), true),845 new mxConnectionConstraint(new mxPoint(0.25, 1), true),846 new mxConnectionConstraint(new mxPoint(0.5, 1), true),847 new mxConnectionConstraint(new mxPoint(0.75, 1), true)848 ];849850//**********************************************************************************************************************************************************851//Truck Shipment852//**********************************************************************************************************************************************************853/**854* Extends mxShape.855*/856function mxLeanTruckShipment(bounds, fill, stroke, strokewidth)857{858 mxShape.call(this);859 this.bounds = bounds;860 this.fill = fill;861 this.stroke = stroke;862 this.strokewidth = (strokewidth != null) ? strokewidth : 1;863};864865/**866* Extends mxShape.867*/868mxUtils.extend(mxLeanTruckShipment, mxShape);869870/**871* Function: paintVertexShape872* 873* Paints the vertex shape.874*/875mxLeanTruckShipment.prototype.paintVertexShape = function(c, x, y, w, h)876{877 c.translate(x, y);878879 this.background(c, w, h);880 c.setShadow(false);881};882883mxLeanTruckShipment.prototype.background = function(c, w, h)884{885 c.rect(0, 0, w * 0.6, h * 0.8);886 c.fillAndStroke();887 888 c.rect(w * 0.6, h * 0.35, w * 0.4, h * 0.45);889 c.fillAndStroke();890 891 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');892 c.setFillColor(strokeColor);893 c.ellipse(w * 0.15, h * 0.8, w * 0.2, h * 0.2);894 c.fillAndStroke();895 896 c.ellipse(w * 0.65, h * 0.8, w * 0.2, h * 0.2);897 c.fillAndStroke();898};899900mxCellRenderer.registerShape('mxgraph.lean_mapping.truck_shipment', mxLeanTruckShipment);901902mxLeanTruckShipment.prototype.constraints = [903 new mxConnectionConstraint(new mxPoint(0, 0), true),904 new mxConnectionConstraint(new mxPoint(0.25, 0), true),905 new mxConnectionConstraint(new mxPoint(0.5, 0), true),906 new mxConnectionConstraint(new mxPoint(0, 0.25), true),907 new mxConnectionConstraint(new mxPoint(0, 0.5), true),908 new mxConnectionConstraint(new mxPoint(0, 0.75), true),909 new mxConnectionConstraint(new mxPoint(0.6, 0.35), false),910 new mxConnectionConstraint(new mxPoint(1, 0.5), true),911 new mxConnectionConstraint(new mxPoint(1, 0.75), true),912 new mxConnectionConstraint(new mxPoint(0.25, 1), true),913 new mxConnectionConstraint(new mxPoint(0.5, 0.8), false),914 new mxConnectionConstraint(new mxPoint(0.75, 1), true)915 ];916917//**********************************************************************************************************************************************************918//Production Control919//**********************************************************************************************************************************************************920/**921* Extends mxShape.922*/923function mxLeanProductionControl(bounds, fill, stroke, strokewidth)924{925 mxShape.call(this);926 this.bounds = bounds;927 this.fill = fill;928 this.stroke = stroke;929 this.strokewidth = (strokewidth != null) ? strokewidth : 1;930};931932/**933* Extends mxShape.934*/935mxUtils.extend(mxLeanProductionControl, mxShape);936937/**938* Function: paintVertexShape939* 940* Paints the vertex shape.941*/942mxLeanProductionControl.prototype.paintVertexShape = function(c, x, y, w, h)943{944 c.translate(x, y);945 c.rect(0, 0, w, h);946 c.fillAndStroke();947};948949mxCellRenderer.registerShape('mxgraph.lean_mapping.schedule', mxLeanProductionControl);950951mxLeanProductionControl.prototype.constraints = [952 new mxConnectionConstraint(new mxPoint(0, 0), true),953 new mxConnectionConstraint(new mxPoint(1, 0), true),954 new mxConnectionConstraint(new mxPoint(0, 1), true),955 new mxConnectionConstraint(new mxPoint(1, 1), true),956 new mxConnectionConstraint(new mxPoint(0.25, 0), true),957 new mxConnectionConstraint(new mxPoint(0.5, 0), true),958 new mxConnectionConstraint(new mxPoint(0.75, 0), true),959 new mxConnectionConstraint(new mxPoint(0, 0.25), true),960 new mxConnectionConstraint(new mxPoint(0, 0.5), true),961 new mxConnectionConstraint(new mxPoint(0, 0.75), true),962 new mxConnectionConstraint(new mxPoint(1, 0.25), true),963 new mxConnectionConstraint(new mxPoint(1, 0.5), true),964 new mxConnectionConstraint(new mxPoint(1, 0.75), true),965 new mxConnectionConstraint(new mxPoint(0.25, 1), true),966 new mxConnectionConstraint(new mxPoint(0.5, 1), true),967 new mxConnectionConstraint(new mxPoint(0.75, 1), true)968 ];969970971//**********************************************************************************************************************************************************972//FIFO Sequence973//**********************************************************************************************************************************************************974/**975* Extends mxShape.976*/977function mxLeanFifoSequence(bounds, fill, stroke, strokewidth)978{979 mxShape.call(this);980 this.bounds = bounds;981 this.fill = fill;982 this.stroke = stroke;983 this.strokewidth = (strokewidth != null) ? strokewidth : 1;984};985986/**987* Extends mxShape.988*/989mxUtils.extend(mxLeanFifoSequence, mxShape);990991/**992* Function: paintVertexShape993* 994* Paints the vertex shape.995*/996mxLeanFifoSequence.prototype.paintVertexShape = function(c, x, y, w, h)997{998 c.translate(x, y);999 c.begin();1000 c.moveTo(0, 0);1001 c.lineTo(w, 0);1002 c.moveTo(0, h);1003 c.lineTo(w, h);1004 c.moveTo(w * 0.05, h * 0.5);1005 c.lineTo(w * 0.15, h * 0.5);1006 c.moveTo(w * 0.75, h * 0.5);1007 c.lineTo(w * 0.88, h * 0.5);1008 c.stroke();1009 1010 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');1011 c.setFillColor(strokeColor);1012 c.begin();1013 c.moveTo(w * 0.88, h * 0.39);1014 c.lineTo(w * 0.98, h * 0.5);1015 c.lineTo(w * 0.88, h * 0.61);1016 c.fillAndStroke();1017 1018// c.setFontSize(Math.min(h * 0.5, w * 0.2));1019// c.setFontColor(strokeColor);1020// c.text(w * 0.5, h * 0.5, 0, 0, 'FIFO', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);1021};10221023mxCellRenderer.registerShape('mxgraph.lean_mapping.fifo_sequence_flow', mxLeanFifoSequence);10241025mxLeanFifoSequence.prototype.constraints = [1026 new mxConnectionConstraint(new mxPoint(0, 0), true),1027 new mxConnectionConstraint(new mxPoint(1, 0), true),1028 new mxConnectionConstraint(new mxPoint(0, 1), true),1029 new mxConnectionConstraint(new mxPoint(1, 1), true),1030 new mxConnectionConstraint(new mxPoint(0.25, 0), true),1031 new mxConnectionConstraint(new mxPoint(0.5, 0), true),1032 new mxConnectionConstraint(new mxPoint(0.75, 0), true),1033 new mxConnectionConstraint(new mxPoint(0, 0.5), true),1034 new mxConnectionConstraint(new mxPoint(1, 0.5), true),1035 new mxConnectionConstraint(new mxPoint(0.25, 1), true),1036 new mxConnectionConstraint(new mxPoint(0.5, 1), true),1037 new mxConnectionConstraint(new mxPoint(0.75, 1), true)1038 ];10391040//**********************************************************************************************************************************************************1041//Production Kanban1042//**********************************************************************************************************************************************************1043/**1044* Extends mxShape.1045*/1046function mxLeanProductionKanban(bounds, fill, stroke, strokewidth)1047{1048 mxShape.call(this);1049 this.bounds = bounds;1050 this.fill = fill;1051 this.stroke = stroke;1052 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1053};10541055/**1056* Extends mxShape.1057*/1058mxUtils.extend(mxLeanProductionKanban, mxShape);10591060/**1061* Function: paintVertexShape1062* 1063* Paints the vertex shape.1064*/1065mxLeanProductionKanban.prototype.paintVertexShape = function(c, x, y, w, h)1066{1067 c.translate(x, y);1068 1069 c.setDashed(true);1070 c.begin();1071 c.moveTo(4, h - 10);1072 c.lineTo(4, 25);1073 c.lineTo(w, 25);1074 c.stroke();10751076 c.setDashed(false);1077 c.begin();1078 c.moveTo(w - 75, 0);1079 c.lineTo(w - 30, 0);1080 c.lineTo(w - 15, 15);1081 c.lineTo(w - 15, 50);1082 c.lineTo(w - 75, 50);1083 c.close();1084 c.fillAndStroke();1085 1086 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');1087 c.setFillColor(strokeColor);1088 c.begin();1089 c.moveTo(0, h - 10);1090 c.lineTo(4, h);1091 c.lineTo(8, h - 10);1092 c.close();1093 c.fillAndStroke();1094};10951096mxCellRenderer.registerShape('mxgraph.lean_mapping.production_kanban', mxLeanProductionKanban);10971098mxLeanProductionKanban.prototype.getConstraints = function(style, w, h)1099{1100 var constr = [];11011102 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 4, h));1103 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, 25));11041105 return (constr);1106};11071108//**********************************************************************************************************************************************************1109//Withdrawal Kanban1110//**********************************************************************************************************************************************************1111/**1112* Extends mxShape.1113*/1114function mxLeanWithdrawalKanban(bounds, fill, stroke, strokewidth)1115{1116 mxShape.call(this);1117 this.bounds = bounds;1118 this.fill = fill;1119 this.stroke = stroke;1120 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1121};11221123/**1124* Extends mxShape.1125*/1126mxUtils.extend(mxLeanWithdrawalKanban, mxShape);11271128/**1129* Function: paintVertexShape1130* 1131* Paints the vertex shape.1132*/1133mxLeanWithdrawalKanban.prototype.paintVertexShape = function(c, x, y, w, h)1134{1135 c.translate(x, y);1136 1137 c.setDashed(true);1138 c.begin();1139 c.moveTo(4, h - 10);1140 c.lineTo(4, 25);1141 c.lineTo(w, 25);1142 c.stroke();11431144 c.setDashed(false);1145 c.begin();1146 c.moveTo(w - 75, 0);1147 c.lineTo(w - 30, 0);1148 c.lineTo(w - 15, 15);1149 c.lineTo(w - 15, 50);1150 c.lineTo(w - 75, 50);1151 c.close();1152 c.fillAndStroke();1153 1154 c.begin();1155 c.moveTo(w - 75, 45);1156 c.lineTo(w - 70, 50);1157 c.moveTo(w - 75, 35);1158 c.lineTo(w - 60, 50);1159 c.moveTo(w - 75, 25);1160 c.lineTo(w - 50, 50);1161 c.moveTo(w - 75, 15);1162 c.lineTo(w - 40, 50);1163 c.moveTo(w - 75, 5);1164 c.lineTo(w - 30, 50);1165 c.moveTo(w - 70, 0);1166 c.lineTo(w - 20, 50);1167 c.moveTo(w - 60, 0);1168 c.lineTo(w - 15, 45);1169 c.moveTo(w - 50, 0);1170 c.lineTo(w - 15, 35);1171 c.moveTo(w - 40, 0);1172 c.lineTo(w - 15, 25);1173 c.stroke();1174 1175 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');1176 c.setFillColor(strokeColor);1177 c.begin();1178 c.moveTo(0, h - 10);1179 c.lineTo(4, h);1180 c.lineTo(8, h - 10);1181 c.close();1182 c.fillAndStroke();1183};11841185mxCellRenderer.registerShape('mxgraph.lean_mapping.withdrawal_kanban', mxLeanWithdrawalKanban);11861187mxLeanWithdrawalKanban.prototype.getConstraints = function(style, w, h)1188{1189 var constr = [];11901191 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 4, h));1192 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, 25));11931194 return (constr);1195};11961197//**********************************************************************************************************************************************************1198//Signal Kanban1199//**********************************************************************************************************************************************************1200/**1201* Extends mxShape.1202*/1203function mxLeanSignalKanban(bounds, fill, stroke, strokewidth)1204{1205 mxShape.call(this);1206 this.bounds = bounds;1207 this.fill = fill;1208 this.stroke = stroke;1209 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1210};12111212/**1213* Extends mxShape.1214*/1215mxUtils.extend(mxLeanSignalKanban, mxShape);12161217/**1218* Function: paintVertexShape1219* 1220* Paints the vertex shape.1221*/1222mxLeanSignalKanban.prototype.paintVertexShape = function(c, x, y, w, h)1223{1224 c.translate(x, y);1225 1226 c.setDashed(true);1227 c.begin();1228 c.moveTo(4, h - 10);1229 c.lineTo(4, 15);1230 c.lineTo(w, 15);1231 c.stroke();12321233 c.setDashed(false);1234 c.begin();1235 c.moveTo(w - 65, 0);1236 c.lineTo(w - 25, 0);1237 c.lineTo(w - 45, 45);1238 c.close();1239 c.fillAndStroke();1240 1241 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');1242 c.setFillColor(strokeColor);1243 c.begin();1244 c.moveTo(0, h - 10);1245 c.lineTo(4, h);1246 c.lineTo(8, h - 10);1247 c.close();1248 c.fillAndStroke();1249};12501251mxCellRenderer.registerShape('mxgraph.lean_mapping.signal_kanban', mxLeanSignalKanban);12521253mxLeanSignalKanban.prototype.getConstraints = function(style, w, h)1254{1255 var constr = [];12561257 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 4, h));1258 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, 15));12591260 return (constr);1261};12621263//**********************************************************************************************************************************************************1264//Sequenced Pull Ball1265//**********************************************************************************************************************************************************1266/**1267* Extends mxShape.1268*/1269function mxLeanSequencedPullBall(bounds, fill, stroke, strokewidth)1270{1271 mxShape.call(this);1272 this.bounds = bounds;1273 this.fill = fill;1274 this.stroke = stroke;1275 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1276};12771278/**1279* Extends mxShape.1280*/1281mxUtils.extend(mxLeanSequencedPullBall, mxShape);12821283/**1284* Function: paintVertexShape1285* 1286* Paints the vertex shape.1287*/1288mxLeanSequencedPullBall.prototype.paintVertexShape = function(c, x, y, w, h)1289{1290 c.translate(x, y);1291 c.ellipse(0, 0, w, h);1292 c.fillAndStroke();1293 1294 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');1295 c.setFillColor(strokeColor);1296 c.setShadow(false);1297 1298 c.ellipse(w * 0.15, h * 0.15, w * 0.7, h * 0.7);1299 c.fillAndStroke();1300};13011302mxCellRenderer.registerShape('mxgraph.lean_mapping.sequenced_pull_ball', mxLeanSequencedPullBall);13031304mxLeanSequencedPullBall.prototype.constraints = [1305 new mxConnectionConstraint(new mxPoint(0.144, 0.144), false),1306 new mxConnectionConstraint(new mxPoint(0.856, 0.144), false),1307 new mxConnectionConstraint(new mxPoint(0.856, 0.856), false),1308 new mxConnectionConstraint(new mxPoint(0.144, 0.856), false),1309 new mxConnectionConstraint(new mxPoint(0, 0.5), true),1310 new mxConnectionConstraint(new mxPoint(1, 0.5), true),1311 new mxConnectionConstraint(new mxPoint(0.5, 0), true),1312 new mxConnectionConstraint(new mxPoint(0.5, 1), true)1313 ];13141315//**********************************************************************************************************************************************************1316//Rail Shipment1317//**********************************************************************************************************************************************************1318/**1319* Extends mxShape.1320*/1321function mxLeanRailShipment(bounds, fill, stroke, strokewidth)1322{1323 mxShape.call(this);1324 this.bounds = bounds;1325 this.fill = fill;1326 this.stroke = stroke;1327 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1328};13291330/**1331* Extends mxShape.1332*/1333mxUtils.extend(mxLeanRailShipment, mxShape);13341335/**1336* Function: paintVertexShape1337* 1338* Paints the vertex shape.1339*/1340mxLeanRailShipment.prototype.paintVertexShape = function(c, x, y, w, h)1341{1342 c.translate(x, y);1343 1344 c.rect(w * 0.1, 0, w * 0.35, h * 0.8);1345 c.fillAndStroke();1346 c.rect(w * 0.55, 0, w * 0.35, h * 0.8);1347 c.fillAndStroke();1348 1349 c.begin();1350 c.moveTo(0, h);1351 c.lineTo(w, h);1352 c.moveTo(w * 0.45, h * 0.7);1353 c.lineTo(w * 0.55, h * 0.7);1354 c.stroke();1355 1356 c.ellipse(w * 0.15, h * 0.8, w * 0.06, h * 0.2);1357 c.fillAndStroke();1358 c.ellipse(w * 0.34, h * 0.8, w * 0.06, h * 0.2);1359 c.fillAndStroke();1360 c.ellipse(w * 0.6, h * 0.8, w * 0.06, h * 0.2);1361 c.fillAndStroke();1362 c.ellipse(w * 0.79, h * 0.8, w * 0.06, h * 0.2);1363 c.fillAndStroke();1364};13651366mxCellRenderer.registerShape('mxgraph.lean_mapping.rail_shipment', mxLeanRailShipment);13671368mxLeanRailShipment.prototype.constraints = [1369 new mxConnectionConstraint(new mxPoint(0, 1), true),1370 new mxConnectionConstraint(new mxPoint(1, 1), true),1371 new mxConnectionConstraint(new mxPoint(0.25, 0), true),1372 new mxConnectionConstraint(new mxPoint(0.5, 0), true),1373 new mxConnectionConstraint(new mxPoint(0.75, 0), true),1374 new mxConnectionConstraint(new mxPoint(0.1, 0.25), false),1375 new mxConnectionConstraint(new mxPoint(0.1, 0.5), false),1376 new mxConnectionConstraint(new mxPoint(0.1, 0.75), false),1377 new mxConnectionConstraint(new mxPoint(0.9, 0.25), false),1378 new mxConnectionConstraint(new mxPoint(0.9, 0.5), false),1379 new mxConnectionConstraint(new mxPoint(0.9, 0.75), false),1380 new mxConnectionConstraint(new mxPoint(0.25, 1), true),1381 new mxConnectionConstraint(new mxPoint(0.5, 1), true),1382 new mxConnectionConstraint(new mxPoint(0.75, 1), true)1383 ];13841385//**********************************************************************************************************************************************************1386//Warehouse1387//**********************************************************************************************************************************************************1388/**1389* Extends mxShape.1390*/1391function mxLeanWarehouse(bounds, fill, stroke, strokewidth)1392{1393 mxShape.call(this);1394 this.bounds = bounds;1395 this.fill = fill;1396 this.stroke = stroke;1397 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1398};13991400/**1401* Extends mxShape.1402*/1403mxUtils.extend(mxLeanWarehouse, mxShape);14041405/**1406* Function: paintVertexShape1407* 1408* Paints the vertex shape.1409*/1410mxLeanWarehouse.prototype.paintVertexShape = function(c, x, y, w, h)1411{1412 c.translate(x, y);14131414 c.rect(0, 0, w, h);1415 c.fillAndStroke();1416 1417 c.setShadow(false);1418 1419 c.begin();1420 c.moveTo(0, h * 0.4);1421 c.lineTo(w, h * 0.4);1422 c.moveTo(w * 0.15, h);1423 c.lineTo(w * 0.15, h * 0.55);1424 c.lineTo(w * 0.3, h * 0.55);1425 c.lineTo(w * 0.3, h);1426 c.stroke();14271428 c.ellipse(w * 0.27, h * 0.75, w * 0.02, w * 0.02);1429 c.stroke();1430};14311432mxCellRenderer.registerShape('mxgraph.lean_mapping.warehouse', mxLeanWarehouse);14331434mxLeanWarehouse.prototype.constraints = [1435 new mxConnectionConstraint(new mxPoint(0, 0), true),1436 new mxConnectionConstraint(new mxPoint(1, 0), true),1437 new mxConnectionConstraint(new mxPoint(0, 1), true),1438 new mxConnectionConstraint(new mxPoint(1, 1), true),1439 new mxConnectionConstraint(new mxPoint(0.25, 0), true),1440 new mxConnectionConstraint(new mxPoint(0.5, 0), true),1441 new mxConnectionConstraint(new mxPoint(0.75, 0), true),1442 new mxConnectionConstraint(new mxPoint(0, 0.25), true),1443 new mxConnectionConstraint(new mxPoint(0, 0.5), true),1444 new mxConnectionConstraint(new mxPoint(0, 0.75), true),1445 new mxConnectionConstraint(new mxPoint(1, 0.25), true),1446 new mxConnectionConstraint(new mxPoint(1, 0.5), true),1447 new mxConnectionConstraint(new mxPoint(1, 0.75), true),1448 new mxConnectionConstraint(new mxPoint(0.25, 1), true),1449 new mxConnectionConstraint(new mxPoint(0.5, 1), true),1450 new mxConnectionConstraint(new mxPoint(0.75, 1), true)1451 ];14521453//**********************************************************************************************************************************************************1454//Timeline1455//**********************************************************************************************************************************************************1456/**1457* Extends mxShape.1458*/1459function mxLeanTimeline(bounds, fill, stroke, strokewidth)1460{1461 mxShape.call(this);1462 this.bounds = bounds;1463 this.fill = fill;1464 this.stroke = stroke;1465 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1466};14671468/**1469* Extends mxShape.1470*/1471mxUtils.extend(mxLeanTimeline, mxShape);14721473/**1474* Function: paintVertexShape1475* 1476* Paints the vertex shape.1477*/1478mxLeanTimeline.prototype.paintVertexShape = function(c, x, y, w, h)1479{1480 c.translate(x, y);1481 1482 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(',');1483 var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '12');1484 var times = new Array();1485 var totalTime = 0;1486 1487 for (var i = 0; i < shapeInfo.length; i = i + 2)1488 {1489 var currTime = parseFloat(shapeInfo[i]); 1490 times.push(currTime);1491 totalTime = totalTime + currTime;1492 };1493 1494 var scaleX = w / totalTime;1495 var names = new Array();1496 1497 for (var i = 1; i < shapeInfo.length; i = i + 2)1498 {1499 names.push(shapeInfo[i]);1500 };1501 1502 c.begin();1503 var currX = 0;1504 c.moveTo(0, h);1505 1506 for (var i = 0; i < names.length; i++)1507 {1508 var currTime = times[i] * scaleX;1509 currX = currX + currTime;1510 1511 if (i % 2 === 0)1512 {1513 c.lineTo(currX, h);1514 c.lineTo(currX, fontSize * 1.5);1515 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);1516 }1517 else1518 {1519 c.lineTo(currX, fontSize * 1.5);1520 c.lineTo(currX, h);1521 c.text(currX - currTime * 0.5, fontSize * 0.75, 0, 0, names[i], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);1522 }1523 };1524 1525 c.stroke();1526};15271528mxCellRenderer.registerShape('mxgraph.lean_mapping.timeline', mxLeanTimeline);15291530//**********************************************************************************************************************************************************1531//Cross Dock1532//**********************************************************************************************************************************************************1533/**1534* Extends mxShape.1535*/1536function mxLeanCrossDock(bounds, fill, stroke, strokewidth)1537{1538 mxShape.call(this);1539 this.bounds = bounds;1540 this.fill = fill;1541 this.stroke = stroke;1542 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1543};15441545/**1546* Extends mxShape.1547*/1548mxUtils.extend(mxLeanCrossDock, mxShape);15491550/**1551* Function: paintVertexShape1552* 1553* Paints the vertex shape.1554*/1555mxLeanCrossDock.prototype.paintVertexShape = function(c, x, y, w, h)1556{1557 c.translate(x, y);15581559 c.rect(0, 0, w, h);1560 c.fillAndStroke();1561 1562 c.setShadow(false);1563 1564 c.begin();1565 c.moveTo(0, h * 0.25);1566 c.lineTo(w, h * 0.25);1567 1568 c.moveTo(w * 0.1, h * 0.4);1569 c.lineTo(w * 0.35, h * 0.4);1570 c.arcTo(w * 0.15, h * 0.15, 0, 0, 1, w * 0.5, h * 0.5);1571 c.arcTo(w * 0.15, h * 0.15, 0, 0, 0, w * 0.65, h * 0.6);1572 c.lineTo(w * 0.9, h * 0.6);1573 c.stroke();15741575 c.moveTo(w * 0.1, h * 0.4);1576 c.lineTo(w * 0.35, h * 0.4);1577 c.arcTo(w * 0.15, h * 0.25, 0, 0, 1, w * 0.5, h * 0.55);1578 c.arcTo(w * 0.15, h * 0.25, 0, 0, 0, w * 0.65, h * 0.7);1579 c.lineTo(w * 0.9, h * 0.7);1580 c.stroke();15811582 c.moveTo(w * 0.1, h * 0.4);1583 c.lineTo(w * 0.35, h * 0.4);1584 c.arcTo(w * 0.15, h * 0.3, 0, 0, 1, w * 0.5, h * 0.6);1585 c.arcTo(w * 0.15, h * 0.3, 0, 0, 0, w * 0.65, h * 0.8);1586 c.lineTo(w * 0.9, h * 0.8);1587 c.stroke();15881589 c.moveTo(w * 0.1, h * 0.8);1590 c.lineTo(w * 0.35, h * 0.8);1591 c.arcTo(w * 0.15, h * 0.3, 0, 0, 0, w * 0.5, h * 0.6);1592 c.arcTo(w * 0.15, h * 0.3, 0, 0, 1, w * 0.65, h * 0.4);1593 c.lineTo(w * 0.9, h * 0.4);1594 c.stroke();15951596 c.moveTo(w * 0.1, h * 0.8);1597 c.lineTo(w * 0.35, h * 0.8);1598 c.arcTo(w * 0.15, h * 0.1, 0, 0, 0, w * 0.5, h * 0.75);1599 c.arcTo(w * 0.15, h * 0.1, 0, 0, 1, w * 0.65, h * 0.7);1600 c.lineTo(w * 0.9, h * 0.7);1601 c.stroke();1602};16031604mxCellRenderer.registerShape('mxgraph.lean_mapping.crossDock', mxLeanCrossDock);16051606mxLeanCrossDock.prototype.constraints = [1607 new mxConnectionConstraint(new mxPoint(0, 0), true),1608 new mxConnectionConstraint(new mxPoint(1, 0), true),1609 new mxConnectionConstraint(new mxPoint(0, 1), true),1610 new mxConnectionConstraint(new mxPoint(1, 1), true),1611 new mxConnectionConstraint(new mxPoint(0.25, 0), true),1612 new mxConnectionConstraint(new mxPoint(0.5, 0), true),1613 new mxConnectionConstraint(new mxPoint(0.75, 0), true),1614 new mxConnectionConstraint(new mxPoint(0, 0.25), true),1615 new mxConnectionConstraint(new mxPoint(0, 0.5), true),1616 new mxConnectionConstraint(new mxPoint(0, 0.75), true),1617 new mxConnectionConstraint(new mxPoint(1, 0.25), true),1618 new mxConnectionConstraint(new mxPoint(1, 0.5), true),1619 new mxConnectionConstraint(new mxPoint(1, 0.75), true),1620 new mxConnectionConstraint(new mxPoint(0.25, 1), true),1621 new mxConnectionConstraint(new mxPoint(0.5, 1), true),1622 new mxConnectionConstraint(new mxPoint(0.75, 1), true)1623 ];16241625//**********************************************************************************************************************************************************1626//Orders1627//**********************************************************************************************************************************************************1628/**1629* Extends mxShape.1630*/1631function mxLeanOrders(bounds, fill, stroke, strokewidth)1632{1633 mxShape.call(this);1634 this.bounds = bounds;1635 this.fill = fill;1636 this.stroke = stroke;1637 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1638};16391640/**1641* Extends mxShape.1642*/1643mxUtils.extend(mxLeanOrders, mxShape);16441645/**1646* Function: paintVertexShape1647* 1648* Paints the vertex shape.1649*/1650mxLeanOrders.prototype.paintVertexShape = function(c, x, y, w, h)1651{1652 c.translate(x, y);16531654 c.rect(0, h * 0.56, w, h * 0.44);1655 c.fillAndStroke();1656 1657 var strokeWidth = parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, '2'));1658 c.setStrokeWidth(strokeWidth * 0.5);1659 1660 c.begin();1661 c.moveTo(w * 0.04, h * 0.5418);1662 c.lineTo(w * 0.94, h * 0.5418);1663 c.moveTo(w * 0.0522, h * 0.5088);1664 c.lineTo(w * 0.9522, h * 0.5088);1665 c.moveTo(w * 0.05, h * 0.4738);1666 c.lineTo(w * 0.95, h * 0.4738);1667 c.moveTo(w * 0.0456, h * 0.4427);1668 c.lineTo(w * 0.9456, h * 0.4427);1669 c.moveTo(w * 0.0422, h * 0.4135);1670 c.lineTo(w * 0.9422, h * 0.4135);1671 c.moveTo(w * 0.0533, h * 0.3804);1672 c.lineTo(w * 0.9533, h * 0.3804);1673 c.moveTo(w * 0.0556, h * 0.3454);1674 c.lineTo(w * 0.9556, h * 0.3454);1675 c.moveTo(w * 0.05, h * 0.3143);1676 c.lineTo(w * 0.95, h * 0.3143);1677 c.moveTo(w * 0.0489, h * 0.2832);1678 c.lineTo(w * 0.0489, h * 0.2832);1679 c.moveTo(w * 0.0544, h * 0.254);1680 c.lineTo(w * 0.9544, h * 0.254);1681 c.moveTo(w * 0.0489, h * 0.221);1682 c.lineTo(w * 0.9489, h * 0.221);1683 c.moveTo(w * 0.0556, h * 0.1918);1684 c.lineTo(w * 0.9556, h * 0.1918);1685 c.moveTo(w * 0.0522, h * 0.1587);1686 c.lineTo(w * 0.9522, h * 0.1587);1687 c.moveTo(w * 0.0544, h * 0.1276);1688 c.lineTo(w * 0.9544, h * 0.1276);1689 c.moveTo(w * 0.0544, h * 0.0965);1690 c.lineTo(w * 0.9544, h * 0.0965);1691 c.moveTo(w * 0.0556, h * 0.0654);1692 c.lineTo(w * 0.9556, h * 0.0654);1693 c.moveTo(w * 0.0533, h * 0.0304);1694 c.lineTo(w * 0.9533, h * 0.0304);1695 c.moveTo(w * 0.0556, 0);1696 c.lineTo(w * 0.9556, 0);1697 c.stroke();1698};16991700mxCellRenderer.registerShape('mxgraph.lean_mapping.orders', mxLeanOrders);17011702mxLeanOrders.prototype.constraints = [1703 new mxConnectionConstraint(new mxPoint(0.05, 0), true),1704 new mxConnectionConstraint(new mxPoint(0.95, 0), true),1705 new mxConnectionConstraint(new mxPoint(0, 1), true),1706 new mxConnectionConstraint(new mxPoint(1, 1), true),1707 new mxConnectionConstraint(new mxPoint(0.25, 0), true),1708 new mxConnectionConstraint(new mxPoint(0.5, 0), true),1709 new mxConnectionConstraint(new mxPoint(0.75, 0), true),1710 new mxConnectionConstraint(new mxPoint(0.05, 0.25), false),1711 new mxConnectionConstraint(new mxPoint(0.05, 0.5), false),1712 new mxConnectionConstraint(new mxPoint(0, 0.75), true),1713 new mxConnectionConstraint(new mxPoint(0.95, 0.25), false),1714 new mxConnectionConstraint(new mxPoint(0.95, 0.5), false),1715 new mxConnectionConstraint(new mxPoint(1, 0.75), true),1716 new mxConnectionConstraint(new mxPoint(0.25, 1), true),1717 new mxConnectionConstraint(new mxPoint(0.5, 1), true),1718 new mxConnectionConstraint(new mxPoint(0.75, 1), true)1719 ];17201721//**********************************************************************************************************************************************************1722//Batched Kanban1723//**********************************************************************************************************************************************************1724/**1725* Extends mxShape.1726*/1727function mxLeanBatchedKanban(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};17351736/**1737* Extends mxShape.1738*/1739mxUtils.extend(mxLeanBatchedKanban, mxShape);17401741/**1742* Function: paintVertexShape1743* 1744* Paints the vertex shape.1745*/1746mxLeanBatchedKanban.prototype.paintVertexShape = function(c, x, y, w, h)1747{1748 w = Math.max(110, w);1749 1750 c.translate(x, y);1751 1752 c.begin();1753 c.moveTo(4, h * 0.5);1754 c.lineTo(w, h * 0.5);1755 c.stroke();17561757 c.begin();1758 c.moveTo(w * 0.5 - 20, h * 0.5 - 35);1759 c.lineTo(w * 0.5 + 25, h * 0.5 - 35);1760 c.lineTo(w * 0.5 + 40, h * 0.5 - 20);1761 c.lineTo(w * 0.5 + 40, h * 0.5 + 15);1762 c.lineTo(w * 0.5 - 20, h * 0.5 + 15);1763 c.close();1764 c.fillAndStroke();1765 1766 c.begin();1767 c.moveTo(w * 0.5 - 30, h * 0.5 - 25);1768 c.lineTo(w * 0.5 + 15, h * 0.5 - 25);1769 c.lineTo(w * 0.5 + 30, h * 0.5 - 10);1770 c.lineTo(w * 0.5 + 30, h * 0.5 + 25);1771 c.lineTo(w * 0.5 - 30, h * 0.5 + 25);1772 c.close();1773 c.fillAndStroke();1774 1775 c.begin();1776 c.moveTo(w * 0.5 - 40, h * 0.5 - 15);1777 c.lineTo(w * 0.5 + 5, h * 0.5 - 15);1778 c.lineTo(w * 0.5 + 20, h * 0.5);1779 c.lineTo(w * 0.5 + 20, h * 0.5 + 35);1780 c.lineTo(w * 0.5 - 40, h * 0.5 + 35);1781 c.close();1782 c.fillAndStroke();1783 1784 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');1785 c.setFillColor(strokeColor);1786 c.begin();1787 c.moveTo(w - 10, h * 0.5 - 4);1788 c.lineTo(w, h * 0.5);1789 c.lineTo(w - 10, h * 0.5 + 4);1790 c.close();1791 c.fillAndStroke();1792};17931794mxCellRenderer.registerShape('mxgraph.lean_mapping.batched_kanban', mxLeanBatchedKanban);17951796mxLeanBatchedKanban.prototype.constraints = [1797 new mxConnectionConstraint(new mxPoint(0, 0.5), true),1798 new mxConnectionConstraint(new mxPoint(1, 0.5), true)1799 ];18001801//**********************************************************************************************************************************************************1802//Control Center1803//**********************************************************************************************************************************************************1804/**1805* Extends mxShape.1806*/1807function mxLeanControlCenter(bounds, fill, stroke, strokewidth)1808{1809 mxShape.call(this);1810 this.bounds = bounds;1811 this.fill = fill;1812 this.stroke = stroke;1813 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1814};18151816/**1817* Extends mxShape.1818*/1819mxUtils.extend(mxLeanControlCenter, mxShape);18201821/**1822* Function: paintVertexShape1823* 1824* Paints the vertex shape.1825*/1826mxLeanControlCenter.prototype.paintVertexShape = function(c, x, y, w, h)1827{1828 c.translate(x, y);1829 c.rect(w * 0.15, 0, w * 0.7, h * 0.8);1830 c.fillAndStroke();1831 c.rect(0, h * 0.8, w, h * 0.2);1832 c.fillAndStroke();1833};18341835mxCellRenderer.registerShape('mxgraph.lean_mapping.control_center', mxLeanControlCenter);18361837mxLeanControlCenter.prototype.constraints = [1838 new mxConnectionConstraint(new mxPoint(0.15, 0), true),1839 new mxConnectionConstraint(new mxPoint(0.85, 0), true),1840 new mxConnectionConstraint(new mxPoint(0, 1), true),1841 new mxConnectionConstraint(new mxPoint(1, 1), true),1842 new mxConnectionConstraint(new mxPoint(0.5, 0), true),1843 new mxConnectionConstraint(new mxPoint(0.15, 0.25), false),1844 new mxConnectionConstraint(new mxPoint(0.15, 0.5), false),1845 new mxConnectionConstraint(new mxPoint(0, 0.75), true),1846 new mxConnectionConstraint(new mxPoint(0.85, 0.25), false),1847 new mxConnectionConstraint(new mxPoint(0.85, 0.5), false),1848 new mxConnectionConstraint(new mxPoint(1, 0.75), true),1849 new mxConnectionConstraint(new mxPoint(0.25, 1), true),1850 new mxConnectionConstraint(new mxPoint(0.5, 1), true),1851 new mxConnectionConstraint(new mxPoint(0.75, 1), true)1852 ];18531854//**********************************************************************************************************************************************************1855//Electronical Info1856//**********************************************************************************************************************************************************1857function mxLeanElectronicInfoShape()1858{1859 mxArrow.call(this);1860};18611862mxUtils.extend(mxLeanElectronicInfoShape, mxArrow);18631864mxLeanElectronicInfoShape.prototype.paintEdgeShape = function(c, pts)1865{1866 // Base vector (between end points)1867 var p0 = pts[0];1868 var pe = pts[pts.length - 1];1869 1870 var dx = pe.x - p0.x;1871 var dy = pe.y - p0.y;1872 1873 p0.x = p0.x + dx * 0.05;1874 p0.y = p0.y + dy * 0.05;1875 pe.x = pe.x - dx * 0.05;1876 pe.y = pe.y - dy * 0.05;1877 dx = pe.x - p0.x;1878 dy = pe.y - p0.y;1879 1880 var dist = Math.sqrt(dx * dx + dy * dy);1881 var nx = dx / dist;1882 var ny = dy / dist;1883 var midX = p0.x + dx * 0.5; 1884 var midY = p0.y + dy * 0.5;1885 1886 var p1x = midX - nx * dist * 0.1 - ny / 3 * dist * 0.1;1887 var p1y = midY - ny * dist * 0.1 + nx / 3 * dist * 0.1;1888 var p4x = midX + nx * dist * 0.1 + ny / 3 * dist * 0.1;1889 var p4y = midY + ny * dist * 0.1 - nx / 3 * dist * 0.1;18901891 c.begin();1892 c.moveTo(p0.x, p0.y);1893 c.lineTo(p4x, p4y);1894 c.lineTo(p1x, p1y);1895 c.lineTo(pe.x, pe.y);1896 c.stroke();18971898 var dx = pe.x - p1x;1899 var dy = pe.y - p1y;1900 var dist = Math.sqrt(dx * dx + dy * dy);1901 var nx = dx / dist;1902 var ny = dy / dist;1903 1904 c.setFillColor(mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000'));1905 c.begin();1906 c.moveTo(pe.x - nx * 10 - ny * 5, pe.y - ny * 10 + nx * 5);1907 c.lineTo(pe.x, pe.y);1908 c.lineTo(pe.x - nx * 10 + ny * 5, pe.y - ny * 10 - nx * 5);1909 c.fillAndStroke();1910};19111912// Registers the electronic info shape1913mxCellRenderer.registerShape('mxgraph.lean_mapping.electronic_info_flow_edge', mxLeanElectronicInfoShape);19141915//**********************************************************************************************************************************************************1916//Manual Info1917//**********************************************************************************************************************************************************1918function mxLeanManualInfoShape()1919{1920 mxArrow.call(this);1921};19221923mxUtils.extend(mxLeanManualInfoShape, mxArrow);19241925mxLeanManualInfoShape.prototype.paintEdgeShape = function(c, pts)1926{1927 // Base vector (between end points)1928 var p0 = pts[0];1929 var pe = pts[pts.length - 1];1930 1931 var dx = pe.x - p0.x;1932 var dy = pe.y - p0.y;1933 1934 p0.x = p0.x + dx * 0.05;1935 p0.y = p0.y + dy * 0.05;1936 pe.x = pe.x - dx * 0.05;1937 pe.y = pe.y - dy * 0.05;1938 dx = pe.x - p0.x;1939 dy = pe.y - p0.y;1940 1941 var dist = Math.sqrt(dx * dx + dy * dy);1942 var nx = dx / dist;1943 var ny = dy / dist;1944 1945 c.begin();1946 c.moveTo(p0.x, p0.y);1947 c.lineTo(pe.x, pe.y);1948 c.stroke();19491950 c.setFillColor(mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000'));1951 c.begin();1952 c.moveTo(pe.x - nx * 10 - ny * 5, pe.y - ny * 10 + nx * 5);1953 c.lineTo(pe.x, pe.y);1954 c.lineTo(pe.x - nx * 10 + ny * 5, pe.y - ny * 10 - nx * 5);1955 c.fillAndStroke();1956};19571958//Registers the electronic info shape1959mxCellRenderer.registerShape('mxgraph.lean_mapping.manual_info_flow_edge', mxLeanManualInfoShape);19601961//**********************************************************************************************************************************************************1962//Timeline1963//**********************************************************************************************************************************************************1964/**1965* Extends mxShape.1966*/1967function mxShapeLeanTimeline(bounds, fill, stroke, strokewidth)1968{1969 mxShape.call(this);1970 this.bounds = bounds;1971 this.fill = fill;1972 this.stroke = stroke;1973 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1974};19751976/**1977* Extends mxShape.1978*/1979mxUtils.extend(mxShapeLeanTimeline, mxShape);19801981mxShapeLeanTimeline.prototype.cst = {1982 SHAPE_TIMELINE : 'mxgraph.lean_mapping.timeline2'1983};19841985/**1986* Function: paintVertexShape1987* 1988* Paints the vertex shape.1989*/1990mxShapeLeanTimeline.prototype.paintVertexShape = function(c, x, y, w, h)1991{1992 c.translate(x, y);19931994 var dy1 = mxUtils.getValue(this.style, 'dy1', '0');1995 var dx2 = mxUtils.getValue(this.style, 'dx2', '0');1996 var dy2 = mxUtils.getValue(this.style, 'dy2', '0');1997 var dx3 = mxUtils.getValue(this.style, 'dx3', '0');1998 var dy3 = mxUtils.getValue(this.style, 'dy3', '0');1999 var dx4 = mxUtils.getValue(this.style, 'dx4', '0');2000 var dy4 = mxUtils.getValue(this.style, 'dy4', '0');2001 var dx5 = mxUtils.getValue(this.style, 'dx5', '0');2002 var dy5 = mxUtils.getValue(this.style, 'dy5', '0');2003 var dy6 = mxUtils.getValue(this.style, 'dy6', '0');2004 2005 var lastUp = true;20062007 c.begin();20082009 if (dy1 <= 0.5)2010 {2011 c.moveTo(0, 0);2012 lastUp = true;2013 }2014 else2015 {2016 c.moveTo(0, h);2017 lastUp = false;2018 }20192020 //22021 if (dy2 <= 0.5 && lastUp)2022 {2023 c.lineTo(dx2, 0);2024 lastUp = true;2025 }2026 else if (dy2 > 0.5 && !lastUp)2027 {2028 c.lineTo(dx2, h);2029 lastUp = false;2030 }2031 else if (dy2 <= 0.5 && !lastUp)2032 {2033 c.lineTo(dx2, h);2034 c.lineTo(dx2, 0);2035 lastUp = true;2036 }2037 else2038 {2039 c.lineTo(dx2, 0);2040 c.lineTo(dx2, h);2041 lastUp = false;2042 }2043 2044 //32045 if (dy3 <= 0.5 && lastUp)2046 {2047 c.lineTo(dx3, 0);2048 lastUp = true;2049 }2050 else if (dy3 > 0.5 && !lastUp)2051 {2052 c.lineTo(dx3, h);2053 lastUp = false;2054 }2055 else if (dy3 <= 0.5 && !lastUp)2056 {2057 c.lineTo(dx3, h);2058 c.lineTo(dx3, 0);2059 lastUp = true;2060 }2061 else2062 {2063 c.lineTo(dx3, 0);2064 c.lineTo(dx3, h);2065 lastUp = false;2066 }2067 2068 //42069 if (dy4 <= 0.5 && lastUp)2070 {2071 c.lineTo(dx4, 0);2072 lastUp = true;2073 }2074 else if (dy4 > 0.5 && !lastUp)2075 {2076 c.lineTo(dx4, h);2077 lastUp = false;2078 }2079 else if (dy4 <= 0.5 && !lastUp)2080 {2081 c.lineTo(dx4, h);2082 c.lineTo(dx4, 0);2083 lastUp = true;2084 }2085 else2086 {2087 c.lineTo(dx4, 0);2088 c.lineTo(dx4, h);2089 lastUp = false;2090 }2091 2092 //52093 if (dy5 <= 0.5 && lastUp)2094 {2095 c.lineTo(dx5, 0);2096 lastUp = true;2097 }2098 else if (dy5 > 0.5 && !lastUp)2099 {2100 c.lineTo(dx5, h);2101 lastUp = false;2102 }2103 else if (dy5 <= 0.5 && !lastUp)2104 {2105 c.lineTo(dx5, h);2106 c.lineTo(dx5, 0);2107 lastUp = true;2108 }2109 else2110 {2111 c.lineTo(dx5, 0);2112 c.lineTo(dx5, h);2113 lastUp = false;2114 }2115 2116 //62117 if (dy6 <= 0.5 && lastUp)2118 {2119 c.lineTo(w, 0);2120 lastUp = true;2121 }2122 else if (dy6 > 0.5 && !lastUp)2123 {2124 c.lineTo(w, h);2125 lastUp = false;2126 }2127 else if (dy6 <= 0.5 && !lastUp)2128 {2129 c.lineTo(w, h);2130 c.lineTo(w, 0);2131 lastUp = true;2132 }2133 else2134 {2135 c.lineTo(w, 0);2136 c.lineTo(w, h);2137 lastUp = false;2138 }2139 2140 //end2141 c.stroke();2142};21432144mxCellRenderer.registerShape(mxShapeLeanTimeline.prototype.cst.SHAPE_TIMELINE, mxShapeLeanTimeline);21452146Graph.handleFactory[mxShapeLeanTimeline.prototype.cst.SHAPE_TIMELINE] = function(state)2147{2148 var handles = [Graph.createHandle(state, ['dy1'], function(bounds)2149 {2150 var dy1 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy1', 0))));21512152 return new mxPoint(bounds.x, bounds.y + dy1 * bounds.height);2153 }, function(bounds, pt)2154 {2155 this.state.style['dy1'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;2156 })];21572158 var handle2 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds)2159 {21602161 var dx2 = Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dx3', 0)), parseFloat(mxUtils.getValue(this.state.style, 'dx2', 0))));2162 var dy2 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy2', 0))));21632164 return new mxPoint(bounds.x + dx2, bounds.y + dy2 * bounds.height);2165 }, function(bounds, pt)2166 {2167 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;2168 this.state.style['dy2'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;2169 });2170 2171 handles.push(handle2);21722173 var handle3 = Graph.createHandle(state, ['dx3', 'dy3'], function(bounds)2174 {2175 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))));2176 var dy3 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy3', 0))));21772178 return new mxPoint(bounds.x + dx3, bounds.y + dy3 * bounds.height);2179 }, function(bounds, pt)2180 {2181 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;2182 this.state.style['dy3'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;2183 });2184 2185 handles.push(handle3);21862187 var handle4 = Graph.createHandle(state, ['dx4', 'dy4'], function(bounds)2188 {2189 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))));2190 var dy4 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy4', 0))));21912192 return new mxPoint(bounds.x + dx4, bounds.y + dy4 * bounds.height);2193 }, function(bounds, pt)2194 {2195 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;2196 this.state.style['dy4'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;2197 });2198 2199 handles.push(handle4);22002201 var handle5 = Graph.createHandle(state, ['dx5', 'dy5'], function(bounds)2202 {2203 var dx5 = Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx4', 0)), Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx5', 0))));2204 var dy5 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy5', 0))));22052206 return new mxPoint(bounds.x + dx5, bounds.y + dy5 * bounds.height);2207 }, function(bounds, pt)2208 {2209 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;2210 this.state.style['dy5'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;2211 });2212 2213 handles.push(handle5);22142215 var handle6 = Graph.createHandle(state, ['dy6'], function(bounds)2216 {2217 var dy6 = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'dy6', 0))));22182219 return new mxPoint(bounds.x + bounds.width, bounds.y + dy6 * bounds.height);2220 }, function(bounds, pt)2221 {2222 this.state.style['dy6'] = Math.round(1000 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 1000;2223 });22242225 handles.push(handle6);22262227 return handles;2228};