clone

a browser-first diagram editor with live svg previews, local drafts and encrypted, accountless sharing

main
diagramzip / renderers / browser-run / frames / diagramsnet / vendor / assets / shapes / bpmn / mxBpmnShape2.js
mxBpmnShape2.js 67.5K
1/**2 * Copyright (c) 2006-2010, JGraph Holdings Ltd3 */4/**5 * Class: mxBpmnShape (DEPRECATED)6 *7 * Extends <mxShape> to implement an cylinder shape. If a8 * custom shape with one filled area and an overlay path is9 * needed, then this shape's <redrawPath> should be overridden.10 * This shape is registered under <mxConstants.SHAPE_CYLINDER>11 * in <mxCellRenderer>.12 * 13 * Constructor: mxBpmnShape14 *15 * Constructs a new cylinder shape.16 * 17 * Parameters:18 * 19 * bounds - <mxRectangle> that defines the bounds. This is stored in20 * <mxShape.bounds>.21 * fill - String that defines the fill color. This is stored in <fill>.22 * stroke - String that defines the stroke color. This is stored in <stroke>.23 * strokewidth - Optional integer that defines the stroke width. Default is24 * 1. This is stored in <strokewidth>.25 */26function mxBpmnShape(bounds, fill, stroke, strokewidth)27{28 mxShape.call(this);29 this.bounds = bounds;30 this.fill = fill;31 this.stroke = stroke;32 this.strokewidth = (strokewidth != null) ? strokewidth : 1;33};3435/**36 * Extends mxShape.37 */38mxUtils.extend(mxBpmnShape, mxShape);3940mxBpmnShape.prototype.customProperties = [41 {name: 'symbol', dispName: 'Event', type: 'enum', defVal:'general', 42 enumList: [{val: 'general', dispName: 'General'}, 43 {val: 'message', dispName: 'Message'}, 44 {val: 'timer', dispName: 'Timer'}, 45 {val: 'escalation', dispName: 'Escalation'}, 46 {val: 'conditional', dispName: 'Conditional'}, 47 {val: 'link', dispName: 'Link'}, 48 {val: 'error', dispName: 'Error'}, 49 {val: 'cancel', dispName: 'Cancel'}, 50 {val: 'compensation', dispName: 'Compensation'}, 51 {val: 'signal', dispName: 'Signal'}, 52 {val: 'multiple', dispName: 'Multiple'}, 53 {val: 'parallelMultiple', dispName: 'Parallel Multiple'}, 54 {val: 'terminate', dispName: 'Terminate'}, 55 {val: 'exclusiveGw', dispName: 'Exclusive Gw'}, 56 {val: 'parallelGw', dispName: 'Parallel Gw'}, 57 {val: 'complexGw', dispName: 'Complex Gw'}]58 },59 {name: 'outline', dispName: 'Event Type', type: 'enum', defVal:'standard', 60 enumList: [{val: 'standard', dispName: 'Standard'}, 61 {val: 'eventInt', dispName: 'Interrupting'}, 62 {val: 'eventNonint', dispName: 'Non-Interrupting'}, 63 {val: 'catching', dispName: 'Catching'}, 64 {val: 'boundInt', dispName: 'Bound Interrupting'}, 65 {val: 'boundNonint', dispName: 'Bound Non-Interrupting'}, 66 {val: 'throwing', dispName: 'Throwing'}, 67 {val: 'end', dispName: 'End'}, 68 {val: 'none', dispName: 'None'}]69 },70 {name: 'background', dispName: 'Background', type: 'enum', defVal:'none',71 enumList: [{val: 'gateway', dispName: 'Gateway'}, 72 {val: 'none', dispName: 'None'}]73}];7475mxBpmnShape.prototype.eventTypeEnum = { 76 START_STANDARD : 'standard', 77 EVENT_SP_INT : 'eventInt', 78 EVENT_SP_NONINT : 'eventNonint',79 CATCHING : 'catching',80 BOUND_INT : 'boundInt',81 BOUND_NONINT : 'boundNonint',82 THROWING : 'throwing',83 END : 'end',84 NONE : 'none',85 GATEWAY : 'gateway'};8687mxBpmnShape.prototype.eventEnum = { 88 GENERAL : 'general', 89 MESSAGE : 'message', 90 TIMER : 'timer', 91 ESCALATION : 'escalation', 92 CONDITIONAL : 'conditional', 93 LINK : 'link', 94 ERROR : 'error', 95 CANCEL : 'cancel', 96 COMPENSATION : 'compensation', 97 SIGNAL : 'signal', 98 MULTIPLE : 'multiple', 99 PAR_MULTI : 'parallelMultiple', 100 TERMINATE : 'terminate',101 GW_EXCLUSIVE : 'exclusiveGw',102 GW_PARALLEL : 'parallelGw',103 GW_COMPLEX : 'complexGw'};104105mxBpmnShape.prototype.miscEnum = {106 OUTLINE : 'outline',107 BACKGROUND : 'background',108 SYMBOL : 'symbol',109 GATEWAY : 'gateway'};110111/**112 * Function: paintVertexShape113 * 114 * Paints the vertex shape.115 */116mxBpmnShape.prototype.paintVertexShape = function(c, x, y, w, h)117{118 this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.BACKGROUND);119 var bg = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.BACKGROUND, mxBpmnShape.prototype.eventTypeEnum.NONE);120121 if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)122 {123 c.setShadow(false);124 }125126 this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.OUTLINE);127 this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.SYMBOL);128}129130/**131 * Function: redrawPath132 *133 * Draws the path for this shape.134 */135mxBpmnShape.prototype.redrawPath = function(c, x, y, w, h, layer)136{137 var bg = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.BACKGROUND, mxBpmnShape.prototype.eventTypeEnum.NONE);138139 if (layer == mxBpmnShape.prototype.miscEnum.BACKGROUND)140 {141 if (bg != null)142 {143 var f = this.backgrounds[bg];144145 if (f != null)146 {147 c.translate(x, y);148 f.call(this, c, x, y, w, h, layer);149 }150 }151 }152 else if (layer == mxBpmnShape.prototype.miscEnum.OUTLINE)153 {154 if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)155 {156 c.translate(w / 4, h / 4);157 h /= 2;158 w /= 2;159 160 //add rhombus connections here161 this.constraints = [162 new mxConnectionConstraint(new mxPoint(0.5, 0), true),163 new mxConnectionConstraint(new mxPoint(0.5, 1), true),164 new mxConnectionConstraint(new mxPoint(0, 0.5), true),165 new mxConnectionConstraint(new mxPoint(1, 0.5), true),166 new mxConnectionConstraint(new mxPoint(0.25, 0.25), false),167 new mxConnectionConstraint(new mxPoint(0.25, 0.75), false),168 new mxConnectionConstraint(new mxPoint(0.75, 0.25), false),169 new mxConnectionConstraint(new mxPoint(0.75, 0.75), false)170 ];171 }172 else173 {174 //add ellipse connections here175 this.constraints = [176 new mxConnectionConstraint(new mxPoint(0.5, 0), true),177 new mxConnectionConstraint(new mxPoint(0.5, 1), true),178 new mxConnectionConstraint(new mxPoint(0, 0.5), true),179 new mxConnectionConstraint(new mxPoint(1, 0.5), true),180 new mxConnectionConstraint(new mxPoint(0.145, 0.145), false),181 new mxConnectionConstraint(new mxPoint(0.145, 0.855), false),182 new mxConnectionConstraint(new mxPoint(0.855, 0.145), false),183 new mxConnectionConstraint(new mxPoint(0.855, 0.855), false)184 ];185 }186187 var o = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.OUTLINE, mxBpmnShape.prototype.eventTypeEnum.NONE);188189 if (o != null)190 {191 var f = this.outlines[o];192193 if (f != null)194 {195 f.call(this, c, x, y, w, h, bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY);196 }197 }198 }199 else if (layer == mxBpmnShape.prototype.miscEnum.SYMBOL)200 {201 if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)202 {203 h /= 2;204 w /= 2;205 }206207 var s = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.SYMBOL, null);208209 if (s != null)210 {211 var f = this.symbols[s];212213 if (f != null)214 {215 var strokeColor = c.state.strokeColor;216 var fillColor = c.state.fillColor;217 var o = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.OUTLINE, mxBpmnShape.prototype.eventTypeEnum.NONE);218219 if (s === mxBpmnShape.prototype.eventEnum.MESSAGE)220 {221 c.translate(w * 0.15, h * 0.3);222 w = w * 0.7;223 h = h * 0.4;224 }225 else if (s === mxBpmnShape.prototype.eventEnum.TIMER)226 {227 c.translate(w * 0.11, h * 0.11);228 w = w * 0.78;229 h = h * 0.78;230 }231 else if (s === mxBpmnShape.prototype.eventEnum.ESCALATION)232 {233 c.translate(w * 0.19, h * 0.15);234 w = w * 0.62;235 h = h * 0.57;236 }237 else if (s === mxBpmnShape.prototype.eventEnum.CONDITIONAL)238 {239 c.translate(w * 0.3, h * 0.16);240 w = w * 0.4;241 h = h * 0.68;242 }243 else if (s === mxBpmnShape.prototype.eventEnum.LINK)244 {245 c.translate(w * 0.27, h * 0.33);246 w = w * 0.46;247 h = h * 0.34;248 }249 else if (s === mxBpmnShape.prototype.eventEnum.ERROR)250 {251 c.translate(w * 0.212, h * 0.243);252 w = w * 0.58;253 h = h * 0.507;254 }255 else if (s === mxBpmnShape.prototype.eventEnum.CANCEL)256 {257 c.translate(w * 0.22, h * 0.22);258 w = w * 0.56;259 h = h * 0.56;260 }261 else if (s === mxBpmnShape.prototype.eventEnum.COMPENSATION)262 {263 c.translate(w * 0.28, h * 0.35);264 w = w * 0.44;265 h = h * 0.3;266 }267 else if (s === mxBpmnShape.prototype.eventEnum.SIGNAL)268 {269 c.translate(w * 0.19, h * 0.15);270 w = w * 0.62;271 h = h * 0.57;272 }273 else if (s === mxBpmnShape.prototype.eventEnum.MULTIPLE)274 {275 c.translate(w * 0.2, h * 0.19);276 w = w * 0.6;277 h = h * 0.565;278 }279 else if (s === mxBpmnShape.prototype.eventEnum.PAR_MULTI)280 {281 c.translate(w * 0.2, h * 0.2);282 w = w * 0.6;283 h = h * 0.6;284 }285 else if (s === mxBpmnShape.prototype.eventEnum.TERMINATE)286 {287 c.translate(w * 0.05, h * 0.05);288 w = w * 0.9;289 h = h * 0.9;290 }291 else if (s === mxBpmnShape.prototype.eventEnum.GW_EXCLUSIVE)292 {293 c.translate(w * 0.12, 0);294 w = w * 0.76;295 }296 297 var isInverse = false;298 299 if (s === 'star')300 {301 c.setFillColor(strokeColor);302 }303 else if (o === mxBpmnShape.prototype.eventTypeEnum.THROWING || o === mxBpmnShape.prototype.eventTypeEnum.END)304 {305 c.setStrokeColor(fillColor);306 c.setFillColor(strokeColor);307 isInverse = true;308 }309310 f.call(this, c, x, y, w, h, layer, isInverse);311 312 if (s === 'star')313 {314 c.setFillColor(fillColor);315 }316 else if (o === mxBpmnShape.prototype.eventTypeEnum.THROWING || o === mxBpmnShape.prototype.eventTypeEnum.END)317 {318 c.setStrokeColor(strokeColor);319 c.setFillColor(fillColor);320 }321 }322 }323 }324};325326//Contains all possible backgrounds327mxBpmnShape.prototype.backgrounds = {328 'none': function(c, x, y, w, h)329 {330 },331 'gateway': function(c, x, y, w, h)332 {333 c.begin();334 c.moveTo(w / 2, 0);335 c.lineTo(w, h / 2);336 c.lineTo(w / 2, h);337 c.lineTo(0, h / 2);338 c.close();339 c.fillAndStroke();340 }341};342343//Contains all possible outlines344mxBpmnShape.prototype.outlines = {345 'none' : function(c, x, y, w, h, isGateway)346 {347 if (!isGateway)348 {349 c.setShadow(false);350 }351 },352 'standard': function(c, x, y, w, h, isGateway)353 {354 c.ellipse(0, 0, w, h);355 c.fillAndStroke();356357 if (!isGateway)358 {359 c.setShadow(false);360 }361 },362 'eventInt': function(c, x, y, w, h, isGateway)363 {364 c.ellipse(0, 0, w, h);365 c.fillAndStroke();366367 if (!isGateway)368 {369 c.setShadow(false);370 }371 },372 'eventNonint': function(c, x, y, w, h, isGateway)373 {374 var dashed = c.state.dashed;375 c.setDashed(true);376 c.ellipse(0, 0, w, h);377 c.fillAndStroke();378 c.setDashed(dashed);379380 if (!isGateway)381 {382 c.setShadow(false);383 }384385 },386 'catching': function(c, x, y, w, h, isGateway)387 {388 c.ellipse(0, 0, w, h);389 c.fillAndStroke();390391 if (!isGateway)392 {393 c.setShadow(false);394 }395396 var inset = 2;397 c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);398 c.stroke();399 },400 'boundInt': function(c, x, y, w, h, isGateway)401 {402 c.ellipse(0, 0, w, h);403 c.fillAndStroke();404405 if (!isGateway)406 {407 c.setShadow(false);408 }409 var inset = 2;410 c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);411 c.stroke();412 },413 'boundNonint': function(c, x, y, w, h, isGateway)414 {415 var dashed = c.state.dashed;416 c.setDashed(true);417 c.ellipse(0, 0, w, h);418 c.fillAndStroke();419420 if (!isGateway)421 {422 c.setShadow(false);423 }424425 var inset = 2;426 c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);427 c.stroke();428 c.setDashed(dashed);429 },430 'throwing': function(c, x, y, w, h, isGateway)431 {432 c.ellipse(0, 0, w, h);433 c.fillAndStroke();434435 if (!isGateway)436 {437 c.setShadow(false);438 }439440 var inset = 2;441 c.ellipse(w * 0.02 + inset, h * 0.02 + inset, w * 0.96 - 2 *inset, h * 0.96 - 2 * inset);442 c.stroke();443 },444 'end': function(c, x, y, w, h, isGateway)445 {446 var sw = c.state.strokeWidth;447 c.setStrokeWidth(sw * 3);448 c.ellipse(0, 0, w, h);449 c.fillAndStroke();450 c.setStrokeWidth(sw);451452 if (!isGateway)453 {454 c.setShadow(false);455 }456 }457};458459//Contains all possible symbols460mxBpmnShape.prototype.symbols = {461 'general' : function(c, x, y, w, h)462 {463 },464 'message': function(c, x, y, w, h, layer, isInverse)465 {466 c.rect(0, 0, w, h);467 c.fillAndStroke();468469 var fc = mxUtils.getValue(this.style, "fillColor", "none");470471 if (fc === 'none')472 {473 if (isInverse)474 {475 c.setStrokeColor('#ffffff');476 }477 }478 479 c.begin();480 c.moveTo(0, 0);481 c.lineTo(w * 0.5, h * 0.5);482 c.lineTo(w, 0);483 c.stroke();484 },485 'timer' : function(c, x, y, w, h)486 {487 c.ellipse(0, 0, w, h);488 c.fillAndStroke();489490 c.begin();491 c.moveTo(w * 0.5, 0);492 c.lineTo(w * 0.5, h * 0.0642);493 c.moveTo(w * 0.7484, h * 0.0654);494 c.lineTo(w * 0.7126, h * 0.1281);495 c.moveTo(w * 0.93, h * 0.2471);496 c.lineTo(w * 0.8673, h * 0.2854);497 c.moveTo(w, h * 0.5);498 c.lineTo(w * 0.9338, h * 0.5);499 c.moveTo(w * 0.93, h * 0.7509);500 c.lineTo(w * 0.8673, h * 0.7126);501 c.moveTo(w * 0.7484, h * 0.9326);502 c.lineTo(w * 0.7126, h * 0.8699);503 c.moveTo(w * 0.5, h * 0.9338);504 c.lineTo(w * 0.5, h);505 c.moveTo(w * 0.2496, h * 0.9325);506 c.lineTo(w * 0.2854, h * 0.8699);507 c.moveTo(w * 0.068, h * 0.7509);508 c.lineTo(w * 0.1307, h * 0.7126);509 c.moveTo(0, h * 0.5);510 c.lineTo(w * 0.0642, h * 0.5);511 c.moveTo(w * 0.068, h * 0.2471);512 c.lineTo(w * 0.1307, h * 0.2854);513 c.moveTo(w * 0.2496, h * 0.0654);514 c.lineTo(w * 0.2854, h * 0.1281);515 c.moveTo(w * 0.5246, h * 0.0706);516 c.lineTo(w * 0.5, h * 0.5);517 c.lineTo(w * 0.7804, h * 0.5118); 518 c.stroke();519 },520 'escalation' : function(c, x, y, w, h)521 {522 c.begin();523 c.moveTo(0, h);524 c.lineTo(w * 0.5, 0);525 c.lineTo(w, h);526 c.lineTo(w * 0.5, h * 0.5);527 c.close();528 c.fillAndStroke();529 },530 'conditional' : function(c, x, y, w, h)531 {532 c.rect(0, 0, w, h);533 c.fillAndStroke();534 c.begin();535 c.moveTo(0, h * 0.1027);536 c.lineTo(w * 0.798, h * 0.1027);537 c.moveTo(0, h * 0.3669);538 c.lineTo(w * 0.798, h * 0.3669);539 c.moveTo(0, h * 0.6311);540 c.lineTo(w * 0.798, h * 0.6311);541 c.moveTo(0, h * 0.8953);542 c.lineTo(w * 0.798, h * 0.8953);543 c.stroke();544 },545 'link' : function(c, x, y, w, h)546 {547 c.begin();548 c.moveTo(0, h * 0.76);549 c.lineTo(0, h * 0.24);550 c.lineTo(w * 0.63, h * 0.24);551 c.lineTo(w * 0.63, 0);552 c.lineTo(w, h * 0.5);553 c.lineTo(w * 0.63, h);554 c.lineTo(w * 0.63, h * 0.76);555 c.close();556 c.fillAndStroke();557 },558 'error' : function(c, x, y, w, h, layer, isInverse)559 {560 c.begin();561 c.moveTo(0, h);562 c.lineTo(w * 0.3287, h * 0.123);563 c.lineTo(w * 0.6194, h * 0.6342);564 c.lineTo(w, 0);565 c.lineTo(w * 0.6625, h * 0.939);566 c.lineTo(w * 0.3717, h * 0.5064);567 c.close();568 if(isInverse)569 {570 c.fill();571 }572 else573 {574 c.fillAndStroke();575 }576 },577 'cancel' : function(c, x, y, w, h)578 {579 c.begin();580 c.moveTo(w * 0.1051, 0);581 c.lineTo(w * 0.5, h * 0.3738);582 c.lineTo(w * 0.8909, 0);583 c.lineTo(w, h * 0.1054);584 c.lineTo(w * 0.623, h * 0.5);585 c.lineTo(w, h * 0.8926);586 c.lineTo(w * 0.8909, h);587 c.lineTo(w * 0.5, h * 0.6242);588 c.lineTo(w * 0.1051, h);589 c.lineTo(0, h * 0.8926);590 c.lineTo(w * 0.373, h * 0.5);591 c.lineTo(0, h * 0.1054);592 c.close();593 c.fillAndStroke();594 },595 'compensation' : function(c, x, y, w, h)596 {597 c.begin();598 c.moveTo(0, h * 0.5);599 c.lineTo(w * 0.5, 0);600 c.lineTo(w * 0.5, h);601 c.close();602 c.moveTo(w * 0.5, h * 0.5);603 c.lineTo(w, 0);604 c.lineTo(w, h);605 c.close();606 c.fillAndStroke();607 },608 'signal' : function(c, x, y, w, h)609 {610 c.begin();611 c.moveTo(0, h);612 c.lineTo(w * 0.5, 0);613 c.lineTo(w, h);614 c.close();615 c.fillAndStroke();616 },617 'multiple' : function(c, x, y, w, h)618 {619 c.begin();620 c.moveTo(0, h * 0.39);621 c.lineTo(w * 0.5, 0);622 c.lineTo(w, h * 0.39);623 c.lineTo(w * 0.815, h);624 c.lineTo(w * 0.185, h);625 c.close();626 c.fillAndStroke();627 },628 'parallelMultiple' : function(c, x, y, w, h)629 {630 c.begin();631 c.moveTo(w * 0.38, 0);632 c.lineTo(w * 0.62, 0);633 c.lineTo(w * 0.62, h * 0.38);634 c.lineTo(w, h * 0.38);635 c.lineTo(w, h * 0.62);636 c.lineTo(w * 0.62, h * 0.62);637 c.lineTo(w * 0.62, h);638 c.lineTo(w * 0.38, h);639 c.lineTo(w * 0.38, h * 0.62);640 c.lineTo(0, h * 0.62);641 c.lineTo(0, h * 0.38);642 c.lineTo(w * 0.38, h * 0.38);643 c.close();644 c.fillAndStroke();645 },646 'terminate' : function(c, x, y, w, h)647 {648 c.ellipse(0, 0, w, h);649 c.fillAndStroke();650 },651 'exclusiveGw' : function(c, x, y, w, h)652 {653 var strokeColor = c.state.strokeColor;654 var fillColor = c.state.fillColor;655 c.setStrokeColor(fillColor);656 c.setFillColor(strokeColor);657658 c.begin();659 c.moveTo(w * 0.105, 0);660 c.lineTo(w * 0.5, h * 0.38);661 c.lineTo(w * 0.895, h * 0);662 c.lineTo(w, h * 0.11);663 c.lineTo(w * 0.6172, h * 0.5);664 c.lineTo(w, h * 0.89);665 c.lineTo(w * 0.895, h);666 c.lineTo(w * 0.5, h * 0.62);667 c.lineTo(w * 0.105, h);668 c.lineTo(0, h * 0.89);669 c.lineTo(w * 0.3808, h * 0.5);670 c.lineTo(0, h * 0.11);671 c.close();672 c.fillAndStroke();673674 c.setStrokeColor(strokeColor);675 c.setFillColor(fillColor);676677 },678 'parallelGw' : function(c, x, y, w, h)679 {680 var strokeColor = c.state.strokeColor;681 var fillColor = c.state.fillColor;682 c.setStrokeColor(fillColor);683 c.setFillColor(strokeColor);684685 c.begin();686 c.moveTo(w * 0.38, 0);687 c.lineTo(w * 0.62, 0);688 c.lineTo(w * 0.62, h * 0.38);689 c.lineTo(w, h * 0.38);690 c.lineTo(w, h * 0.62);691 c.lineTo(w * 0.62, h * 0.62);692 c.lineTo(w * 0.62, h);693 c.lineTo(w * 0.38, h);694 c.lineTo(w * 0.38, h * 0.62);695 c.lineTo(0, h * 0.62);696 c.lineTo(0, h * 0.38);697 c.lineTo(w * 0.38, h * 0.38);698 c.close();699 c.fillAndStroke();700701 c.setStrokeColor(strokeColor);702 c.setFillColor(fillColor);703 },704 'complexGw' : function(c, x, y, w, h)705 {706 var strokeColor = c.state.strokeColor;707 var fillColor = c.state.fillColor;708 c.setStrokeColor(fillColor);709 c.setFillColor(strokeColor);710711 c.begin();712 c.moveTo(0, h * 0.44);713 c.lineTo(w * 0.36, h * 0.44);714 c.lineTo(w * 0.1, h * 0.18);715 c.lineTo(w * 0.18, h * 0.1);716 c.lineTo(w * 0.44, h * 0.36);717 c.lineTo(w * 0.44, 0);718 c.lineTo(w * 0.56, 0);719 c.lineTo(w * 0.56, h * 0.36);720 c.lineTo(w * 0.82, h * 0.1);721 c.lineTo(w * 0.90, h * 0.18);722 c.lineTo(w * 0.64, h * 0.44);723 c.lineTo(w, h * 0.44);724 c.lineTo(w, h * 0.56);725 c.lineTo(w * 0.64, h * 0.56);726 c.lineTo(w * 0.9, h * 0.82);727 c.lineTo(w * 0.82, h * 0.9);728 c.lineTo(w * 0.56, h * 0.64);729 c.lineTo(w * 0.56, h);730 c.lineTo(w * 0.44, h);731 c.lineTo(w * 0.44, h * 0.64);732 c.lineTo(w * 0.18, h * 0.9);733 c.lineTo(w * 0.1, h * 0.82);734 c.lineTo(w * 0.36, h * 0.56);735 c.lineTo(0, h * 0.56);736 c.close();737 c.fillAndStroke();738739 c.setStrokeColor(strokeColor);740 c.setFillColor(fillColor);741 },742 'star': function(c, x, y, w, h)743 {744 c.translate(w / 5, h / 6);745 h *= 2 / 3;746 w *= 3 / 5;747 748 c.begin();749 c.moveTo(0, h / 4);750 c.lineTo(w / 3, h / 4);751 c.lineTo(w / 2, 0);752 c.lineTo(2 * w / 3, h / 4);753 c.lineTo(w, h / 4);754 c.lineTo(5 * w / 6, h / 2);755 c.lineTo(w, 3 * h / 4);756 c.lineTo(2 * w / 3, 3 * h / 4);757 c.lineTo(w / 2, h);758 c.lineTo(w / 3, 3 * h / 4);759 c.lineTo(0, 3 * h / 4);760 c.lineTo(w / 6, h / 2);761 c.close();762 c.fillAndStroke();763 }764};765766mxCellRenderer.registerShape('mxgraph.bpmn.shape', mxBpmnShape);767768//**********************************************************************************************************************************************************769//Send / Receive marker770//**********************************************************************************************************************************************************771/**772* Extends mxShape.773*/774function mxShapeBpmn2SendMarker(bounds, fill, stroke, strokewidth)775{776 mxShape.call(this);777 this.bounds = bounds;778 this.fill = fill;779 this.stroke = stroke;780 this.strokewidth = (strokewidth != null) ? strokewidth : 1;781 this.dy = 0.5;782 this.dx = 0.5;783 this.notch = 0;784};785786/**787* Extends mxShape.788*/789mxUtils.extend(mxShapeBpmn2SendMarker, mxActor);790791mxShapeBpmn2SendMarker.prototype.cst = {792 SEND : 'mxgraph.bpmn.sendMarker'793};794795/**796* Function: paintVertexShape797* 798* Paints the vertex shape.799*/800mxShapeBpmn2SendMarker.prototype.paintVertexShape = function(c, x, y, w, h)801{802 c.translate(x, y);803804 c.rect(0, 0, w, h);805 c.fillAndStroke();806 807 c.setShadow(false);808809 c.begin();810 c.moveTo(0,0);811 c.lineTo(w * 0.5, h * 0.5);812 c.lineTo(w, 0);813 c.stroke();814};815816mxCellRenderer.registerShape(mxShapeBpmn2SendMarker.prototype.cst.SEND, mxShapeBpmn2SendMarker);817818819// BPMN event shape820function mxShapeBpmnEvent(bounds, fill, stroke, strokewidth)821{822 mxShape.call(this);823 this.bounds = bounds;824 this.fill = fill;825 this.stroke = stroke;826 this.strokewidth = (strokewidth != null) ? strokewidth : 1;827};828829/**830 * Extends mxShape.831 */832mxUtils.extend(mxShapeBpmnEvent, mxShape);833834mxShapeBpmnEvent.prototype.eventTypeEnum = { 835 START_STANDARD : 'standard', 836 EVENT_SP_INT : 'eventInt', 837 EVENT_SP_NONINT : 'eventNonint',838 CATCHING : 'catching',839 BOUND_INT : 'boundInt',840 BOUND_NONINT : 'boundNonint',841 THROWING : 'throwing',842 END : 'end',843 NONE : 'none'};844845mxShapeBpmnEvent.prototype.eventEnum = { 846 GENERAL : 'general', 847 MESSAGE : 'message', 848 TIMER : 'timer', 849 ESCALATION : 'escalation', 850 CONDITIONAL : 'conditional', 851 LINK : 'link', 852 ERROR : 'error', 853 CANCEL : 'cancel', 854 COMPENSATION : 'compensation', 855 SIGNAL : 'signal', 856 MULTIPLE : 'multiple', 857 PAR_MULTI : 'parallelMultiple', 858 TERMINATE : 'terminate'};859860mxShapeBpmnEvent.prototype.miscEnum = {861 OUTLINE : 'outline',862 SYMBOL : 'symbol'};863864mxShapeBpmnEvent.prototype.customProperties = [865 {name: mxShapeBpmnEvent.prototype.miscEnum.SYMBOL, dispName: 'Event', type: 'enum', defVal:mxShapeBpmnEvent.prototype.eventEnum.GENERAL, 866 enumList: [{val: mxShapeBpmnEvent.prototype.eventEnum.GENERAL, dispName: 'General'}, 867 {val: mxShapeBpmnEvent.prototype.eventEnum.MESSAGE, dispName: 'Message'}, 868 {val: mxShapeBpmnEvent.prototype.eventEnum.TIMER, dispName: 'Timer'}, 869 {val: mxShapeBpmnEvent.prototype.eventEnum.ESCALATION, dispName: 'Escalation'}, 870 {val: mxShapeBpmnEvent.prototype.eventEnum.CONDITIONAL, dispName: 'Conditional'}, 871 {val: mxShapeBpmnEvent.prototype.eventEnum.LINK, dispName: 'Link'}, 872 {val: mxShapeBpmnEvent.prototype.eventEnum.ERROR, dispName: 'Error'}, 873 {val: mxShapeBpmnEvent.prototype.eventEnum.CANCEL, dispName: 'Cancel'}, 874 {val: mxShapeBpmnEvent.prototype.eventEnum.COMPENSATION, dispName: 'Compensation'}, 875 {val: mxShapeBpmnEvent.prototype.eventEnum.SIGNAL, dispName: 'Signal'}, 876 {val: mxShapeBpmnEvent.prototype.eventEnum.MULTIPLE, dispName: 'Multiple'}, 877 {val: mxShapeBpmnEvent.prototype.eventEnum.PAR_MULTI, dispName: 'Parallel Multiple'}, 878 {val: mxShapeBpmnEvent.prototype.eventEnum.TERMINATE, dispName: 'Terminate'}]879 },880 {name: mxShapeBpmnEvent.prototype.miscEnum.OUTLINE, dispName: 'Event Type', type: 'enum', defVal:mxShapeBpmnEvent.prototype.eventTypeEnum.START_STANDARD, 881 enumList: [{val: mxShapeBpmnEvent.prototype.eventTypeEnum.START_STANDARD, dispName: 'Standard'}, 882 {val: mxShapeBpmnEvent.prototype.eventTypeEnum.EVENT_SP_INT, dispName: 'Interrupting'}, 883 {val: mxShapeBpmnEvent.prototype.eventTypeEnum.EVENT_SP_NONINT, dispName: 'Non-Interrupting'}, 884 {val: mxShapeBpmnEvent.prototype.eventTypeEnum.CATCHING, dispName: 'Catching'}, 885 {val: mxShapeBpmnEvent.prototype.eventTypeEnum.BOUND_INT, dispName: 'Bound Interrupting'}, 886 {val: mxShapeBpmnEvent.prototype.eventTypeEnum.BOUND_NONINT, dispName: 'Bound Non-Interrupting'}, 887 {val: mxShapeBpmnEvent.prototype.eventTypeEnum.THROWING, dispName: 'Throwing'}, 888 {val: mxShapeBpmnEvent.prototype.eventTypeEnum.END, dispName: 'End'}, 889 {val: mxShapeBpmnEvent.prototype.eventTypeEnum.NONE, dispName: 'None'}]890}];891892/**893* Function: paintVertexShape894* 895* Paints the vertex shape.896*/897mxShapeBpmnEvent.prototype.paintVertexShape = function(c, x, y, w, h)898{899 c.translate(x, y);900 this.strictDrawShape(c, 0, 0, w, h, null);901}902903mxShapeBpmnEvent.prototype.strictDrawShape = function(c, x, y, w, h, outline, symbol)904{905 // draw event outline906 if (outline == null)907 {908 outline = mxUtils.getValue(this.style, this.miscEnum.OUTLINE, this.eventTypeEnum.NONE);909 }910911 if (outline != null)912 {913 var f = mxShapeBpmnEvent.prototype.outlines[outline];914915 if (f != null)916 {917 c.translate(x,y);918 f.call(this, c, x, y, w, h);919 }920 }921 922 // draw event symbol923 if (symbol == null)924 {925 symbol = mxUtils.getValue(this.style, this.miscEnum.SYMBOL, null);926 }927928 if (symbol != null)929 {930 var f = mxShapeBpmnEvent.prototype.symbols[symbol];931932 if (f != null)933 {934 var strokeColor = c.state.strokeColor;935 var fillColor = c.state.fillColor;936937 if (symbol === this.eventEnum.MESSAGE)938 {939 c.translate(w * 0.15, h * 0.3);940 w = w * 0.7;941 h = h * 0.4;942 }943 else if (symbol === this.eventEnum.TIMER)944 {945 c.translate(w * 0.11, h * 0.11);946 w = w * 0.78;947 h = h * 0.78;948 }949 else if (symbol === this.eventEnum.ESCALATION)950 {951 c.translate(w * 0.19, h * 0.15);952 w = w * 0.62;953 h = h * 0.57;954 }955 else if (symbol === this.eventEnum.CONDITIONAL)956 {957 c.translate(w * 0.3, h * 0.16);958 w = w * 0.4;959 h = h * 0.68;960 }961 else if (symbol === this.eventEnum.LINK)962 {963 c.translate(w * 0.27, h * 0.33);964 w = w * 0.46;965 h = h * 0.34;966 }967 else if (symbol === this.eventEnum.ERROR)968 {969 c.translate(w * 0.212, h * 0.243);970 w = w * 0.58;971 h = h * 0.507;972 }973 else if (symbol === this.eventEnum.CANCEL)974 {975 c.translate(w * 0.22, h * 0.22);976 w = w * 0.56;977 h = h * 0.56;978 }979 else if (symbol === this.eventEnum.COMPENSATION)980 {981 c.translate(w * 0.28, h * 0.35);982 w = w * 0.44;983 h = h * 0.3;984 }985 else if (symbol === this.eventEnum.SIGNAL)986 {987 c.translate(w * 0.19, h * 0.15);988 w = w * 0.62;989 h = h * 0.57;990 }991 else if (symbol === this.eventEnum.MULTIPLE)992 {993 c.translate(w * 0.2, h * 0.19);994 w = w * 0.6;995 h = h * 0.565;996 }997 else if (symbol === this.eventEnum.PAR_MULTI)998 {999 c.translate(w * 0.2, h * 0.2);1000 w = w * 0.6;1001 h = h * 0.6;1002 }1003 else if (symbol === this.eventEnum.TERMINATE)1004 {1005 c.translate(w * 0.05, h * 0.05);1006 w = w * 0.9;1007 h = h * 0.9;1008 }1009 else if (symbol === this.eventEnum.GW_EXCLUSIVE)1010 {1011 c.translate(w * 0.12, 0);1012 w = w * 0.76;1013 }1014 1015 var isInverse = false;1016 1017 if (symbol === 'star')1018 {1019 c.setFillColor(strokeColor);1020 }1021 else if (outline === this.eventTypeEnum.THROWING || outline === this.eventTypeEnum.END)1022 {1023 c.setStrokeColor(fillColor);1024 c.setFillColor(strokeColor);1025 isInverse = true;1026 }10271028 f.call(this, c, x, y, w, h, isInverse);1029 1030 if (symbol === 'star')1031 {1032 c.setFillColor(fillColor);1033 }1034 else if (outline === this.eventTypeEnum.THROWING || outline === this.eventTypeEnum.END)1035 {1036 c.setStrokeColor(strokeColor);1037 c.setFillColor(fillColor);1038 }1039 }1040 }1041}10421043//Contains all possible outlines1044mxShapeBpmnEvent.prototype.outlines = {1045 'none' : function(c, x, y, w, h)1046 {1047 c.setShadow(false);1048 },1049 'standard': function(c, x, y, w, h)1050 {1051 c.ellipse(0, 0, w, h);1052 c.fillAndStroke();10531054 c.setShadow(false);1055 },1056 'eventInt': function(c, x, y, w, h)1057 {1058 c.ellipse(0, 0, w, h);1059 c.fillAndStroke();10601061 c.setShadow(false);1062 },1063 'eventNonint': function(c, x, y, w, h)1064 {1065 var dashed = c.state.dashed;1066 c.setDashed(true);1067 c.ellipse(0, 0, w, h);1068 c.fillAndStroke();1069 c.setDashed(dashed);10701071 c.setShadow(false);1072 },1073 'catching': function(c, x, y, w, h)1074 {1075 c.ellipse(0, 0, w, h);1076 c.fillAndStroke();10771078 c.setShadow(false);10791080 var inset = 2;1081 c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);1082 c.stroke();1083 },1084 'boundInt': function(c, x, y, w, h)1085 {1086 c.ellipse(0, 0, w, h);1087 c.fillAndStroke();10881089 c.setShadow(false);1090 1091 var inset = 2;1092 c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);1093 c.stroke();1094 },1095 'boundNonint': function(c, x, y, w, h)1096 {1097 var dashed = c.state.dashed;1098 c.setDashed(true);1099 c.ellipse(0, 0, w, h);1100 c.fillAndStroke();11011102 c.setShadow(false);11031104 var inset = 2;1105 c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);1106 c.stroke();1107 c.setDashed(dashed);1108 },1109 'throwing': function(c, x, y, w, h)1110 {1111 c.ellipse(0, 0, w, h);1112 c.fillAndStroke();11131114 c.setShadow(false);11151116 var inset = 2;1117 c.ellipse(w * 0.02 + inset, h * 0.02 + inset, w * 0.96 - 2 *inset, h * 0.96 - 2 * inset);1118 c.stroke();1119 },1120 'end': function(c, x, y, w, h)1121 {1122 var sw = c.state.strokeWidth;1123 c.setStrokeWidth(sw * 3);1124 c.ellipse(0, 0, w, h);1125 c.fillAndStroke();1126 c.setStrokeWidth(sw);11271128 c.setShadow(false);1129 }1130};11311132//Contains all possible symbols1133mxShapeBpmnEvent.prototype.symbols = {1134 'general' : function(c, x, y, w, h, isInverse)1135 {1136 },1137 'message': function(c, x, y, w, h, isInverse)1138 {1139 c.rect(0, 0, w, h);1140 c.fillAndStroke();11411142 var fc = mxUtils.getValue(this.style, "fillColor", "none");11431144 if (fc === 'none')1145 {1146 if (isInverse)1147 {1148 c.setStrokeColor('#ffffff');1149 }1150 }1151 1152 c.begin();1153 c.moveTo(0, 0);1154 c.lineTo(w * 0.5, h * 0.5);1155 c.lineTo(w, 0);1156 c.stroke();1157 },1158 'timer' : function(c, x, y, w, h, isInverse)1159 {1160 c.ellipse(0, 0, w, h);1161 c.fillAndStroke();11621163 c.begin();1164 c.moveTo(w * 0.5, 0);1165 c.lineTo(w * 0.5, h * 0.0642);1166 c.moveTo(w * 0.7484, h * 0.0654);1167 c.lineTo(w * 0.7126, h * 0.1281);1168 c.moveTo(w * 0.93, h * 0.2471);1169 c.lineTo(w * 0.8673, h * 0.2854);1170 c.moveTo(w, h * 0.5);1171 c.lineTo(w * 0.9338, h * 0.5);1172 c.moveTo(w * 0.93, h * 0.7509);1173 c.lineTo(w * 0.8673, h * 0.7126);1174 c.moveTo(w * 0.7484, h * 0.9326);1175 c.lineTo(w * 0.7126, h * 0.8699);1176 c.moveTo(w * 0.5, h * 0.9338);1177 c.lineTo(w * 0.5, h);1178 c.moveTo(w * 0.2496, h * 0.9325);1179 c.lineTo(w * 0.2854, h * 0.8699);1180 c.moveTo(w * 0.068, h * 0.7509);1181 c.lineTo(w * 0.1307, h * 0.7126);1182 c.moveTo(0, h * 0.5);1183 c.lineTo(w * 0.0642, h * 0.5);1184 c.moveTo(w * 0.068, h * 0.2471);1185 c.lineTo(w * 0.1307, h * 0.2854);1186 c.moveTo(w * 0.2496, h * 0.0654);1187 c.lineTo(w * 0.2854, h * 0.1281);1188 c.moveTo(w * 0.5246, h * 0.0706);1189 c.lineTo(w * 0.5, h * 0.5);1190 c.lineTo(w * 0.7804, h * 0.5118); 1191 c.stroke();1192 },1193 'escalation' : function(c, x, y, w, h, isInverse)1194 {1195 c.setMiterLimit(6);1196 c.begin();1197 c.moveTo(0, h);1198 c.lineTo(w * 0.5, 0);1199 c.lineTo(w, h);1200 c.lineTo(w * 0.5, h * 0.5);1201 c.close();1202 1203 if (isInverse)1204 {1205 c.fill();1206 }1207 else1208 {1209 c.fillAndStroke();1210 }1211 },1212 'conditional' : function(c, x, y, w, h, isInverse)1213 {1214 c.rect(0, 0, w, h);1215 c.fillAndStroke();1216 c.begin();1217 c.moveTo(0, h * 0.1027);1218 c.lineTo(w * 0.798, h * 0.1027);1219 c.moveTo(0, h * 0.3669);1220 c.lineTo(w * 0.798, h * 0.3669);1221 c.moveTo(0, h * 0.6311);1222 c.lineTo(w * 0.798, h * 0.6311);1223 c.moveTo(0, h * 0.8953);1224 c.lineTo(w * 0.798, h * 0.8953);1225 c.stroke();1226 },1227 'link' : function(c, x, y, w, h, isInverse)1228 {1229 c.begin();1230 c.moveTo(0, h * 0.76);1231 c.lineTo(0, h * 0.24);1232 c.lineTo(w * 0.63, h * 0.24);1233 c.lineTo(w * 0.63, 0);1234 c.lineTo(w, h * 0.5);1235 c.lineTo(w * 0.63, h);1236 c.lineTo(w * 0.63, h * 0.76);1237 c.close();1238 1239 isInverse ? c.fill() : c.fillAndStroke();1240 },1241 'error' : function(c, x, y, w, h, isInverse)1242 {1243 c.setMiterLimit(7);1244 c.begin();1245 c.moveTo(0, h);1246 c.lineTo(w * 0.3287, h * 0.123);1247 c.lineTo(w * 0.6194, h * 0.6342);1248 c.lineTo(w, 0);1249 c.lineTo(w * 0.6625, h * 0.939);1250 c.lineTo(w * 0.3717, h * 0.5064);1251 c.close();1252 1253 isInverse ? c.fill() : c.fillAndStroke();1254 },1255 'cancel' : function(c, x, y, w, h, isInverse)1256 {1257 c.begin();1258 c.moveTo(w * 0.1051, 0);1259 c.lineTo(w * 0.5, h * 0.3738);1260 c.lineTo(w * 0.8909, 0);1261 c.lineTo(w, h * 0.1054);1262 c.lineTo(w * 0.623, h * 0.5);1263 c.lineTo(w, h * 0.8926);1264 c.lineTo(w * 0.8909, h);1265 c.lineTo(w * 0.5, h * 0.6242);1266 c.lineTo(w * 0.1051, h);1267 c.lineTo(0, h * 0.8926);1268 c.lineTo(w * 0.373, h * 0.5);1269 c.lineTo(0, h * 0.1054);1270 c.close();1271 1272 isInverse ? c.fill() : c.fillAndStroke();1273 },1274 'compensation' : function(c, x, y, w, h, isInverse)1275 {1276 c.setMiterLimit(1);1277 c.begin();1278 c.moveTo(0, h * 0.5);1279 c.lineTo(w * 0.5, 0);1280 c.lineTo(w * 0.5, h);1281 c.close();1282 c.moveTo(w * 0.5, h * 0.5);1283 c.lineTo(w, 0);1284 c.lineTo(w, h);1285 c.close();1286 1287 isInverse ? c.fill() : c.fillAndStroke();1288 },1289 'signal' : function(c, x, y, w, h, isInverse)1290 {1291 c.begin();1292 c.moveTo(0, h);1293 c.lineTo(w * 0.5, 0);1294 c.lineTo(w, h);1295 c.close();1296 1297 isInverse ? c.fill() : c.fillAndStroke();1298 },1299 'multiple' : function(c, x, y, w, h, isInverse)1300 {1301 c.begin();1302 c.moveTo(0, h * 0.39);1303 c.lineTo(w * 0.5, 0);1304 c.lineTo(w, h * 0.39);1305 c.lineTo(w * 0.815, h);1306 c.lineTo(w * 0.185, h);1307 c.close();1308 1309 isInverse ? c.fill() : c.fillAndStroke();1310 },1311 'parallelMultiple' : function(c, x, y, w, h, isInverse)1312 {1313 c.begin();1314 c.moveTo(w * 0.38, 0);1315 c.lineTo(w * 0.62, 0);1316 c.lineTo(w * 0.62, h * 0.38);1317 c.lineTo(w, h * 0.38);1318 c.lineTo(w, h * 0.62);1319 c.lineTo(w * 0.62, h * 0.62);1320 c.lineTo(w * 0.62, h);1321 c.lineTo(w * 0.38, h);1322 c.lineTo(w * 0.38, h * 0.62);1323 c.lineTo(0, h * 0.62);1324 c.lineTo(0, h * 0.38);1325 c.lineTo(w * 0.38, h * 0.38);1326 c.close();1327 1328 isInverse ? c.fill() : c.fillAndStroke();1329 },1330 'terminate' : function(c, x, y, w, h, isInverse)1331 {1332 c.ellipse(0, 0, w, h);1333 c.fillAndStroke();1334 },1335 'star': function(c, x, y, w, h, isInverse)1336 {1337 c.translate(w / 5, h / 6);1338 h *= 2 / 3;1339 w *= 3 / 5;1340 1341 c.begin();1342 c.moveTo(0, h / 4);1343 c.lineTo(w / 3, h / 4);1344 c.lineTo(w / 2, 0);1345 c.lineTo(2 * w / 3, h / 4);1346 c.lineTo(w, h / 4);1347 c.lineTo(5 * w / 6, h / 2);1348 c.lineTo(w, 3 * h / 4);1349 c.lineTo(2 * w / 3, 3 * h / 4);1350 c.lineTo(w / 2, h);1351 c.lineTo(w / 3, 3 * h / 4);1352 c.lineTo(0, 3 * h / 4);1353 c.lineTo(w / 6, h / 2);1354 c.close();1355 c.fillAndStroke();1356 }1357};13581359mxCellRenderer.registerShape('mxgraph.bpmn.event', mxShapeBpmnEvent);13601361//BPMN gateway shape1362function mxShapeBpmnGateway(bounds, fill, stroke, strokewidth)1363{1364 mxShape.call(this);1365 this.bounds = bounds;1366 this.fill = fill;1367 this.stroke = stroke;1368 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1369};13701371/**1372 * Extends mxShape.1373 */1374mxUtils.extend(mxShapeBpmnGateway, mxShape);13751376mxShapeBpmnGateway.prototype.customProperties = mxShapeBpmnEvent.prototype.customProperties;1377mxShapeBpmnGateway.prototype.eventTypeEnum = mxShapeBpmnEvent.prototype.eventTypeEnum; 1378mxShapeBpmnGateway.prototype.eventEnum = mxShapeBpmnEvent.prototype.eventEnum; 1379mxShapeBpmnGateway.prototype.miscEnum = mxShapeBpmnEvent.prototype.miscEnum;13801381mxShapeBpmnGateway.prototype.customProperties = mxShapeBpmnGateway.prototype.customProperties.concat(1382 {name: 'gwType', dispName: 'Gateway type', type: 'enum', defVal:'event', 1383 enumList: [{val: 'event', dispName: 'Event-based'}, 1384 {val: 'exclusive', dispName: 'Exclusive'}, 1385 {val: 'parallel', dispName: 'Parallel'}, 1386 {val: 'complex', dispName: 'Complex'}]});13871388/**1389* Function: paintVertexShape1390* 1391* Paints the vertex shape.1392*/1393mxShapeBpmnGateway.prototype.paintVertexShape = function(c, x, y, w, h)1394{1395 c.translate(x, y);13961397 c.begin();1398 c.moveTo(w * 0.5, 0);1399 c.lineTo(w, h * 0.5);1400 c.lineTo(w * 0.5, h);1401 c.lineTo(0, h * 0.5);1402 c.close();1403 c.fillAndStroke();14041405 c.setShadow(false);1406 1407 var symbolW = w * 0.6;1408 var symbolH = h * 0.6;1409 1410 var gwType = mxUtils.getValue(this.style, 'gwType', 'event');1411 var outline = mxUtils.getValue(this.style, 'outline', 'none');1412 var symbol = mxUtils.getValue(this.style, 'symbol', 'standard');1413 var tmpW = w * 0.5;1414 var tmpH = h * 0.5;1415 1416 if (gwType === 'event' && outline !== null && outline !== 'none')1417 {1418 mxShapeBpmnEvent.prototype.strictDrawShape.call(this, c, (w - symbolW) * 0.5, (h - symbolH) * 0.5, symbolW, symbolH, outline, symbol);1419 }1420 else if (gwType == 'exclusive')1421 {1422 c.translate(w * 0.31, h * 0.25);1423 tmpW = tmpW * 0.76;1424 var strokeColor = c.state.strokeColor;1425 var fillColor = c.state.fillColor;1426 c.setFillColor(strokeColor);14271428 c.begin();1429 c.moveTo(tmpW * 0.105, 0);1430 c.lineTo(tmpW * 0.5, tmpH * 0.38);1431 c.lineTo(tmpW * 0.895, tmpH * 0);1432 c.lineTo(tmpW, tmpH * 0.11);1433 c.lineTo(tmpW * 0.6172, tmpH * 0.5);1434 c.lineTo(tmpW, tmpH * 0.89);1435 c.lineTo(tmpW * 0.895, tmpH);1436 c.lineTo(tmpW * 0.5, tmpH * 0.62);1437 c.lineTo(tmpW * 0.105, tmpH);1438 c.lineTo(0, tmpH * 0.89);1439 c.lineTo(tmpW * 0.3808, tmpH * 0.5);1440 c.lineTo(0, tmpH * 0.11);1441 c.close();1442 c.fillAndStroke();14431444 c.setFillColor(fillColor);1445 c.translate(-tmpW * 0.12, 0);1446 }1447 else if (gwType == 'parallel')1448 {1449 c.translate(w * 0.25, h * 0.25);1450 var strokeColor = c.state.strokeColor;1451 var fillColor = c.state.fillColor;1452 c.setFillColor(strokeColor);14531454 c.begin();1455 c.moveTo(tmpW * 0.38, 0);1456 c.lineTo(tmpW * 0.62, 0);1457 c.lineTo(tmpW * 0.62, tmpH * 0.38);1458 c.lineTo(tmpW, tmpH * 0.38);1459 c.lineTo(tmpW, tmpH * 0.62);1460 c.lineTo(tmpW * 0.62, tmpH * 0.62);1461 c.lineTo(tmpW * 0.62, tmpH);1462 c.lineTo(tmpW * 0.38, tmpH);1463 c.lineTo(tmpW * 0.38, tmpH * 0.62);1464 c.lineTo(0, tmpH * 0.62);1465 c.lineTo(0, tmpH * 0.38);1466 c.lineTo(tmpW * 0.38, tmpH * 0.38);1467 c.close();1468 c.fillAndStroke();14691470 c.setFillColor(fillColor);1471 }1472 else if (gwType == 'complex')1473 {1474 c.translate(w * 0.25, h * 0.25);1475 var strokeColor = c.state.strokeColor;1476 var fillColor = c.state.fillColor;1477 c.setFillColor(strokeColor);14781479 c.begin();1480 c.moveTo(0, tmpH * 0.44);1481 c.lineTo(tmpW * 0.36, tmpH * 0.44);1482 c.lineTo(tmpW * 0.1, tmpH * 0.18);1483 c.lineTo(tmpW * 0.18, tmpH * 0.1);1484 c.lineTo(tmpW * 0.44, tmpH * 0.36);1485 c.lineTo(tmpW * 0.44, 0);1486 c.lineTo(tmpW * 0.56, 0);1487 c.lineTo(tmpW * 0.56, tmpH * 0.36);1488 c.lineTo(tmpW * 0.82, tmpH * 0.1);1489 c.lineTo(tmpW * 0.90, tmpH * 0.18);1490 c.lineTo(tmpW * 0.64, tmpH * 0.44);1491 c.lineTo(tmpW, tmpH * 0.44);1492 c.lineTo(tmpW, tmpH * 0.56);1493 c.lineTo(tmpW * 0.64, tmpH * 0.56);1494 c.lineTo(tmpW * 0.9, tmpH * 0.82);1495 c.lineTo(tmpW * 0.82, tmpH * 0.9);1496 c.lineTo(tmpW * 0.56, tmpH * 0.64);1497 c.lineTo(tmpW * 0.56, tmpH);1498 c.lineTo(tmpW * 0.44, tmpH);1499 c.lineTo(tmpW * 0.44, tmpH * 0.64);1500 c.lineTo(tmpW * 0.18, tmpH * 0.9);1501 c.lineTo(tmpW * 0.1, tmpH * 0.82);1502 c.lineTo(tmpW * 0.36, tmpH * 0.56);1503 c.lineTo(0, tmpH * 0.56);1504 c.close();1505 c.fillAndStroke();15061507 c.setFillColor(fillColor);1508 }1509}15101511mxCellRenderer.registerShape('mxgraph.bpmn.gateway2', mxShapeBpmnGateway);15121513//**********************************************************************************************************************************************************1514//Task (LEGACY)1515//**********************************************************************************************************************************************************1516/**1517* Extends mxShape.1518*/1519function mxShapeBpmn2Task(bounds, fill, stroke, strokewidth)1520{1521 mxCellRenderer.prototype.getShape('mxgraph.basic.rect').call(this);1522 this.bounds = bounds;1523 this.fill = fill;1524 this.stroke = stroke;1525 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1526 this.dy = 0.5;1527 this.dx = 0.5;1528 this.notch = 0;1529};15301531/**1532* Extends mxShape.1533*/1534mxUtils.extend(mxShapeBpmn2Task, mxCellRenderer.prototype.getShape('mxgraph.basic.rect'));15351536mxShapeBpmn2Task.prototype.customProperties = [1537 {name: 'bpmnShapeType', dispName: 'Type', defVal: 'task', type: 'enum', 1538 enumList: [{val: 'task', dispName: 'Task'}, 1539 {val: 'transaction', dispName: 'Transaction'}, 1540 {val: 'call', dispName: 'Call'}, 1541 {val: 'subprocess', dispName: 'Sub-Process'}]}, 1542 {name: 'taskMarker', dispName: 'Task Marker', defVal: 'abstract', type: 'enum', 1543 enumList: [{val: 'abstract', dispName: 'Abstract'}, 1544 {val: 'service', dispName: 'Service'}, 1545 {val: 'send', dispName: 'Send'}, 1546 {val: 'receive', dispName: 'Receive'}, 1547 {val: 'user', dispName: 'User'},1548 1549 {val: 'nime', dispName: 'Non-Interrupting Message Event'}, 1550 1551 {val: 'manual', dispName: 'Manual'}, 1552 {val: 'businessRule', dispName: 'Business Rule'}, 1553 {val: 'script', dispName: 'Script'}]}, 1554 {name: 'isLoopSub', dispName: 'Subprocess', type: 'bool'}, 1555 {name: 'isLoopStandard', dispName: 'Standard Loop', type: 'bool'}, 1556 {name: 'isLoopMultiParallel', dispName: 'Multi-Instance Parallel Loop', type: 'bool'}, 1557 {name: 'isLoopMultiSeq', dispName: 'Multi-Instance Sequential Loop', type: 'bool'}, 1558 {name: 'isLoopComp', dispName: 'Compensation Loop', type: 'bool'},1559 {name: 'isAdHoc', dispName: 'Ad Hoc', type: 'bool'}1560];15611562mxShapeBpmn2Task.prototype.customProperties = mxShapeBpmn2Task.prototype.customProperties.concat(mxShapeBpmnEvent.prototype.customProperties);1563mxShapeBpmn2Task.prototype.customProperties = mxShapeBpmn2Task.prototype.customProperties.concat(mxCellRenderer.prototype.getShape('mxgraph.basic.rect').prototype.customProperties);15641565mxShapeBpmn2Task.prototype.eventTypeEnum = mxShapeBpmnEvent.prototype.eventTypeEnum; 1566mxShapeBpmn2Task.prototype.eventEnum = mxShapeBpmnEvent.prototype.eventEnum; 1567mxShapeBpmn2Task.prototype.miscEnum = mxShapeBpmnEvent.prototype.miscEnum;15681569mxShapeBpmn2Task.prototype.cst = {1570 TASK : 'mxgraph.bpmn.task'1571};15721573/**1574* Function: paintVertexShape1575* 1576* Paints the vertex shape.1577*/1578mxShapeBpmn2Task.prototype.paintVertexShape = function(c, x, y, w, h)1579{1580 var bpmnShapeType = mxUtils.getValue(this.style, 'bpmnShapeType', 'task');1581 var taskMarker = mxUtils.getValue(this.style, 'taskMarker', 'abstract');1582 var strokeWidth = mxUtils.getValue(this.style, 'strokeWidth', 1);1583 var dashed = mxUtils.getValue(this.style, 'dashed', false);1584 var inset = mxUtils.getValue(this.style, 'indent', 3);1585 var offsetY = 14;1586 var rectOutline = mxUtils.getValue(this.style, 'rectOutline', 'single');1587 1588 c.translate(x, y);15891590 var superShape = mxCellRenderer.prototype.getShape('mxgraph.basic.rect');1591 1592 var overrideStyles = {};1593 1594 if (bpmnShapeType == 'transaction')1595 {1596 offsetY += inset;1597 overrideStyles.rectOutline = 'double';1598 overrideStyles.indent = 3;1599 }1600 else if (bpmnShapeType == 'subprocess')1601 {1602 overrideStyles.dashed = true;1603 }1604 else if (bpmnShapeType == 'call')1605 {1606 overrideStyles.strokeWidth = 4;1607 }1608 1609 superShape.prototype.strictDrawShape.call(this, c, 0, 0, w, h, overrideStyles);16101611 c.setStrokeWidth(strokeWidth);1612 c.setDashed(dashed);1613 1614 if (bpmnShapeType == 'call')1615 {1616 c.setStrokeWidth(strokeWidth);1617 }16181619 c.setDashed(false);1620 c.setShadow(false);16211622 var isLoopSub = mxUtils.getValue(this.style, 'isLoopSub', false);1623 var isLoopStandard = mxUtils.getValue(this.style, 'isLoopStandard', false);1624 var isLoopMultiParallel = mxUtils.getValue(this.style, 'isLoopMultiParallel', false);1625 var isLoopMultiSeq = mxUtils.getValue(this.style, 'isLoopMultiSeq', false);1626 var isLoopComp = mxUtils.getValue(this.style, 'isLoopComp', false);1627 var isAdHoc = mxUtils.getValue(this.style, 'isAdHoc', false);16281629 var loopnum = 0;1630 1631 if (isLoopStandard) loopnum++;1632 if (isLoopMultiParallel) loopnum++;1633 if (isLoopMultiSeq) loopnum++;1634 if (isLoopComp) loopnum++;1635 if (isLoopSub) loopnum++;1636 if (isAdHoc) loopnum++;1637 1638 var iconSpaceX = 14;1639 var currXOffset = - iconSpaceX * loopnum * 0.5;1640 1641 if (isLoopStandard)1642 {1643 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.loop');1644 1645 if (stencil != null)1646 {1647 stencil.drawShape(c, this, w * 0.5 + currXOffset + 1, h - offsetY + 1, 12, 12);1648 currXOffset += iconSpaceX;1649 }1650 }1651 1652 if (isLoopMultiParallel)1653 {1654 c.translate(w * 0.5 + currXOffset + 1, h - offsetY + 1);1655 1656 c.begin();1657 c.moveTo(2.4, 0);1658 c.lineTo(2.4, 12);1659 c.moveTo(6, 0);1660 c.lineTo(6, 12);1661 c.moveTo(9.6, 0);1662 c.lineTo(9.6, 12);1663 c.stroke();1664 1665 c.translate(- w * 0.5 - currXOffset - 1, offsetY - 1 - h);1666 currXOffset += iconSpaceX;1667 }1668 1669 if (isLoopMultiSeq)1670 {1671 c.translate(w * 0.5 + currXOffset + 1, h - offsetY + 1);1672 1673 c.begin();1674 c.moveTo(0, 2.4);1675 c.lineTo(12, 2.4);1676 c.moveTo(0, 6);1677 c.lineTo(12, 6);1678 c.moveTo(0, 9.6);1679 c.lineTo(12, 9.6);1680 c.stroke();1681 1682 c.translate(- w * 0.5 - currXOffset - 1, offsetY - 1 - h);1683 currXOffset += iconSpaceX;1684 }1685 1686 if (isLoopComp)1687 {1688 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.compensation');1689 1690 if (stencil != null)1691 {1692 stencil.drawShape(c, this, w * 0.5 + currXOffset, h - offsetY + 1, 14, 12);1693 currXOffset += iconSpaceX;1694 }1695 }1696 1697 if (isLoopSub)1698 {1699 c.translate(w * 0.5 + currXOffset, h - offsetY);1700 1701 c.rect(0, 0, 14, 14);1702 c.stroke();1703 1704 c.begin();1705 c.moveTo(4, 7);1706 c.lineTo(10, 7);1707 c.moveTo(7, 4);1708 c.lineTo(7, 10);1709 c.stroke();1710 1711 c.translate(- w * 0.5 - currXOffset, offsetY - h);1712 currXOffset += iconSpaceX;1713 }1714 1715 if (isAdHoc)1716 {1717 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.ad_hoc');1718 1719 if (stencil != null)1720 {1721 var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');1722 var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');1723 1724 c.setStrokeColor('none');1725 c.setFillColor(strokeColor);1726 1727 stencil.drawShape(c, this, w * 0.5 + currXOffset + 1, h - offsetY + 4, 12, 6);1728 currXOffset += iconSpaceX;1729 1730 c.setStrokeColor(strokeColor);1731 c.setFillColor(fillColor);1732 }1733 }1734 1735 switch (taskMarker) {1736 case 'abstract':1737 break;1738 case 'service':1739 1740 c.setFillColor(mxUtils.getValue(this.style, 'fillColor', '#ffffff'));1741 1742 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.service_task');1743 1744 if (stencil != null)1745 {1746 stencil.drawShape(c, this, 2, 2, 16, 16);1747 }1748 1749 break;1750 case 'send':1751 var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');1752 var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');1753 1754 c.setStrokeColor(fillColor);1755 c.setFillColor(strokeColor);1756 1757 mxShapeBpmn2SendMarker.prototype.paintVertexShape(c, 4, 4, 18, 13);1758 1759 break;1760 case 'receive':1761 1762 mxShapeBpmn2SendMarker.prototype.paintVertexShape(c, 4, 4, 18, 13);1763 1764 break;1765 case 'user':1766 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.user_task');1767 1768 if (stencil != null)1769 {1770 stencil.drawShape(c, this, 2, 2, 16, 16);1771 }1772 1773 break;1774 case 'manual':1775 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.manual_task');1776 1777 if (stencil != null)1778 {1779 stencil.drawShape(c, this, 3, 3, 18, 14);1780 }1781 1782 break;1783 case 'businessRule':1784 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.business_rule_task');1785 1786 if (stencil != null)1787 {1788 stencil.drawShape(c, this, 4, 4, 18, 14);1789 }1790 1791 break;1792 case 'script':1793 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.script_task');1794 1795 if (stencil != null)1796 {1797 stencil.drawShape(c, this, 3, 3, 19, 18);1798 }1799 1800 break;1801 }18021803 var symbolW = 20;1804 var symbolH = 20;1805 1806 var outline = mxUtils.getValue(this.style, 'outline', 'none');1807 var symbol = mxUtils.getValue(this.style, 'symbol', 'standard');1808 1809 mxShapeBpmnEvent.prototype.strictDrawShape.call(this, c, 0, 0, symbolW, symbolH, outline, symbol);18101811};18121813mxCellRenderer.registerShape(mxShapeBpmn2Task.prototype.cst.TASK, mxShapeBpmn2Task);18141815//**********************************************************************************************************************************************************1816//Task v21817//**********************************************************************************************************************************************************1818/**1819* Extends mxShape.1820*/1821function mxShapeBpmn2Task2(bounds, fill, stroke, strokewidth)1822{1823 mxCellRenderer.prototype.getShape('mxgraph.basic.rect').call(this);1824 this.bounds = bounds;1825 this.fill = fill;1826 this.stroke = stroke;1827 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1828 this.dy = 0.5;1829 this.dx = 0.5;1830 this.notch = 0;1831};18321833/**1834* Extends mxShape.1835*/1836mxUtils.extend(mxShapeBpmn2Task2, mxCellRenderer.prototype.getShape('mxgraph.basic.rect'));18371838mxShapeBpmn2Task2.prototype.customProperties = [1839 {name: 'bpmnShapeType', dispName: 'Type', defVal: 'task', type: 'enum', 1840 enumList: [{val: 'task', dispName: 'Task'}, 1841 {val: 'transaction', dispName: 'Transaction'}, 1842 {val: 'call', dispName: 'Call'}, 1843 {val: 'subprocess', dispName: 'Sub-Process'}]}, 1844 {name: 'taskMarker', dispName: 'Task Marker', defVal: 'abstract', type: 'enum', 1845 enumList: [{val: 'abstract', dispName: 'Abstract'}, 1846 {val: 'service', dispName: 'Service'}, 1847 {val: 'send', dispName: 'Send'}, 1848 {val: 'receive', dispName: 'Receive'}, 1849 {val: 'user', dispName: 'User'},1850 1851 {val: 'nime', dispName: 'Non-Interrupting Message Event'}, 1852 1853 {val: 'manual', dispName: 'Manual'}, 1854 {val: 'businessRule', dispName: 'Business Rule'}, 1855 {val: 'script', dispName: 'Script'}]}, 1856 {name: 'isLoopSub', dispName: 'Subprocess', type: 'bool'}, 1857 {name: 'isLoopStandard', dispName: 'Standard Loop', type: 'bool'}, 1858 {name: 'isLoopMultiParallel', dispName: 'Multi-Instance Parallel Loop', type: 'bool'}, 1859 {name: 'isLoopMultiSeq', dispName: 'Multi-Instance Sequential Loop', type: 'bool'}, 1860 {name: 'isLoopComp', dispName: 'Compensation Loop', type: 'bool'},1861 {name: 'isAdHoc', dispName: 'Ad Hoc', type: 'bool'}1862];18631864mxShapeBpmn2Task2.prototype.customProperties = mxShapeBpmn2Task2.prototype.customProperties.concat(mxShapeBpmnEvent.prototype.customProperties);1865mxShapeBpmn2Task2.prototype.customProperties = mxShapeBpmn2Task2.prototype.customProperties.concat(mxCellRenderer.prototype.getShape('mxgraph.basic.rect').prototype.customProperties);18661867mxShapeBpmn2Task2.prototype.eventTypeEnum = mxShapeBpmnEvent.prototype.eventTypeEnum; 1868mxShapeBpmn2Task2.prototype.eventEnum = mxShapeBpmnEvent.prototype.eventEnum; 1869mxShapeBpmn2Task2.prototype.miscEnum = mxShapeBpmnEvent.prototype.miscEnum;18701871mxShapeBpmn2Task2.prototype.cst = {1872 TASK : 'mxgraph.bpmn.task2'1873};18741875/**1876* Function: paintVertexShape1877* 1878* Paints the vertex shape.1879*/1880mxShapeBpmn2Task2.prototype.paintVertexShape = function(c, x, y, w, h)1881{1882 var bpmnShapeType = mxUtils.getValue(this.style, 'bpmnShapeType', 'task');1883 var taskMarker = mxUtils.getValue(this.style, 'taskMarker', 'abstract');1884 var strokeWidth = mxUtils.getValue(this.style, 'strokeWidth', 1);1885 var dashed = mxUtils.getValue(this.style, 'dashed', false);1886 var inset = mxUtils.getValue(this.style, 'indent', 3);1887 var offsetY = 14 + strokeWidth * 0.5;18881889 if (bpmnShapeType == 'call')1890 {1891 offsetY = 14 + strokeWidth * 2;1892 }18931894 var rectOutline = mxUtils.getValue(this.style, 'rectOutline', 'single');1895 1896 c.translate(x, y);18971898 var superShape = mxCellRenderer.prototype.getShape('mxgraph.basic.rect');1899 1900 var overrideStyles = {};1901 1902 if (bpmnShapeType == 'transaction')1903 {1904 offsetY += inset;1905 overrideStyles.rectOutline = 'double';1906 overrideStyles.indent = 3;1907 }1908 else if (bpmnShapeType == 'subprocess')1909 {1910 overrideStyles.dashed = true;1911 }1912 else if (bpmnShapeType == 'call')1913 {1914 overrideStyles.strokeWidth = strokeWidth * 4;1915 }1916 1917 superShape.prototype.strictDrawShape.call(this, c, 0, 0, w, h, overrideStyles);19181919 c.setStrokeWidth(strokeWidth);1920 c.setDashed(dashed);1921 1922 if (bpmnShapeType == 'call')1923 {1924 c.setStrokeWidth(strokeWidth);1925 }19261927 c.setDashed(false);1928 c.setShadow(false);19291930 var isLoopSub = mxUtils.getValue(this.style, 'isLoopSub', false);1931 var isLoopStandard = mxUtils.getValue(this.style, 'isLoopStandard', false);1932 var isLoopMultiParallel = mxUtils.getValue(this.style, 'isLoopMultiParallel', false);1933 var isLoopMultiSeq = mxUtils.getValue(this.style, 'isLoopMultiSeq', false);1934 var isLoopComp = mxUtils.getValue(this.style, 'isLoopComp', false);1935 var isAdHoc = mxUtils.getValue(this.style, 'isAdHoc', false);19361937 var loopnum = 0;19381939 if (isLoopStandard) loopnum++;1940 if (isLoopMultiParallel) loopnum++;1941 if (isLoopMultiSeq) loopnum++;1942 if (isLoopComp) loopnum++;1943 if (isLoopSub) loopnum++;1944 if (isAdHoc) loopnum++;1945 1946 var iconSpaceX = 14;1947 var currXOffset = - iconSpaceX * loopnum * 0.5;1948 1949 c.setStrokeWidth(1);19501951 if (isLoopStandard)1952 {1953 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.loop');1954 1955 if (stencil != null)1956 {1957 var previousSetStrokeWidth = c.setStrokeWidth;1958 c.setStrokeWidth = function() { };1959 stencil.drawShape(c, this, w * 0.5 + currXOffset + 1, h - offsetY + 1, 12, 12);1960 c.setStrokeWidth = previousSetStrokeWidth;1961 currXOffset += iconSpaceX;1962 }1963 }1964 1965 if (isLoopMultiParallel)1966 {1967 c.translate(w * 0.5 + currXOffset + 1, h - offsetY + 1);1968 1969 c.begin();1970 c.moveTo(2.4, 0);1971 c.lineTo(2.4, 12);1972 c.moveTo(6, 0);1973 c.lineTo(6, 12);1974 c.moveTo(9.6, 0);1975 c.lineTo(9.6, 12);1976 c.stroke();1977 1978 c.translate(- w * 0.5 - currXOffset - 1, offsetY - 1 - h);1979 currXOffset += iconSpaceX;1980 }1981 1982 if (isLoopMultiSeq)1983 {1984 c.translate(w * 0.5 + currXOffset + 1, h - offsetY + 1);1985 1986 c.begin();1987 c.moveTo(0, 2.4);1988 c.lineTo(12, 2.4);1989 c.moveTo(0, 6);1990 c.lineTo(12, 6);1991 c.moveTo(0, 9.6);1992 c.lineTo(12, 9.6);1993 c.stroke();1994 1995 c.translate(- w * 0.5 - currXOffset - 1, offsetY - 1 - h);1996 currXOffset += iconSpaceX;1997 }1998 1999 if (isLoopComp)2000 {2001 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.compensation');2002 2003 if (stencil != null)2004 {2005 var previousSetStrokeWidth = c.setStrokeWidth;2006 c.setStrokeWidth = function() { };2007 stencil.drawShape(c, this, w * 0.5 + currXOffset, h - offsetY + 1, 14, 12);2008 c.setStrokeWidth = previousSetStrokeWidth;2009 currXOffset += iconSpaceX;2010 }2011 }2012 2013 if (isLoopSub)2014 {2015 c.translate(w * 0.5 + currXOffset, h - offsetY);2016 2017 c.rect(0, 0, 14, 14);2018 c.stroke();2019 2020 c.begin();2021 c.moveTo(4, 7);2022 c.lineTo(10, 7);2023 c.moveTo(7, 4);2024 c.lineTo(7, 10);2025 c.stroke();2026 2027 c.translate(- w * 0.5 - currXOffset, offsetY - h);2028 currXOffset += iconSpaceX;2029 }2030 2031 if (isAdHoc)2032 {2033 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.ad_hoc');2034 2035 if (stencil != null)2036 {2037 var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');2038 var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');2039 2040 c.setStrokeColor('none');2041 c.setFillColor(strokeColor);2042 2043 stencil.drawShape(c, this, w * 0.5 + currXOffset + 1, h - offsetY + 4, 12, 6);2044 currXOffset += iconSpaceX;2045 2046 c.setStrokeColor(strokeColor);2047 c.setFillColor(fillColor);2048 c.setStrokeWidth(1);2049 }2050 }2051 2052 var inlet = strokeWidth * 0.5;2053 if (bpmnShapeType == 'call')2054 {2055 inlet = strokeWidth * 2;2056 }2057 2058 2059 switch (taskMarker) {2060 case 'abstract':2061 break;2062 case 'service':2063 2064 c.setFillColor(mxUtils.getValue(this.style, 'fillColor', '#ffffff'));2065 2066 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.service_task');2067 2068 if (stencil != null)2069 {2070 var previousSetStrokeWidth = c.setStrokeWidth;2071 c.setStrokeWidth = function() { };2072 stencil.drawShape(c, this, inlet + 2, inlet + 2, 16, 16);2073 c.setStrokeWidth = previousSetStrokeWidth;2074 }2075 2076 break;2077 case 'send':2078 var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');2079 var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');2080 2081 c.setStrokeColor(fillColor);2082 c.setFillColor(strokeColor);2083 2084 mxShapeBpmn2SendMarker.prototype.paintVertexShape(c, inlet + 4, inlet + 4, 18, 13);2085 2086 break;2087 case 'receive':2088 2089 mxShapeBpmn2SendMarker.prototype.paintVertexShape(c, inlet + 4, inlet + 4, 18, 13);2090 2091 break;2092 case 'user':2093 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.user_task');2094 2095 if (stencil != null)2096 {2097 var previousSetStrokeWidth = c.setStrokeWidth;2098 c.setStrokeWidth = function() { };2099 stencil.drawShape(c, this, inlet + 2, inlet + 2, 16, 16);2100 c.setStrokeWidth = previousSetStrokeWidth;2101 }2102 2103 break;2104 case 'manual':2105 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.manual_task');2106 2107 if (stencil != null)2108 {2109 var previousSetStrokeWidth = c.setStrokeWidth;2110 c.setStrokeWidth = function() { };2111 stencil.drawShape(c, this, inlet + 3, inlet + 3, 18, 14);2112 c.setStrokeWidth = previousSetStrokeWidth;2113 }2114 2115 break;2116 case 'businessRule':2117 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.business_rule_task');2118 2119 if (stencil != null)2120 {2121 var previousSetStrokeWidth = c.setStrokeWidth;2122 c.setStrokeWidth = function() { };2123 stencil.drawShape(c, this, inlet + 4, inlet + 4, 18, 14);2124 c.setStrokeWidth = previousSetStrokeWidth;2125 }2126 2127 break;2128 case 'script':2129 var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.script_task');2130 2131 if (stencil != null)2132 {2133 var previousSetStrokeWidth = c.setStrokeWidth;2134 c.setStrokeWidth = function() { };2135 stencil.drawShape(c, this, inlet + 3, inlet + 3, 19, 18);2136 c.setStrokeWidth = previousSetStrokeWidth;2137 }2138 2139 break;2140 }21412142 var symbolW = 20;2143 var symbolH = 20;2144 2145 var outline = mxUtils.getValue(this.style, 'outline', 'none');2146 var symbol = mxUtils.getValue(this.style, 'symbol', 'standard');2147 2148 var previousSetStrokeWidth = c.setStrokeWidth;2149 c.setStrokeWidth = function() { };2150 mxShapeBpmnEvent.prototype.strictDrawShape.call(this, c, inlet, inlet, symbolW, symbolH, outline, symbol);2151 c.setStrokeWidth = previousSetStrokeWidth;21522153};21542155mxCellRenderer.registerShape(mxShapeBpmn2Task2.prototype.cst.TASK, mxShapeBpmn2Task2);21562157//**********************************************************************************************************************************************************2158//Data (LEGACY)2159//**********************************************************************************************************************************************************2160/**2161* Extends mxShape.2162*/2163function mxShapeBpmn2Data(bounds, fill, stroke, strokewidth)2164{2165 mxCellRenderer.prototype.getShape('note').call(this);2166 this.bounds = bounds;2167 this.fill = fill;2168 this.stroke = stroke;2169 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2170 this.dy = 0.5;2171 this.dx = 0.5;2172 this.notch = 0;2173};21742175/**2176* Extends mxShape.2177*/2178mxUtils.extend(mxShapeBpmn2Data, mxCellRenderer.prototype.getShape('note'));21792180mxShapeBpmn2Data.prototype.cst = {2181 DATA : 'mxgraph.bpmn.data'2182};21832184mxShapeBpmn2Data.prototype.customProperties = [2185 {name: 'bpmnTransferType', dispName: 'Transfer Type', defVal: 'none', type: 'enum', 2186 enumList: [{val: 'none', dispName: 'None'}, 2187 {val: 'input', dispName: 'Input'}, 2188 {val: 'output', dispName: 'Output'}]}, 2189 {name: 'isCollection', dispName: 'Collection', type: 'bool'}2190];21912192/**2193* Function: paintVertexShape2194* 2195* Paints the vertex shape.2196*/2197mxShapeBpmn2Data.prototype.paintVertexShape = function(c, x, y, w, h)2198{2199 var superShape = mxCellRenderer.prototype.getShape('note');2200 superShape.prototype.paintVertexShape.call(this, c, x, y, w, h);22012202 var trType = mxUtils.getValue(this.style, 'bpmnTransferType', 'none');2203 var isColl = mxUtils.getValue(this.style, 'isCollection', false);2204 c.setShadow(false);2205 2206 if (trType === 'input' || trType === 'output')2207 {2208 var arrX = 3;2209 var arrY = 3;2210 var arrW = 14;2211 var arrH = 12;2212 2213 c.translate(arrX, arrY);2214 c.begin();2215 c.moveTo(0, arrH * 0.3);2216 c.lineTo(arrW * 0.55, arrH * 0.3);2217 c.lineTo(arrW * 0.55, 0);2218 c.lineTo(arrW, arrH * 0.5);2219 c.lineTo(arrW * 0.55, arrH);2220 c.lineTo(arrW * 0.55, arrH * 0.7);2221 c.lineTo(0, arrH * 0.7);2222 c.close();2223 c.translate(-arrX, -arrY);2224 2225 if (trType === 'input')2226 {2227 c.stroke();2228 }2229 else2230 {2231 var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');2232 var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');2233 2234 c.setFillColor(strokeColor);2235 c.fillAndStroke();2236 c.setFillColor(fillColor);2237 }2238 }2239 2240 if (isColl)2241 {2242 c.translate(w * 0.5 - 6, h - 12);2243 2244 c.begin();2245 c.moveTo(2.4, 0);2246 c.lineTo(2.4, 12);2247 c.moveTo(6, 0);2248 c.lineTo(6, 12);2249 c.moveTo(9.6, 0);2250 c.lineTo(9.6, 12);2251 c.stroke();2252 2253 c.translate( - w * 0.5 + 6, - h + 12);2254 }2255};22562257mxCellRenderer.registerShape(mxShapeBpmn2Data.prototype.cst.DATA, mxShapeBpmn2Data);22582259Graph.handleFactory[mxShapeBpmn2Data.prototype.cst.DATA] = Graph.handleFactory['note'];22602261//**********************************************************************************************************************************************************2262//Data v22263//**********************************************************************************************************************************************************2264/**2265* Extends mxShape.2266*/2267function mxShapeBpmn2Data2(bounds, fill, stroke, strokewidth)2268{2269 mxCellRenderer.prototype.getShape('note').call(this);2270 this.bounds = bounds;2271 this.fill = fill;2272 this.stroke = stroke;2273 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2274 this.dy = 0.5;2275 this.dx = 0.5;2276 this.notch = 0;2277};22782279/**2280* Extends mxShape.2281*/2282mxUtils.extend(mxShapeBpmn2Data2, mxCellRenderer.prototype.getShape('note'));22832284mxShapeBpmn2Data2.prototype.cst = {2285 DATA : 'mxgraph.bpmn.data2'2286};22872288mxShapeBpmn2Data2.prototype.customProperties = [2289 {name: 'bpmnTransferType', dispName: 'Transfer Type', defVal: 'none', type: 'enum', 2290 enumList: [{val: 'none', dispName: 'None'}, 2291 {val: 'input', dispName: 'Input'}, 2292 {val: 'output', dispName: 'Output'}]}, 2293 {name: 'isCollection', dispName: 'Collection', type: 'bool'}2294];22952296/**2297* Function: paintVertexShape2298* 2299* Paints the vertex shape.2300*/2301mxShapeBpmn2Data2.prototype.paintVertexShape = function(c, x, y, w, h)2302{2303 var superShape = mxCellRenderer.prototype.getShape('note');2304 superShape.prototype.paintVertexShape.call(this, c, x, y, w, h);23052306 var trType = mxUtils.getValue(this.style, 'bpmnTransferType', 'none');2307 var isColl = mxUtils.getValue(this.style, 'isCollection', false);2308 var strokeWidth = mxUtils.getValue(this.style, 'strokeWidth', 1);2309 2310 c.setShadow(false);2311 2312 c.setStrokeWidth(1);23132314 if (trType === 'input' || trType === 'output')2315 {2316 var arrX = 3 + strokeWidth * 0.5;2317 var arrY = 3 + strokeWidth * 0.5;2318 var arrW = 14;2319 var arrH = 12;2320 2321 c.translate(arrX, arrY);2322 c.begin();2323 c.moveTo(0, arrH * 0.3);2324 c.lineTo(arrW * 0.55, arrH * 0.3);2325 c.lineTo(arrW * 0.55, 0);2326 c.lineTo(arrW, arrH * 0.5);2327 c.lineTo(arrW * 0.55, arrH);2328 c.lineTo(arrW * 0.55, arrH * 0.7);2329 c.lineTo(0, arrH * 0.7);2330 c.close();2331 c.translate(-arrX, -arrY);2332 2333 if (trType === 'input')2334 {2335 c.stroke();2336 }2337 else2338 {2339 var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');2340 var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');2341 2342 c.setFillColor(strokeColor);2343 c.fillAndStroke();2344 c.setFillColor(fillColor);2345 }2346 }2347 2348 if (isColl)2349 {2350 c.translate(w * 0.5 - 6, h - 12 - strokeWidth * 0.5);2351 2352 c.begin();2353 c.moveTo(2.4, 0);2354 c.lineTo(2.4, 12);2355 c.moveTo(6, 0);2356 c.lineTo(6, 12);2357 c.moveTo(9.6, 0);2358 c.lineTo(9.6, 12);2359 c.stroke();2360 2361 c.translate( - w * 0.5 + 6, - h + 12);2362 }2363};23642365mxCellRenderer.registerShape(mxShapeBpmn2Data2.prototype.cst.DATA, mxShapeBpmn2Data2);23662367Graph.handleFactory[mxShapeBpmn2Data2.prototype.cst.DATA] = Graph.handleFactory['note'];23682369//**********************************************************************************************************************************************************2370//Swimlane2371//**********************************************************************************************************************************************************2372/**2373* Extends mxShape.2374*/2375function mxShapeBpmn2Swimlane(bounds, fill, stroke, strokewidth)2376{2377 mxCellRenderer.prototype.getShape('note').call(this);2378 this.bounds = bounds;2379 this.fill = fill;2380 this.stroke = stroke;2381 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2382 this.dy = 0.5;2383 this.dx = 0.5;2384 this.notch = 0;2385};23862387/**2388* Extends mxShape.2389*/2390mxUtils.extend(mxShapeBpmn2Swimlane, mxSwimlane);23912392mxShapeBpmn2Swimlane.prototype.cst = {2393 SWIMLANE : 'mxgraph.bpmn.swimlane'2394};23952396mxShapeBpmn2Swimlane.prototype.customProperties = [2397 {name: 'isCollection', dispName: 'Collection', type: 'bool'}2398];23992400/**2401* Function: paintVertexShape2402* 2403* Paints the vertex shape.2404*/2405mxShapeBpmn2Swimlane.prototype.paintVertexShape = function(c, x, y, w, h)2406{2407 mxSwimlane.prototype.paintVertexShape.call(this, c, x, y, w, h);24082409 var isColl = mxUtils.getValue(this.style, 'isCollection', false);2410 c.setShadow(false);2411 2412 if (isColl)2413 {2414 c.translate(w * 0.5 - 6, h - 12);2415 2416 c.begin();2417 c.moveTo(2.4, 0);2418 c.lineTo(2.4, 12);2419 c.moveTo(6, 0);2420 c.lineTo(6, 12);2421 c.moveTo(9.6, 0);2422 c.lineTo(9.6, 12);2423 c.stroke();2424 2425 c.translate( - w * 0.5 + 6, - h + 12);2426 }2427};24282429mxCellRenderer.registerShape(mxShapeBpmn2Swimlane.prototype.cst.SWIMLANE, mxShapeBpmn2Swimlane);24302431Graph.handleFactory[mxShapeBpmn2Swimlane.prototype.cst.SWIMLANE] = Graph.handleFactory['swimlane'];24322433//**********************************************************************************************************************************************************2434//Conversation (LEGACY)2435//**********************************************************************************************************************************************************2436/**2437* Extends mxShape.2438*/2439function mxShapeBpmn2Conversation(bounds, fill, stroke, strokewidth)2440{2441 mxShape.call(this);2442 this.bounds = bounds;2443 this.fill = fill;2444 this.stroke = stroke;2445 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2446};24472448/**2449* Extends mxShape.2450*/2451mxUtils.extend(mxShapeBpmn2Conversation, mxHexagon);24522453mxShapeBpmn2Conversation.prototype.customProperties = [2454 {name: 'bpmnConversationType', dispName: 'Type', defVal: 'conv', type: 'enum', 2455 enumList: [{val: 'conv', dispName: 'Conversation'}, 2456 {val: 'call', dispName: 'Call'}]}, 2457 {name: 'isLoopSub', dispName: 'Subprocess', type: 'bool'} 24582459];24602461mxShapeBpmn2Conversation.prototype.cst = {2462 CONVERSATION : 'mxgraph.bpmn.conversation'2463};24642465/**2466* Function: paintVertexShape2467* 2468* Paints the vertex shape.2469*/2470mxShapeBpmn2Conversation.prototype.paintVertexShape = function(c, x, y, w, h)2471{2472 var bpmnConvType = mxUtils.getValue(this.style, 'bpmnConversationType', 'conv');2473 var strokeWidth = mxUtils.getValue(this.style, 'strokeWidth', 1);2474 2475 if (bpmnConvType == 'call')2476 {2477 c.setStrokeWidth(strokeWidth * 4);2478 }24792480 c.translate(x, y);2481 2482 c.begin();2483 c.moveTo(0, h * 0.5);2484 c.lineTo(w * 0.25, 0);2485 c.lineTo(w * 0.75, 0);2486 c.lineTo(w, h * 0.5);2487 c.lineTo(w * 0.75, h);2488 c.lineTo(w * 0.25, h);2489 c.close();2490 c.fillAndStroke();24912492 if (bpmnConvType == 'call')2493 {2494 c.setStrokeWidth(strokeWidth);2495 }24962497 var isLoopSub = mxUtils.getValue(this.style, 'isLoopSub', false);24982499 if (isLoopSub)2500 {2501 c.translate(w * 0.5 - 7, h - 14);2502 2503 c.rect(0, 0, 14, 14);2504 c.stroke();2505 2506 c.begin();2507 c.moveTo(4, 7);2508 c.lineTo(10, 7);2509 c.moveTo(7, 4);2510 c.lineTo(7, 10);2511 c.stroke();2512 }2513};25142515mxCellRenderer.registerShape(mxShapeBpmn2Conversation.prototype.cst.CONVERSATION, mxShapeBpmn2Conversation);25162517//**********************************************************************************************************************************************************2518//Conversation v22519//**********************************************************************************************************************************************************2520/**2521* Extends mxShape.2522*/2523function mxShapeBpmn2Conversation2(bounds, fill, stroke, strokewidth)2524{2525 mxShape.call(this);2526 this.bounds = bounds;2527 this.fill = fill;2528 this.stroke = stroke;2529 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2530};25312532/**2533* Extends mxShape.2534*/2535mxUtils.extend(mxShapeBpmn2Conversation2, mxHexagon);25362537mxShapeBpmn2Conversation2.prototype.customProperties = [2538 {name: 'bpmnConversationType', dispName: 'Type', defVal: 'conv', type: 'enum', 2539 enumList: [{val: 'conv', dispName: 'Conversation'}, 2540 {val: 'call', dispName: 'Call'}]}, 2541 {name: 'isLoopSub', dispName: 'Subprocess', type: 'bool'} 25422543];25442545mxShapeBpmn2Conversation2.prototype.cst = {2546 CONVERSATION : 'mxgraph.bpmn.conversation2'2547};25482549/**2550* Function: paintVertexShape2551* 2552* Paints the vertex shape.2553*/2554mxShapeBpmn2Conversation2.prototype.paintVertexShape = function(c, x, y, w, h)2555{2556 var bpmnConvType = mxUtils.getValue(this.style, 'bpmnConversationType', 'conv');2557 var strokeWidth = mxUtils.getValue(this.style, 'strokeWidth', 1);2558 2559 if (bpmnConvType == 'call')2560 {2561 c.setStrokeWidth(strokeWidth * 4);2562 }25632564 c.translate(x, y);2565 2566 c.begin();2567 c.moveTo(0, h * 0.5);2568 c.lineTo(w * 0.25, 0);2569 c.lineTo(w * 0.75, 0);2570 c.lineTo(w, h * 0.5);2571 c.lineTo(w * 0.75, h);2572 c.lineTo(w * 0.25, h);2573 c.close();2574 c.fillAndStroke();25752576 c.setStrokeWidth(1);25772578 var isLoopSub = mxUtils.getValue(this.style, 'isLoopSub', false);25792580 if (isLoopSub)2581 {2582 if (bpmnConvType == 'call')2583 {2584 c.translate(w * 0.5 - 7, h - 14 - strokeWidth * 2);2585 }2586 else2587 {2588 c.translate(w * 0.5 - 7, h - 14 - strokeWidth * 0.5);2589 }2590 2591 c.rect(0, 0, 14, 14);2592 c.stroke();2593 2594 c.begin();2595 c.moveTo(4, 7);2596 c.lineTo(10, 7);2597 c.moveTo(7, 4);2598 c.lineTo(7, 10);2599 c.stroke();2600 }2601};26022603mxCellRenderer.registerShape(mxShapeBpmn2Conversation2.prototype.cst.CONVERSATION, mxShapeBpmn2Conversation2);