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