| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066 |
- /**
- * $Id: mxBpmnShape2.js,v 1.6 2013/12/20 09:54:28 mate Exp $
- * Copyright (c) 2006-2010, JGraph Ltd
- */
- /**
- * Class: mxBpmnShape (DEPRECATED)
- *
- * Extends <mxShape> to implement an cylinder shape. If a
- * custom shape with one filled area and an overlay path is
- * needed, then this shape's <redrawPath> should be overridden.
- * This shape is registered under <mxConstants.SHAPE_CYLINDER>
- * in <mxCellRenderer>.
- *
- * Constructor: mxBpmnShape
- *
- * Constructs a new cylinder shape.
- *
- * Parameters:
- *
- * bounds - <mxRectangle> that defines the bounds. This is stored in
- * <mxShape.bounds>.
- * fill - String that defines the fill color. This is stored in <fill>.
- * stroke - String that defines the stroke color. This is stored in <stroke>.
- * strokewidth - Optional integer that defines the stroke width. Default is
- * 1. This is stored in <strokewidth>.
- */
- function mxBpmnShape(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxBpmnShape, mxShape);
- mxBpmnShape.prototype.customProperties = [
- {name: 'symbol', dispName: 'Event', type: 'enum', defVal:'general',
- enumList: [{val: 'general', dispName: 'General'},
- {val: 'message', dispName: 'Message'},
- {val: 'timer', dispName: 'Timer'},
- {val: 'escalation', dispName: 'Escalation'},
- {val: 'conditional', dispName: 'Conditional'},
- {val: 'link', dispName: 'Link'},
- {val: 'error', dispName: 'Error'},
- {val: 'cancel', dispName: 'Cancel'},
- {val: 'compensation', dispName: 'Compensation'},
- {val: 'signal', dispName: 'Signal'},
- {val: 'multiple', dispName: 'Multiple'},
- {val: 'parallelMultiple', dispName: 'Parallel Multiple'},
- {val: 'terminate', dispName: 'Terminate'},
- {val: 'exclusiveGw', dispName: 'Exclusive Gw'},
- {val: 'parallelGw', dispName: 'Parallel Gw'},
- {val: 'complexGw', dispName: 'Complex Gw'}]
- },
- {name: 'outline', dispName: 'Event Type', type: 'enum', defVal:'standard',
- enumList: [{val: 'standard', dispName: 'Standard'},
- {val: 'eventInt', dispName: 'Interrupting'},
- {val: 'eventNonint', dispName: 'Non-Interrupting'},
- {val: 'catching', dispName: 'Catching'},
- {val: 'boundInt', dispName: 'Bound Interrupting'},
- {val: 'boundNonint', dispName: 'Bound Non-Interrupting'},
- {val: 'throwing', dispName: 'Throwing'},
- {val: 'end', dispName: 'End'},
- {val: 'none', dispName: 'None'}]
- },
- {name: 'background', dispName: 'Background', type: 'enum', defVal:'none',
- enumList: [{val: 'gateway', dispName: 'Gateway'},
- {val: 'none', dispName: 'None'}]
- }];
- mxBpmnShape.prototype.eventTypeEnum = {
- START_STANDARD : 'standard',
- EVENT_SP_INT : 'eventInt',
- EVENT_SP_NONINT : 'eventNonint',
- CATCHING : 'catching',
- BOUND_INT : 'boundInt',
- BOUND_NONINT : 'boundNonint',
- THROWING : 'throwing',
- END : 'end',
- NONE : 'none',
- GATEWAY : 'gateway'};
- mxBpmnShape.prototype.eventEnum = {
- GENERAL : 'general',
- MESSAGE : 'message',
- TIMER : 'timer',
- ESCALATION : 'escalation',
- CONDITIONAL : 'conditional',
- LINK : 'link',
- ERROR : 'error',
- CANCEL : 'cancel',
- COMPENSATION : 'compensation',
- SIGNAL : 'signal',
- MULTIPLE : 'multiple',
- PAR_MULTI : 'parallelMultiple',
- TERMINATE : 'terminate',
- GW_EXCLUSIVE : 'exclusiveGw',
- GW_PARALLEL : 'parallelGw',
- GW_COMPLEX : 'complexGw'};
- mxBpmnShape.prototype.miscEnum = {
- OUTLINE : 'outline',
- BACKGROUND : 'background',
- SYMBOL : 'symbol',
- GATEWAY : 'gateway'};
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxBpmnShape.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.BACKGROUND);
- var bg = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.BACKGROUND, mxBpmnShape.prototype.eventTypeEnum.NONE);
- if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)
- {
- c.setShadow(false);
- }
- this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.OUTLINE);
- this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.SYMBOL);
- }
- /**
- * Function: redrawPath
- *
- * Draws the path for this shape.
- */
- mxBpmnShape.prototype.redrawPath = function(c, x, y, w, h, layer)
- {
- var bg = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.BACKGROUND, mxBpmnShape.prototype.eventTypeEnum.NONE);
- if (layer == mxBpmnShape.prototype.miscEnum.BACKGROUND)
- {
- if (bg != null)
- {
- var f = this.backgrounds[bg];
- if (f != null)
- {
- c.translate(x, y);
- f.call(this, c, x, y, w, h, layer);
- }
- }
- }
- else if (layer == mxBpmnShape.prototype.miscEnum.OUTLINE)
- {
- if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)
- {
- c.translate(w / 4, h / 4);
- h /= 2;
- w /= 2;
-
- //add rhombus connections here
- this.constraints = [
- new mxConnectionConstraint(new mxPoint(0.5, 0), true),
- new mxConnectionConstraint(new mxPoint(0.5, 1), true),
- new mxConnectionConstraint(new mxPoint(0, 0.5), true),
- new mxConnectionConstraint(new mxPoint(1, 0.5), true),
- new mxConnectionConstraint(new mxPoint(0.25, 0.25), false),
- new mxConnectionConstraint(new mxPoint(0.25, 0.75), false),
- new mxConnectionConstraint(new mxPoint(0.75, 0.25), false),
- new mxConnectionConstraint(new mxPoint(0.75, 0.75), false)
- ];
- }
- else
- {
- //add ellipse connections here
- this.constraints = [
- new mxConnectionConstraint(new mxPoint(0.5, 0), true),
- new mxConnectionConstraint(new mxPoint(0.5, 1), true),
- new mxConnectionConstraint(new mxPoint(0, 0.5), true),
- new mxConnectionConstraint(new mxPoint(1, 0.5), true),
- new mxConnectionConstraint(new mxPoint(0.145, 0.145), false),
- new mxConnectionConstraint(new mxPoint(0.145, 0.855), false),
- new mxConnectionConstraint(new mxPoint(0.855, 0.145), false),
- new mxConnectionConstraint(new mxPoint(0.855, 0.855), false)
- ];
- }
- var o = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.OUTLINE, mxBpmnShape.prototype.eventTypeEnum.NONE);
- if (o != null)
- {
- var f = this.outlines[o];
- if (f != null)
- {
- f.call(this, c, x, y, w, h, bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY);
- }
- }
- }
- else if (layer == mxBpmnShape.prototype.miscEnum.SYMBOL)
- {
- if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)
- {
- h /= 2;
- w /= 2;
- }
- var s = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.SYMBOL, null);
- if (s != null)
- {
- var f = this.symbols[s];
- if (f != null)
- {
- var strokeColor = c.state.strokeColor;
- var fillColor = c.state.fillColor;
- var o = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.OUTLINE, mxBpmnShape.prototype.eventTypeEnum.NONE);
- if (s === mxBpmnShape.prototype.eventEnum.MESSAGE)
- {
- c.translate(w * 0.15, h * 0.3);
- w = w * 0.7;
- h = h * 0.4;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.TIMER)
- {
- c.translate(w * 0.11, h * 0.11);
- w = w * 0.78;
- h = h * 0.78;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.ESCALATION)
- {
- c.translate(w * 0.19, h * 0.15);
- w = w * 0.62;
- h = h * 0.57;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.CONDITIONAL)
- {
- c.translate(w * 0.3, h * 0.16);
- w = w * 0.4;
- h = h * 0.68;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.LINK)
- {
- c.translate(w * 0.27, h * 0.33);
- w = w * 0.46;
- h = h * 0.34;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.ERROR)
- {
- c.translate(w * 0.212, h * 0.243);
- w = w * 0.58;
- h = h * 0.507;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.CANCEL)
- {
- c.translate(w * 0.22, h * 0.22);
- w = w * 0.56;
- h = h * 0.56;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.COMPENSATION)
- {
- c.translate(w * 0.28, h * 0.35);
- w = w * 0.44;
- h = h * 0.3;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.SIGNAL)
- {
- c.translate(w * 0.19, h * 0.15);
- w = w * 0.62;
- h = h * 0.57;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.MULTIPLE)
- {
- c.translate(w * 0.2, h * 0.19);
- w = w * 0.6;
- h = h * 0.565;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.PAR_MULTI)
- {
- c.translate(w * 0.2, h * 0.2);
- w = w * 0.6;
- h = h * 0.6;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.TERMINATE)
- {
- c.translate(w * 0.05, h * 0.05);
- w = w * 0.9;
- h = h * 0.9;
- }
- else if (s === mxBpmnShape.prototype.eventEnum.GW_EXCLUSIVE)
- {
- c.translate(w * 0.12, 0);
- w = w * 0.76;
- }
-
- var isInverse = false;
-
- if (s === 'star')
- {
- c.setFillColor(strokeColor);
- }
- else if (o === mxBpmnShape.prototype.eventTypeEnum.THROWING || o === mxBpmnShape.prototype.eventTypeEnum.END)
- {
- c.setStrokeColor(fillColor);
- c.setFillColor(strokeColor);
- isInverse = true;
- }
- f.call(this, c, x, y, w, h, layer, isInverse);
-
- if (s === 'star')
- {
- c.setFillColor(fillColor);
- }
- else if (o === mxBpmnShape.prototype.eventTypeEnum.THROWING || o === mxBpmnShape.prototype.eventTypeEnum.END)
- {
- c.setStrokeColor(strokeColor);
- c.setFillColor(fillColor);
- }
- }
- }
- }
- };
- //Contains all possible backgrounds
- mxBpmnShape.prototype.backgrounds = {
- 'none': function(c, x, y, w, h)
- {
- },
- 'gateway': function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(w / 2, 0);
- c.lineTo(w, h / 2);
- c.lineTo(w / 2, h);
- c.lineTo(0, h / 2);
- c.close();
- c.fillAndStroke();
- }
- };
- //Contains all possible outlines
- mxBpmnShape.prototype.outlines = {
- 'none' : function(c, x, y, w, h, isGateway)
- {
- if (!isGateway)
- {
- c.setShadow(false);
- }
- },
- 'standard': function(c, x, y, w, h, isGateway)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- if (!isGateway)
- {
- c.setShadow(false);
- }
- },
- 'eventInt': function(c, x, y, w, h, isGateway)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- if (!isGateway)
- {
- c.setShadow(false);
- }
- },
- 'eventNonint': function(c, x, y, w, h, isGateway)
- {
- var dashed = c.state.dashed;
- c.setDashed(true);
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setDashed(dashed);
- if (!isGateway)
- {
- c.setShadow(false);
- }
- },
- 'catching': function(c, x, y, w, h, isGateway)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- if (!isGateway)
- {
- c.setShadow(false);
- }
- var inset = 2;
- c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
- c.stroke();
- },
- 'boundInt': function(c, x, y, w, h, isGateway)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- if (!isGateway)
- {
- c.setShadow(false);
- }
- var inset = 2;
- c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
- c.stroke();
- },
- 'boundNonint': function(c, x, y, w, h, isGateway)
- {
- var dashed = c.state.dashed;
- c.setDashed(true);
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- if (!isGateway)
- {
- c.setShadow(false);
- }
- var inset = 2;
- c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
- c.stroke();
- c.setDashed(dashed);
- },
- 'throwing': function(c, x, y, w, h, isGateway)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- if (!isGateway)
- {
- c.setShadow(false);
- }
- var inset = 2;
- c.ellipse(w * 0.02 + inset, h * 0.02 + inset, w * 0.96 - 2 *inset, h * 0.96 - 2 * inset);
- c.stroke();
- },
- 'end': function(c, x, y, w, h, isGateway)
- {
- var sw = c.state.strokeWidth;
- c.setStrokeWidth(sw * 3);
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setStrokeWidth(sw);
- if (!isGateway)
- {
- c.setShadow(false);
- }
- }
- };
- //Contains all possible symbols
- mxBpmnShape.prototype.symbols = {
- 'general' : function(c, x, y, w, h)
- {
- },
- 'message': function(c, x, y, w, h, layer, isInverse)
- {
- c.rect(0, 0, w, h);
- c.fillAndStroke();
- var fc = mxUtils.getValue(this.style, "fillColor", "none");
- if (fc === 'none')
- {
- if (isInverse)
- {
- c.setStrokeColor('#ffffff');
- }
- }
-
- c.begin();
- c.moveTo(0, 0);
- c.lineTo(w * 0.5, h * 0.5);
- c.lineTo(w, 0);
- c.stroke();
- },
- 'timer' : function(c, x, y, w, h)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.begin();
- c.moveTo(w * 0.5, 0);
- c.lineTo(w * 0.5, h * 0.0642);
- c.moveTo(w * 0.7484, h * 0.0654);
- c.lineTo(w * 0.7126, h * 0.1281);
- c.moveTo(w * 0.93, h * 0.2471);
- c.lineTo(w * 0.8673, h * 0.2854);
- c.moveTo(w, h * 0.5);
- c.lineTo(w * 0.9338, h * 0.5);
- c.moveTo(w * 0.93, h * 0.7509);
- c.lineTo(w * 0.8673, h * 0.7126);
- c.moveTo(w * 0.7484, h * 0.9326);
- c.lineTo(w * 0.7126, h * 0.8699);
- c.moveTo(w * 0.5, h * 0.9338);
- c.lineTo(w * 0.5, h);
- c.moveTo(w * 0.2496, h * 0.9325);
- c.lineTo(w * 0.2854, h * 0.8699);
- c.moveTo(w * 0.068, h * 0.7509);
- c.lineTo(w * 0.1307, h * 0.7126);
- c.moveTo(0, h * 0.5);
- c.lineTo(w * 0.0642, h * 0.5);
- c.moveTo(w * 0.068, h * 0.2471);
- c.lineTo(w * 0.1307, h * 0.2854);
- c.moveTo(w * 0.2496, h * 0.0654);
- c.lineTo(w * 0.2854, h * 0.1281);
- c.moveTo(w * 0.5246, h * 0.0706);
- c.lineTo(w * 0.5, h * 0.5);
- c.lineTo(w * 0.7804, h * 0.5118);
- c.stroke();
- },
- 'escalation' : function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(0, h);
- c.lineTo(w * 0.5, 0);
- c.lineTo(w, h);
- c.lineTo(w * 0.5, h * 0.5);
- c.close();
- c.fillAndStroke();
- },
- 'conditional' : function(c, x, y, w, h)
- {
- c.rect(0, 0, w, h);
- c.fillAndStroke();
- c.begin();
- c.moveTo(0, h * 0.1027);
- c.lineTo(w * 0.798, h * 0.1027);
- c.moveTo(0, h * 0.3669);
- c.lineTo(w * 0.798, h * 0.3669);
- c.moveTo(0, h * 0.6311);
- c.lineTo(w * 0.798, h * 0.6311);
- c.moveTo(0, h * 0.8953);
- c.lineTo(w * 0.798, h * 0.8953);
- c.stroke();
- },
- 'link' : function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(0, h * 0.76);
- c.lineTo(0, h * 0.24);
- c.lineTo(w * 0.63, h * 0.24);
- c.lineTo(w * 0.63, 0);
- c.lineTo(w, h * 0.5);
- c.lineTo(w * 0.63, h);
- c.lineTo(w * 0.63, h * 0.76);
- c.close();
- c.fillAndStroke();
- },
- 'error' : function(c, x, y, w, h, layer, isInverse)
- {
- c.begin();
- c.moveTo(0, h);
- c.lineTo(w * 0.3287, h * 0.123);
- c.lineTo(w * 0.6194, h * 0.6342);
- c.lineTo(w, 0);
- c.lineTo(w * 0.6625, h * 0.939);
- c.lineTo(w * 0.3717, h * 0.5064);
- c.close();
- if(isInverse)
- {
- c.fill();
- }
- else
- {
- c.fillAndStroke();
- }
- },
- 'cancel' : function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(w * 0.1051, 0);
- c.lineTo(w * 0.5, h * 0.3738);
- c.lineTo(w * 0.8909, 0);
- c.lineTo(w, h * 0.1054);
- c.lineTo(w * 0.623, h * 0.5);
- c.lineTo(w, h * 0.8926);
- c.lineTo(w * 0.8909, h);
- c.lineTo(w * 0.5, h * 0.6242);
- c.lineTo(w * 0.1051, h);
- c.lineTo(0, h * 0.8926);
- c.lineTo(w * 0.373, h * 0.5);
- c.lineTo(0, h * 0.1054);
- c.close();
- c.fillAndStroke();
- },
- 'compensation' : function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(0, h * 0.5);
- c.lineTo(w * 0.5, 0);
- c.lineTo(w * 0.5, h);
- c.close();
- c.moveTo(w * 0.5, h * 0.5);
- c.lineTo(w, 0);
- c.lineTo(w, h);
- c.close();
- c.fillAndStroke();
- },
- 'signal' : function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(0, h);
- c.lineTo(w * 0.5, 0);
- c.lineTo(w, h);
- c.close();
- c.fillAndStroke();
- },
- 'multiple' : function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(0, h * 0.39);
- c.lineTo(w * 0.5, 0);
- c.lineTo(w, h * 0.39);
- c.lineTo(w * 0.815, h);
- c.lineTo(w * 0.185, h);
- c.close();
- c.fillAndStroke();
- },
- 'parallelMultiple' : function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(w * 0.38, 0);
- c.lineTo(w * 0.62, 0);
- c.lineTo(w * 0.62, h * 0.38);
- c.lineTo(w, h * 0.38);
- c.lineTo(w, h * 0.62);
- c.lineTo(w * 0.62, h * 0.62);
- c.lineTo(w * 0.62, h);
- c.lineTo(w * 0.38, h);
- c.lineTo(w * 0.38, h * 0.62);
- c.lineTo(0, h * 0.62);
- c.lineTo(0, h * 0.38);
- c.lineTo(w * 0.38, h * 0.38);
- c.close();
- c.fillAndStroke();
- },
- 'terminate' : function(c, x, y, w, h)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- },
- 'exclusiveGw' : function(c, x, y, w, h)
- {
- var strokeColor = c.state.strokeColor;
- var fillColor = c.state.fillColor;
- c.setStrokeColor(fillColor);
- c.setFillColor(strokeColor);
- c.begin();
- c.moveTo(w * 0.105, 0);
- c.lineTo(w * 0.5, h * 0.38);
- c.lineTo(w * 0.895, h * 0);
- c.lineTo(w, h * 0.11);
- c.lineTo(w * 0.6172, h * 0.5);
- c.lineTo(w, h * 0.89);
- c.lineTo(w * 0.895, h);
- c.lineTo(w * 0.5, h * 0.62);
- c.lineTo(w * 0.105, h);
- c.lineTo(0, h * 0.89);
- c.lineTo(w * 0.3808, h * 0.5);
- c.lineTo(0, h * 0.11);
- c.close();
- c.fillAndStroke();
- c.setStrokeColor(strokeColor);
- c.setFillColor(fillColor);
- },
- 'parallelGw' : function(c, x, y, w, h)
- {
- var strokeColor = c.state.strokeColor;
- var fillColor = c.state.fillColor;
- c.setStrokeColor(fillColor);
- c.setFillColor(strokeColor);
- c.begin();
- c.moveTo(w * 0.38, 0);
- c.lineTo(w * 0.62, 0);
- c.lineTo(w * 0.62, h * 0.38);
- c.lineTo(w, h * 0.38);
- c.lineTo(w, h * 0.62);
- c.lineTo(w * 0.62, h * 0.62);
- c.lineTo(w * 0.62, h);
- c.lineTo(w * 0.38, h);
- c.lineTo(w * 0.38, h * 0.62);
- c.lineTo(0, h * 0.62);
- c.lineTo(0, h * 0.38);
- c.lineTo(w * 0.38, h * 0.38);
- c.close();
- c.fillAndStroke();
- c.setStrokeColor(strokeColor);
- c.setFillColor(fillColor);
- },
- 'complexGw' : function(c, x, y, w, h)
- {
- var strokeColor = c.state.strokeColor;
- var fillColor = c.state.fillColor;
- c.setStrokeColor(fillColor);
- c.setFillColor(strokeColor);
- c.begin();
- c.moveTo(0, h * 0.44);
- c.lineTo(w * 0.36, h * 0.44);
- c.lineTo(w * 0.1, h * 0.18);
- c.lineTo(w * 0.18, h * 0.1);
- c.lineTo(w * 0.44, h * 0.36);
- c.lineTo(w * 0.44, 0);
- c.lineTo(w * 0.56, 0);
- c.lineTo(w * 0.56, h * 0.36);
- c.lineTo(w * 0.82, h * 0.1);
- c.lineTo(w * 0.90, h * 0.18);
- c.lineTo(w * 0.64, h * 0.44);
- c.lineTo(w, h * 0.44);
- c.lineTo(w, h * 0.56);
- c.lineTo(w * 0.64, h * 0.56);
- c.lineTo(w * 0.9, h * 0.82);
- c.lineTo(w * 0.82, h * 0.9);
- c.lineTo(w * 0.56, h * 0.64);
- c.lineTo(w * 0.56, h);
- c.lineTo(w * 0.44, h);
- c.lineTo(w * 0.44, h * 0.64);
- c.lineTo(w * 0.18, h * 0.9);
- c.lineTo(w * 0.1, h * 0.82);
- c.lineTo(w * 0.36, h * 0.56);
- c.lineTo(0, h * 0.56);
- c.close();
- c.fillAndStroke();
- c.setStrokeColor(strokeColor);
- c.setFillColor(fillColor);
- },
- 'star': function(c, x, y, w, h)
- {
- c.translate(w / 5, h / 6);
- h *= 2 / 3;
- w *= 3 / 5;
-
- c.begin();
- c.moveTo(0, h / 4);
- c.lineTo(w / 3, h / 4);
- c.lineTo(w / 2, 0);
- c.lineTo(2 * w / 3, h / 4);
- c.lineTo(w, h / 4);
- c.lineTo(5 * w / 6, h / 2);
- c.lineTo(w, 3 * h / 4);
- c.lineTo(2 * w / 3, 3 * h / 4);
- c.lineTo(w / 2, h);
- c.lineTo(w / 3, 3 * h / 4);
- c.lineTo(0, 3 * h / 4);
- c.lineTo(w / 6, h / 2);
- c.close();
- c.fillAndStroke();
- }
- };
- mxCellRenderer.registerShape('mxgraph.bpmn.shape', mxBpmnShape);
- //**********************************************************************************************************************************************************
- //Send / Receive marker
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeBpmn2SendMarker(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- this.dy = 0.5;
- this.dx = 0.5;
- this.notch = 0;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeBpmn2SendMarker, mxActor);
- mxShapeBpmn2SendMarker.prototype.cst = {
- SEND : 'mxgraph.bpmn.sendMarker'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeBpmn2SendMarker.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- c.rect(0, 0, w, h);
- c.fillAndStroke();
-
- c.setShadow(false);
- c.begin();
- c.moveTo(0,0);
- c.lineTo(w * 0.5, h * 0.5);
- c.lineTo(w, 0);
- c.stroke();
- };
- mxCellRenderer.registerShape(mxShapeBpmn2SendMarker.prototype.cst.SEND, mxShapeBpmn2SendMarker);
- // BPMN event shape
- function mxShapeBpmnEvent(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeBpmnEvent, mxShape);
- mxShapeBpmnEvent.prototype.eventTypeEnum = {
- START_STANDARD : 'standard',
- EVENT_SP_INT : 'eventInt',
- EVENT_SP_NONINT : 'eventNonint',
- CATCHING : 'catching',
- BOUND_INT : 'boundInt',
- BOUND_NONINT : 'boundNonint',
- THROWING : 'throwing',
- END : 'end',
- NONE : 'none'};
- mxShapeBpmnEvent.prototype.eventEnum = {
- GENERAL : 'general',
- MESSAGE : 'message',
- TIMER : 'timer',
- ESCALATION : 'escalation',
- CONDITIONAL : 'conditional',
- LINK : 'link',
- ERROR : 'error',
- CANCEL : 'cancel',
- COMPENSATION : 'compensation',
- SIGNAL : 'signal',
- MULTIPLE : 'multiple',
- PAR_MULTI : 'parallelMultiple',
- TERMINATE : 'terminate'};
- mxShapeBpmnEvent.prototype.miscEnum = {
- OUTLINE : 'outline',
- SYMBOL : 'symbol'};
- mxShapeBpmnEvent.prototype.customProperties = [
- {name: mxShapeBpmnEvent.prototype.miscEnum.SYMBOL, dispName: 'Event', type: 'enum', defVal:mxShapeBpmnEvent.prototype.eventEnum.GENERAL,
- enumList: [{val: mxShapeBpmnEvent.prototype.eventEnum.GENERAL, dispName: 'General'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.MESSAGE, dispName: 'Message'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.TIMER, dispName: 'Timer'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.ESCALATION, dispName: 'Escalation'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.CONDITIONAL, dispName: 'Conditional'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.LINK, dispName: 'Link'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.ERROR, dispName: 'Error'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.CANCEL, dispName: 'Cancel'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.COMPENSATION, dispName: 'Compensation'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.SIGNAL, dispName: 'Signal'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.MULTIPLE, dispName: 'Multiple'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.PAR_MULTI, dispName: 'Parallel Multiple'},
- {val: mxShapeBpmnEvent.prototype.eventEnum.TERMINATE, dispName: 'Terminate'}]
- },
- {name: mxShapeBpmnEvent.prototype.miscEnum.OUTLINE, dispName: 'Event Type', type: 'enum', defVal:mxShapeBpmnEvent.prototype.eventTypeEnum.START_STANDARD,
- enumList: [{val: mxShapeBpmnEvent.prototype.eventTypeEnum.START_STANDARD, dispName: 'Standard'},
- {val: mxShapeBpmnEvent.prototype.eventTypeEnum.EVENT_SP_INT, dispName: 'Interrupting'},
- {val: mxShapeBpmnEvent.prototype.eventTypeEnum.EVENT_SP_NONINT, dispName: 'Non-Interrupting'},
- {val: mxShapeBpmnEvent.prototype.eventTypeEnum.CATCHING, dispName: 'Catching'},
- {val: mxShapeBpmnEvent.prototype.eventTypeEnum.BOUND_INT, dispName: 'Bound Interrupting'},
- {val: mxShapeBpmnEvent.prototype.eventTypeEnum.BOUND_NONINT, dispName: 'Bound Non-Interrupting'},
- {val: mxShapeBpmnEvent.prototype.eventTypeEnum.THROWING, dispName: 'Throwing'},
- {val: mxShapeBpmnEvent.prototype.eventTypeEnum.END, dispName: 'End'},
- {val: mxShapeBpmnEvent.prototype.eventTypeEnum.NONE, dispName: 'None'}]
- }];
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeBpmnEvent.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- this.strictDrawShape(c, 0, 0, w, h, null);
- }
- mxShapeBpmnEvent.prototype.strictDrawShape = function(c, x, y, w, h, outline, symbol)
- {
- // draw event outline
- if (outline == null)
- {
- outline = mxUtils.getValue(this.style, this.miscEnum.OUTLINE, this.eventTypeEnum.NONE);
- }
- if (outline != null)
- {
- var f = mxShapeBpmnEvent.prototype.outlines[outline];
- if (f != null)
- {
- c.translate(x,y);
- f.call(this, c, x, y, w, h);
- }
- }
-
- // draw event symbol
- if (symbol == null)
- {
- symbol = mxUtils.getValue(this.style, this.miscEnum.SYMBOL, null);
- }
- if (symbol != null)
- {
- var f = mxShapeBpmnEvent.prototype.symbols[symbol];
- if (f != null)
- {
- var strokeColor = c.state.strokeColor;
- var fillColor = c.state.fillColor;
- if (symbol === this.eventEnum.MESSAGE)
- {
- c.translate(w * 0.15, h * 0.3);
- w = w * 0.7;
- h = h * 0.4;
- }
- else if (symbol === this.eventEnum.TIMER)
- {
- c.translate(w * 0.11, h * 0.11);
- w = w * 0.78;
- h = h * 0.78;
- }
- else if (symbol === this.eventEnum.ESCALATION)
- {
- c.translate(w * 0.19, h * 0.15);
- w = w * 0.62;
- h = h * 0.57;
- }
- else if (symbol === this.eventEnum.CONDITIONAL)
- {
- c.translate(w * 0.3, h * 0.16);
- w = w * 0.4;
- h = h * 0.68;
- }
- else if (symbol === this.eventEnum.LINK)
- {
- c.translate(w * 0.27, h * 0.33);
- w = w * 0.46;
- h = h * 0.34;
- }
- else if (symbol === this.eventEnum.ERROR)
- {
- c.translate(w * 0.212, h * 0.243);
- w = w * 0.58;
- h = h * 0.507;
- }
- else if (symbol === this.eventEnum.CANCEL)
- {
- c.translate(w * 0.22, h * 0.22);
- w = w * 0.56;
- h = h * 0.56;
- }
- else if (symbol === this.eventEnum.COMPENSATION)
- {
- c.translate(w * 0.28, h * 0.35);
- w = w * 0.44;
- h = h * 0.3;
- }
- else if (symbol === this.eventEnum.SIGNAL)
- {
- c.translate(w * 0.19, h * 0.15);
- w = w * 0.62;
- h = h * 0.57;
- }
- else if (symbol === this.eventEnum.MULTIPLE)
- {
- c.translate(w * 0.2, h * 0.19);
- w = w * 0.6;
- h = h * 0.565;
- }
- else if (symbol === this.eventEnum.PAR_MULTI)
- {
- c.translate(w * 0.2, h * 0.2);
- w = w * 0.6;
- h = h * 0.6;
- }
- else if (symbol === this.eventEnum.TERMINATE)
- {
- c.translate(w * 0.05, h * 0.05);
- w = w * 0.9;
- h = h * 0.9;
- }
- else if (symbol === this.eventEnum.GW_EXCLUSIVE)
- {
- c.translate(w * 0.12, 0);
- w = w * 0.76;
- }
-
- var isInverse = false;
-
- if (symbol === 'star')
- {
- c.setFillColor(strokeColor);
- }
- else if (outline === this.eventTypeEnum.THROWING || outline === this.eventTypeEnum.END)
- {
- c.setStrokeColor(fillColor);
- c.setFillColor(strokeColor);
- isInverse = true;
- }
- f.call(this, c, x, y, w, h, isInverse);
-
- if (symbol === 'star')
- {
- c.setFillColor(fillColor);
- }
- else if (outline === this.eventTypeEnum.THROWING || outline === this.eventTypeEnum.END)
- {
- c.setStrokeColor(strokeColor);
- c.setFillColor(fillColor);
- }
- }
- }
- }
- //Contains all possible outlines
- mxShapeBpmnEvent.prototype.outlines = {
- 'none' : function(c, x, y, w, h)
- {
- c.setShadow(false);
- },
- 'standard': function(c, x, y, w, h)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setShadow(false);
- },
- 'eventInt': function(c, x, y, w, h)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setShadow(false);
- },
- 'eventNonint': function(c, x, y, w, h)
- {
- var dashed = c.state.dashed;
- c.setDashed(true);
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setDashed(dashed);
- c.setShadow(false);
- },
- 'catching': function(c, x, y, w, h)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setShadow(false);
- var inset = 2;
- c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
- c.stroke();
- },
- 'boundInt': function(c, x, y, w, h)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setShadow(false);
-
- var inset = 2;
- c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
- c.stroke();
- },
- 'boundNonint': function(c, x, y, w, h)
- {
- var dashed = c.state.dashed;
- c.setDashed(true);
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setShadow(false);
- var inset = 2;
- c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
- c.stroke();
- c.setDashed(dashed);
- },
- 'throwing': function(c, x, y, w, h)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setShadow(false);
- var inset = 2;
- c.ellipse(w * 0.02 + inset, h * 0.02 + inset, w * 0.96 - 2 *inset, h * 0.96 - 2 * inset);
- c.stroke();
- },
- 'end': function(c, x, y, w, h)
- {
- var sw = c.state.strokeWidth;
- c.setStrokeWidth(sw * 3);
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.setStrokeWidth(sw);
- c.setShadow(false);
- }
- };
- //Contains all possible symbols
- mxShapeBpmnEvent.prototype.symbols = {
- 'general' : function(c, x, y, w, h, isInverse)
- {
- },
- 'message': function(c, x, y, w, h, isInverse)
- {
- c.rect(0, 0, w, h);
- c.fillAndStroke();
- var fc = mxUtils.getValue(this.style, "fillColor", "none");
- if (fc === 'none')
- {
- if (isInverse)
- {
- c.setStrokeColor('#ffffff');
- }
- }
-
- c.begin();
- c.moveTo(0, 0);
- c.lineTo(w * 0.5, h * 0.5);
- c.lineTo(w, 0);
- c.stroke();
- },
- 'timer' : function(c, x, y, w, h, isInverse)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- c.begin();
- c.moveTo(w * 0.5, 0);
- c.lineTo(w * 0.5, h * 0.0642);
- c.moveTo(w * 0.7484, h * 0.0654);
- c.lineTo(w * 0.7126, h * 0.1281);
- c.moveTo(w * 0.93, h * 0.2471);
- c.lineTo(w * 0.8673, h * 0.2854);
- c.moveTo(w, h * 0.5);
- c.lineTo(w * 0.9338, h * 0.5);
- c.moveTo(w * 0.93, h * 0.7509);
- c.lineTo(w * 0.8673, h * 0.7126);
- c.moveTo(w * 0.7484, h * 0.9326);
- c.lineTo(w * 0.7126, h * 0.8699);
- c.moveTo(w * 0.5, h * 0.9338);
- c.lineTo(w * 0.5, h);
- c.moveTo(w * 0.2496, h * 0.9325);
- c.lineTo(w * 0.2854, h * 0.8699);
- c.moveTo(w * 0.068, h * 0.7509);
- c.lineTo(w * 0.1307, h * 0.7126);
- c.moveTo(0, h * 0.5);
- c.lineTo(w * 0.0642, h * 0.5);
- c.moveTo(w * 0.068, h * 0.2471);
- c.lineTo(w * 0.1307, h * 0.2854);
- c.moveTo(w * 0.2496, h * 0.0654);
- c.lineTo(w * 0.2854, h * 0.1281);
- c.moveTo(w * 0.5246, h * 0.0706);
- c.lineTo(w * 0.5, h * 0.5);
- c.lineTo(w * 0.7804, h * 0.5118);
- c.stroke();
- },
- 'escalation' : function(c, x, y, w, h, isInverse)
- {
- c.setMiterLimit(6);
- c.begin();
- c.moveTo(0, h);
- c.lineTo(w * 0.5, 0);
- c.lineTo(w, h);
- c.lineTo(w * 0.5, h * 0.5);
- c.close();
-
- if (isInverse)
- {
- c.fill();
- }
- else
- {
- c.fillAndStroke();
- }
- },
- 'conditional' : function(c, x, y, w, h, isInverse)
- {
- c.rect(0, 0, w, h);
- c.fillAndStroke();
- c.begin();
- c.moveTo(0, h * 0.1027);
- c.lineTo(w * 0.798, h * 0.1027);
- c.moveTo(0, h * 0.3669);
- c.lineTo(w * 0.798, h * 0.3669);
- c.moveTo(0, h * 0.6311);
- c.lineTo(w * 0.798, h * 0.6311);
- c.moveTo(0, h * 0.8953);
- c.lineTo(w * 0.798, h * 0.8953);
- c.stroke();
- },
- 'link' : function(c, x, y, w, h, isInverse)
- {
- c.begin();
- c.moveTo(0, h * 0.76);
- c.lineTo(0, h * 0.24);
- c.lineTo(w * 0.63, h * 0.24);
- c.lineTo(w * 0.63, 0);
- c.lineTo(w, h * 0.5);
- c.lineTo(w * 0.63, h);
- c.lineTo(w * 0.63, h * 0.76);
- c.close();
-
- isInverse ? c.fill() : c.fillAndStroke();
- },
- 'error' : function(c, x, y, w, h, isInverse)
- {
- c.setMiterLimit(7);
- c.begin();
- c.moveTo(0, h);
- c.lineTo(w * 0.3287, h * 0.123);
- c.lineTo(w * 0.6194, h * 0.6342);
- c.lineTo(w, 0);
- c.lineTo(w * 0.6625, h * 0.939);
- c.lineTo(w * 0.3717, h * 0.5064);
- c.close();
-
- isInverse ? c.fill() : c.fillAndStroke();
- },
- 'cancel' : function(c, x, y, w, h, isInverse)
- {
- c.begin();
- c.moveTo(w * 0.1051, 0);
- c.lineTo(w * 0.5, h * 0.3738);
- c.lineTo(w * 0.8909, 0);
- c.lineTo(w, h * 0.1054);
- c.lineTo(w * 0.623, h * 0.5);
- c.lineTo(w, h * 0.8926);
- c.lineTo(w * 0.8909, h);
- c.lineTo(w * 0.5, h * 0.6242);
- c.lineTo(w * 0.1051, h);
- c.lineTo(0, h * 0.8926);
- c.lineTo(w * 0.373, h * 0.5);
- c.lineTo(0, h * 0.1054);
- c.close();
-
- isInverse ? c.fill() : c.fillAndStroke();
- },
- 'compensation' : function(c, x, y, w, h, isInverse)
- {
- c.setMiterLimit(1);
- c.begin();
- c.moveTo(0, h * 0.5);
- c.lineTo(w * 0.5, 0);
- c.lineTo(w * 0.5, h);
- c.close();
- c.moveTo(w * 0.5, h * 0.5);
- c.lineTo(w, 0);
- c.lineTo(w, h);
- c.close();
-
- isInverse ? c.fill() : c.fillAndStroke();
- },
- 'signal' : function(c, x, y, w, h, isInverse)
- {
- c.begin();
- c.moveTo(0, h);
- c.lineTo(w * 0.5, 0);
- c.lineTo(w, h);
- c.close();
-
- isInverse ? c.fill() : c.fillAndStroke();
- },
- 'multiple' : function(c, x, y, w, h, isInverse)
- {
- c.begin();
- c.moveTo(0, h * 0.39);
- c.lineTo(w * 0.5, 0);
- c.lineTo(w, h * 0.39);
- c.lineTo(w * 0.815, h);
- c.lineTo(w * 0.185, h);
- c.close();
-
- isInverse ? c.fill() : c.fillAndStroke();
- },
- 'parallelMultiple' : function(c, x, y, w, h, isInverse)
- {
- c.begin();
- c.moveTo(w * 0.38, 0);
- c.lineTo(w * 0.62, 0);
- c.lineTo(w * 0.62, h * 0.38);
- c.lineTo(w, h * 0.38);
- c.lineTo(w, h * 0.62);
- c.lineTo(w * 0.62, h * 0.62);
- c.lineTo(w * 0.62, h);
- c.lineTo(w * 0.38, h);
- c.lineTo(w * 0.38, h * 0.62);
- c.lineTo(0, h * 0.62);
- c.lineTo(0, h * 0.38);
- c.lineTo(w * 0.38, h * 0.38);
- c.close();
-
- isInverse ? c.fill() : c.fillAndStroke();
- },
- 'terminate' : function(c, x, y, w, h, isInverse)
- {
- c.ellipse(0, 0, w, h);
- c.fillAndStroke();
- },
- 'star': function(c, x, y, w, h, isInverse)
- {
- c.translate(w / 5, h / 6);
- h *= 2 / 3;
- w *= 3 / 5;
-
- c.begin();
- c.moveTo(0, h / 4);
- c.lineTo(w / 3, h / 4);
- c.lineTo(w / 2, 0);
- c.lineTo(2 * w / 3, h / 4);
- c.lineTo(w, h / 4);
- c.lineTo(5 * w / 6, h / 2);
- c.lineTo(w, 3 * h / 4);
- c.lineTo(2 * w / 3, 3 * h / 4);
- c.lineTo(w / 2, h);
- c.lineTo(w / 3, 3 * h / 4);
- c.lineTo(0, 3 * h / 4);
- c.lineTo(w / 6, h / 2);
- c.close();
- c.fillAndStroke();
- }
- };
- mxCellRenderer.registerShape('mxgraph.bpmn.event', mxShapeBpmnEvent);
- //BPMN gateway shape
- function mxShapeBpmnGateway(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeBpmnGateway, mxShape);
- mxShapeBpmnGateway.prototype.customProperties = mxShapeBpmnEvent.prototype.customProperties;
- mxShapeBpmnGateway.prototype.eventTypeEnum = mxShapeBpmnEvent.prototype.eventTypeEnum;
- mxShapeBpmnGateway.prototype.eventEnum = mxShapeBpmnEvent.prototype.eventEnum;
- mxShapeBpmnGateway.prototype.miscEnum = mxShapeBpmnEvent.prototype.miscEnum;
- mxShapeBpmnGateway.prototype.customProperties = mxShapeBpmnGateway.prototype.customProperties.concat(
- {name: 'gwType', dispName: 'Gateway type', type: 'enum', defVal:'event',
- enumList: [{val: 'event', dispName: 'Event-based'},
- {val: 'exclusive', dispName: 'Exclusive'},
- {val: 'parallel', dispName: 'Parallel'},
- {val: 'complex', dispName: 'Complex'}]});
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeBpmnGateway.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- c.begin();
- c.moveTo(w * 0.5, 0);
- c.lineTo(w, h * 0.5);
- c.lineTo(w * 0.5, h);
- c.lineTo(0, h * 0.5);
- c.close();
- c.fillAndStroke();
- c.setShadow(false);
-
- var symbolW = w * 0.6;
- var symbolH = h * 0.6;
-
- var gwType = mxUtils.getValue(this.style, 'gwType', 'event');
- var outline = mxUtils.getValue(this.style, 'outline', 'none');
- var symbol = mxUtils.getValue(this.style, 'symbol', 'standard');
- var tmpW = w * 0.5;
- var tmpH = h * 0.5;
-
- if (gwType === 'event' && outline !== null && outline !== 'none')
- {
- mxShapeBpmnEvent.prototype.strictDrawShape.call(this, c, (w - symbolW) * 0.5, (h - symbolH) * 0.5, symbolW, symbolH, outline, symbol);
- }
- else if (gwType == 'exclusive')
- {
- c.translate(w * 0.31, h * 0.25);
- tmpW = tmpW * 0.76;
- var strokeColor = c.state.strokeColor;
- var fillColor = c.state.fillColor;
- c.setFillColor(strokeColor);
- c.begin();
- c.moveTo(tmpW * 0.105, 0);
- c.lineTo(tmpW * 0.5, tmpH * 0.38);
- c.lineTo(tmpW * 0.895, tmpH * 0);
- c.lineTo(tmpW, tmpH * 0.11);
- c.lineTo(tmpW * 0.6172, tmpH * 0.5);
- c.lineTo(tmpW, tmpH * 0.89);
- c.lineTo(tmpW * 0.895, tmpH);
- c.lineTo(tmpW * 0.5, tmpH * 0.62);
- c.lineTo(tmpW * 0.105, tmpH);
- c.lineTo(0, tmpH * 0.89);
- c.lineTo(tmpW * 0.3808, tmpH * 0.5);
- c.lineTo(0, tmpH * 0.11);
- c.close();
- c.fillAndStroke();
- c.setFillColor(fillColor);
- c.translate(-tmpW * 0.12, 0);
- }
- else if (gwType == 'parallel')
- {
- c.translate(w * 0.25, h * 0.25);
- var strokeColor = c.state.strokeColor;
- var fillColor = c.state.fillColor;
- c.setFillColor(strokeColor);
- c.begin();
- c.moveTo(tmpW * 0.38, 0);
- c.lineTo(tmpW * 0.62, 0);
- c.lineTo(tmpW * 0.62, tmpH * 0.38);
- c.lineTo(tmpW, tmpH * 0.38);
- c.lineTo(tmpW, tmpH * 0.62);
- c.lineTo(tmpW * 0.62, tmpH * 0.62);
- c.lineTo(tmpW * 0.62, tmpH);
- c.lineTo(tmpW * 0.38, tmpH);
- c.lineTo(tmpW * 0.38, tmpH * 0.62);
- c.lineTo(0, tmpH * 0.62);
- c.lineTo(0, tmpH * 0.38);
- c.lineTo(tmpW * 0.38, tmpH * 0.38);
- c.close();
- c.fillAndStroke();
- c.setFillColor(fillColor);
- }
- else if (gwType == 'complex')
- {
- c.translate(w * 0.25, h * 0.25);
- var strokeColor = c.state.strokeColor;
- var fillColor = c.state.fillColor;
- c.setFillColor(strokeColor);
- c.begin();
- c.moveTo(0, tmpH * 0.44);
- c.lineTo(tmpW * 0.36, tmpH * 0.44);
- c.lineTo(tmpW * 0.1, tmpH * 0.18);
- c.lineTo(tmpW * 0.18, tmpH * 0.1);
- c.lineTo(tmpW * 0.44, tmpH * 0.36);
- c.lineTo(tmpW * 0.44, 0);
- c.lineTo(tmpW * 0.56, 0);
- c.lineTo(tmpW * 0.56, tmpH * 0.36);
- c.lineTo(tmpW * 0.82, tmpH * 0.1);
- c.lineTo(tmpW * 0.90, tmpH * 0.18);
- c.lineTo(tmpW * 0.64, tmpH * 0.44);
- c.lineTo(tmpW, tmpH * 0.44);
- c.lineTo(tmpW, tmpH * 0.56);
- c.lineTo(tmpW * 0.64, tmpH * 0.56);
- c.lineTo(tmpW * 0.9, tmpH * 0.82);
- c.lineTo(tmpW * 0.82, tmpH * 0.9);
- c.lineTo(tmpW * 0.56, tmpH * 0.64);
- c.lineTo(tmpW * 0.56, tmpH);
- c.lineTo(tmpW * 0.44, tmpH);
- c.lineTo(tmpW * 0.44, tmpH * 0.64);
- c.lineTo(tmpW * 0.18, tmpH * 0.9);
- c.lineTo(tmpW * 0.1, tmpH * 0.82);
- c.lineTo(tmpW * 0.36, tmpH * 0.56);
- c.lineTo(0, tmpH * 0.56);
- c.close();
- c.fillAndStroke();
- c.setFillColor(fillColor);
- }
- }
- mxCellRenderer.registerShape('mxgraph.bpmn.gateway2', mxShapeBpmnGateway);
- //**********************************************************************************************************************************************************
- //Task
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeBpmn2Task(bounds, fill, stroke, strokewidth)
- {
- mxCellRenderer.prototype.getShape('mxgraph.basic.rect').call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- this.dy = 0.5;
- this.dx = 0.5;
- this.notch = 0;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeBpmn2Task, mxCellRenderer.prototype.getShape('mxgraph.basic.rect'));
- mxShapeBpmn2Task.prototype.customProperties = [
- {name: 'bpmnShapeType', dispName: 'Type', defVal: 'task', type: 'enum',
- enumList: [{val: 'task', dispName: 'Task'},
- {val: 'transaction', dispName: 'Transaction'},
- {val: 'call', dispName: 'Call'},
- {val: 'subprocess', dispName: 'Sub-Process'}]},
- {name: 'taskMarker', dispName: 'Task Marker', defVal: 'abstract', type: 'enum',
- enumList: [{val: 'abstract', dispName: 'Abstract'},
- {val: 'service', dispName: 'Service'},
- {val: 'send', dispName: 'Send'},
- {val: 'receive', dispName: 'Receive'},
- {val: 'user', dispName: 'User'},
-
- {val: 'nime', dispName: 'Non-Interrupting Message Event'},
-
- {val: 'manual', dispName: 'Manual'},
- {val: 'businessRule', dispName: 'Business Rule'},
- {val: 'script', dispName: 'Script'}]},
- {name: 'isLoopSub', dispName: 'Subprocess', type: 'bool'},
- {name: 'isLoopStandard', dispName: 'Standard Loop', type: 'bool'},
- {name: 'isLoopMultiParallel', dispName: 'Multi-Instance Parallel Loop', type: 'bool'},
- {name: 'isLoopMultiSeq', dispName: 'Multi-Instance Sequential Loop', type: 'bool'},
- {name: 'isLoopComp', dispName: 'Compensation Loop', type: 'bool'},
- {name: 'isAdHoc', dispName: 'Ad Hoc', type: 'bool'}
- ];
- mxShapeBpmn2Task.prototype.customProperties = mxShapeBpmn2Task.prototype.customProperties.concat(mxShapeBpmnEvent.prototype.customProperties);
- mxShapeBpmn2Task.prototype.customProperties = mxShapeBpmn2Task.prototype.customProperties.concat(mxCellRenderer.prototype.getShape('mxgraph.basic.rect').prototype.customProperties);
- mxShapeBpmn2Task.prototype.eventTypeEnum = mxShapeBpmnEvent.prototype.eventTypeEnum;
- mxShapeBpmn2Task.prototype.eventEnum = mxShapeBpmnEvent.prototype.eventEnum;
- mxShapeBpmn2Task.prototype.miscEnum = mxShapeBpmnEvent.prototype.miscEnum;
- mxShapeBpmn2Task.prototype.cst = {
- TASK : 'mxgraph.bpmn.task'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeBpmn2Task.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- var bpmnShapeType = mxUtils.getValue(this.style, 'bpmnShapeType', 'task');
- var taskMarker = mxUtils.getValue(this.style, 'taskMarker', 'abstract');
- var strokeWidth = mxUtils.getValue(this.style, 'strokeWidth', 1);
- var dashed = mxUtils.getValue(this.style, 'dashed', false);
- var inset = mxUtils.getValue(this.style, 'indent', 3);
- var offsetY = 14;
- var rectOutline = mxUtils.getValue(this.style, 'rectOutline', 'single');
-
- c.translate(x, y);
- var superShape = mxCellRenderer.prototype.getShape('mxgraph.basic.rect');
-
- var overrideStyles = {};
-
- if (bpmnShapeType == 'transaction')
- {
- offsetY += inset;
- overrideStyles.rectOutline = 'double';
- overrideStyles.indent = 3;
- }
- else if (bpmnShapeType == 'subprocess')
- {
- overrideStyles.dashed = true;
- }
- else if (bpmnShapeType == 'call')
- {
- overrideStyles.strokeWidth = 4;
- }
-
- superShape.prototype.strictDrawShape.call(this, c, 0, 0, w, h, overrideStyles);
- c.setStrokeWidth(strokeWidth);
- c.setDashed(dashed);
-
- if (bpmnShapeType == 'call')
- {
- c.setStrokeWidth(strokeWidth);
- }
- c.setDashed(false);
- c.setShadow(false);
- var isLoopSub = mxUtils.getValue(this.style, 'isLoopSub', false);
- var isLoopStandard = mxUtils.getValue(this.style, 'isLoopStandard', false);
- var isLoopMultiParallel = mxUtils.getValue(this.style, 'isLoopMultiParallel', false);
- var isLoopMultiSeq = mxUtils.getValue(this.style, 'isLoopMultiSeq', false);
- var isLoopComp = mxUtils.getValue(this.style, 'isLoopComp', false);
- var isAdHoc = mxUtils.getValue(this.style, 'isAdHoc', false);
- var loopnum = 0;
-
- if (isLoopStandard) loopnum++;
- if (isLoopMultiParallel) loopnum++;
- if (isLoopMultiSeq) loopnum++;
- if (isLoopComp) loopnum++;
- if (isLoopSub) loopnum++;
- if (isAdHoc) loopnum++;
-
- var iconSpaceX = 14;
- var currXOffset = - iconSpaceX * loopnum * 0.5;
-
- if (isLoopStandard)
- {
- var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.loop');
-
- if (stencil != null)
- {
- stencil.drawShape(c, this, w * 0.5 + currXOffset + 1, h - offsetY + 1, 12, 12);
- currXOffset += iconSpaceX;
- }
- }
-
- if (isLoopMultiParallel)
- {
- c.translate(w * 0.5 + currXOffset + 1, h - offsetY + 1);
-
- c.begin();
- c.moveTo(2.4, 0);
- c.lineTo(2.4, 12);
- c.moveTo(6, 0);
- c.lineTo(6, 12);
- c.moveTo(9.6, 0);
- c.lineTo(9.6, 12);
- c.stroke();
-
- c.translate(- w * 0.5 - currXOffset - 1, offsetY - 1 - h);
- currXOffset += iconSpaceX;
- }
-
- if (isLoopMultiSeq)
- {
- c.translate(w * 0.5 + currXOffset + 1, h - offsetY + 1);
-
- c.begin();
- c.moveTo(0, 2.4);
- c.lineTo(12, 2.4);
- c.moveTo(0, 6);
- c.lineTo(12, 6);
- c.moveTo(0, 9.6);
- c.lineTo(12, 9.6);
- c.stroke();
-
- c.translate(- w * 0.5 - currXOffset - 1, offsetY - 1 - h);
- currXOffset += iconSpaceX;
- }
-
- if (isLoopComp)
- {
- var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.compensation');
-
- if (stencil != null)
- {
- stencil.drawShape(c, this, w * 0.5 + currXOffset, h - offsetY + 1, 14, 12);
- currXOffset += iconSpaceX;
- }
- }
-
- if (isLoopSub)
- {
- c.translate(w * 0.5 + currXOffset, h - offsetY);
-
- c.rect(0, 0, 14, 14);
- c.stroke();
-
- c.begin();
- c.moveTo(4, 7);
- c.lineTo(10, 7);
- c.moveTo(7, 4);
- c.lineTo(7, 10);
- c.stroke();
-
- c.translate(- w * 0.5 - currXOffset, offsetY - h);
- currXOffset += iconSpaceX;
- }
-
- if (isAdHoc)
- {
- var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.ad_hoc');
-
- if (stencil != null)
- {
- var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');
- var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');
-
- c.setStrokeColor('none');
- c.setFillColor(strokeColor);
-
- stencil.drawShape(c, this, w * 0.5 + currXOffset + 1, h - offsetY + 4, 12, 6);
- currXOffset += iconSpaceX;
-
- c.setStrokeColor(strokeColor);
- c.setFillColor(fillColor);
- }
- }
-
- switch (taskMarker) {
- case 'abstract':
- break;
- case 'service':
-
- c.setFillColor(mxUtils.getValue(this.style, 'fillColor', '#ffffff'));
-
- var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.service_task');
-
- if (stencil != null)
- {
- stencil.drawShape(c, this, 2, 2, 16, 16);
- }
-
- break;
- case 'send':
- var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');
- var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');
-
- c.setStrokeColor(fillColor);
- c.setFillColor(strokeColor);
-
- mxShapeBpmn2SendMarker.prototype.paintVertexShape(c, 4, 4, 18, 13);
-
- break;
- case 'receive':
-
- mxShapeBpmn2SendMarker.prototype.paintVertexShape(c, 4, 4, 18, 13);
-
- break;
- case 'user':
- var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.user_task');
-
- if (stencil != null)
- {
- stencil.drawShape(c, this, 2, 2, 16, 16);
- }
-
- break;
- case 'manual':
- var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.manual_task');
-
- if (stencil != null)
- {
- stencil.drawShape(c, this, 3, 3, 18, 14);
- }
-
- break;
- case 'businessRule':
- var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.business_rule_task');
-
- if (stencil != null)
- {
- stencil.drawShape(c, this, 4, 4, 18, 14);
- }
-
- break;
- case 'script':
- var stencil = mxStencilRegistry.getStencil('mxgraph.bpmn.script_task');
-
- if (stencil != null)
- {
- stencil.drawShape(c, this, 3, 3, 19, 18);
- }
-
- break;
- }
- var symbolW = 20;
- var symbolH = 20;
-
- var outline = mxUtils.getValue(this.style, 'outline', 'none');
- var symbol = mxUtils.getValue(this.style, 'symbol', 'standard');
-
- mxShapeBpmnEvent.prototype.strictDrawShape.call(this, c, 0, 0, symbolW, symbolH, outline, symbol);
- };
- mxCellRenderer.registerShape(mxShapeBpmn2Task.prototype.cst.TASK, mxShapeBpmn2Task);
- //**********************************************************************************************************************************************************
- //Data
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeBpmn2Data(bounds, fill, stroke, strokewidth)
- {
- mxCellRenderer.prototype.getShape('note').call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- this.dy = 0.5;
- this.dx = 0.5;
- this.notch = 0;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeBpmn2Data, mxCellRenderer.prototype.getShape('note'));
- mxShapeBpmn2Data.prototype.cst = {
- DATA : 'mxgraph.bpmn.data'
- };
- mxShapeBpmn2Data.prototype.customProperties = [
- {name: 'bpmnTransferType', dispName: 'Transfer Type', defVal: 'none', type: 'enum',
- enumList: [{val: 'none', dispName: 'None'},
- {val: 'input', dispName: 'Input'},
- {val: 'output', dispName: 'Output'}]},
- {name: 'isCollection', dispName: 'Collection', type: 'bool'}
- ];
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeBpmn2Data.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- var superShape = mxCellRenderer.prototype.getShape('note');
- superShape.prototype.paintVertexShape.call(this, c, x, y, w, h);
- var trType = mxUtils.getValue(this.style, 'bpmnTransferType', 'none');
- var isColl = mxUtils.getValue(this.style, 'isCollection', false);
- c.setShadow(false);
-
- if (trType === 'input' || trType === 'output')
- {
- var arrX = 3;
- var arrY = 3;
- var arrW = 14;
- var arrH = 12;
-
- c.translate(arrX, arrY);
- c.begin();
- c.moveTo(0, arrH * 0.3);
- c.lineTo(arrW * 0.55, arrH * 0.3);
- c.lineTo(arrW * 0.55, 0);
- c.lineTo(arrW, arrH * 0.5);
- c.lineTo(arrW * 0.55, arrH);
- c.lineTo(arrW * 0.55, arrH * 0.7);
- c.lineTo(0, arrH * 0.7);
- c.close();
- c.translate(-arrX, -arrY);
-
- if (trType === 'input')
- {
- c.stroke();
- }
- else
- {
- var fillColor = mxUtils.getValue(this.style, 'fillColor', '#ffffff');
- var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000');
-
- c.setFillColor(strokeColor);
- c.fillAndStroke();
- c.setFillColor(fillColor);
- }
- }
-
- if (isColl)
- {
- c.translate(w * 0.5 - 6, h - 12);
-
- c.begin();
- c.moveTo(2.4, 0);
- c.lineTo(2.4, 12);
- c.moveTo(6, 0);
- c.lineTo(6, 12);
- c.moveTo(9.6, 0);
- c.lineTo(9.6, 12);
- c.stroke();
-
- c.translate( - w * 0.5 + 6, - h + 12);
- }
- };
- mxCellRenderer.registerShape(mxShapeBpmn2Data.prototype.cst.DATA, mxShapeBpmn2Data);
- Graph.handleFactory[mxShapeBpmn2Data.prototype.cst.DATA] = Graph.handleFactory['note'];
- //**********************************************************************************************************************************************************
- //Swimlane
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeBpmn2Swimlane(bounds, fill, stroke, strokewidth)
- {
- mxCellRenderer.prototype.getShape('note').call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- this.dy = 0.5;
- this.dx = 0.5;
- this.notch = 0;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeBpmn2Swimlane, mxSwimlane);
- mxShapeBpmn2Swimlane.prototype.cst = {
- SWIMLANE : 'mxgraph.bpmn.swimlane'
- };
- mxShapeBpmn2Swimlane.prototype.customProperties = [
- {name: 'isCollection', dispName: 'Collection', type: 'bool'}
- ];
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeBpmn2Swimlane.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- mxSwimlane.prototype.paintVertexShape.call(this, c, x, y, w, h);
- var isColl = mxUtils.getValue(this.style, 'isCollection', false);
- c.setShadow(false);
-
- if (isColl)
- {
- c.translate(w * 0.5 - 6, h - 12);
-
- c.begin();
- c.moveTo(2.4, 0);
- c.lineTo(2.4, 12);
- c.moveTo(6, 0);
- c.lineTo(6, 12);
- c.moveTo(9.6, 0);
- c.lineTo(9.6, 12);
- c.stroke();
-
- c.translate( - w * 0.5 + 6, - h + 12);
- }
- };
- mxCellRenderer.registerShape(mxShapeBpmn2Swimlane.prototype.cst.SWIMLANE, mxShapeBpmn2Swimlane);
- Graph.handleFactory[mxShapeBpmn2Swimlane.prototype.cst.SWIMLANE] = Graph.handleFactory['swimlane'];
- //**********************************************************************************************************************************************************
- //Conversation
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeBpmn2Conversation(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeBpmn2Conversation, mxHexagon);
- mxShapeBpmn2Conversation.prototype.customProperties = [
- {name: 'bpmnConversationType', dispName: 'Type', defVal: 'conv', type: 'enum',
- enumList: [{val: 'conv', dispName: 'Conversation'},
- {val: 'call', dispName: 'Call'}]},
- {name: 'isLoopSub', dispName: 'Subprocess', type: 'bool'}
- ];
- mxShapeBpmn2Conversation.prototype.cst = {
- CONVERSATION : 'mxgraph.bpmn.conversation'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeBpmn2Conversation.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- var bpmnConvType = mxUtils.getValue(this.style, 'bpmnConversationType', 'conv');
- var strokeWidth = mxUtils.getValue(this.style, 'strokeWidth', 1);
-
- if (bpmnConvType == 'call')
- {
- c.setStrokeWidth(strokeWidth * 4);
- }
- c.translate(x, y);
-
- c.begin();
- c.moveTo(0, h * 0.5);
- c.lineTo(w * 0.25, 0);
- c.lineTo(w * 0.75, 0);
- c.lineTo(w, h * 0.5);
- c.lineTo(w * 0.75, h);
- c.lineTo(w * 0.25, h);
- c.close();
- c.fillAndStroke();
- if (bpmnConvType == 'call')
- {
- c.setStrokeWidth(strokeWidth);
- }
- var isLoopSub = mxUtils.getValue(this.style, 'isLoopSub', false);
- if (isLoopSub)
- {
- c.translate(w * 0.5 - 7, h - 14);
-
- c.rect(0, 0, 14, 14);
- c.stroke();
-
- c.begin();
- c.moveTo(4, 7);
- c.lineTo(10, 7);
- c.moveTo(7, 4);
- c.lineTo(7, 10);
- c.stroke();
- }
- };
- mxCellRenderer.registerShape(mxShapeBpmn2Conversation.prototype.cst.CONVERSATION, mxShapeBpmn2Conversation);
|