mxBpmnShape2.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. /**
  2. * $Id: mxBpmnShape2.js,v 1.6 2013/12/20 09:54:28 mate Exp $
  3. * Copyright (c) 2006-2010, JGraph Ltd
  4. */
  5. /**
  6. * Class: mxBpmnShape
  7. *
  8. * Extends <mxShape> to implement an cylinder shape. If a
  9. * custom shape with one filled area and an overlay path is
  10. * needed, then this shape's <redrawPath> should be overridden.
  11. * This shape is registered under <mxConstants.SHAPE_CYLINDER>
  12. * in <mxCellRenderer>.
  13. *
  14. * Constructor: mxBpmnShape
  15. *
  16. * Constructs a new cylinder shape.
  17. *
  18. * Parameters:
  19. *
  20. * bounds - <mxRectangle> that defines the bounds. This is stored in
  21. * <mxShape.bounds>.
  22. * fill - String that defines the fill color. This is stored in <fill>.
  23. * stroke - String that defines the stroke color. This is stored in <stroke>.
  24. * strokewidth - Optional integer that defines the stroke width. Default is
  25. * 1. This is stored in <strokewidth>.
  26. */
  27. function mxBpmnShape(bounds, fill, stroke, strokewidth)
  28. {
  29. mxShape.call(this);
  30. this.bounds = bounds;
  31. this.fill = fill;
  32. this.stroke = stroke;
  33. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  34. };
  35. /**
  36. * Extends mxShape.
  37. */
  38. mxUtils.extend(mxBpmnShape, mxShape);
  39. mxBpmnShape.prototype.eventTypeEnum = {
  40. START_STANDARD : 'standard',
  41. EVENT_SP_INT : 'eventInt',
  42. EVENT_SP_NONINT : 'eventNonint',
  43. CATCHING : 'catching',
  44. BOUND_INT : 'boundInt',
  45. BOUND_NONINT : 'boundNonint',
  46. THROWING : 'throwing',
  47. END : 'end',
  48. NONE : 'none',
  49. GATEWAY : 'gateway'};
  50. mxBpmnShape.prototype.eventEnum = {
  51. GENERAL : 'general',
  52. MESSAGE : 'message',
  53. TIMER : 'timer',
  54. ESCALATION : 'escalation',
  55. CONDITIONAL : 'conditional',
  56. LINK : 'link',
  57. ERROR : 'error',
  58. CANCEL : 'cancel',
  59. COMPENSATION : 'compensation',
  60. SIGNAL : 'signal',
  61. MULTIPLE : 'multiple',
  62. PAR_MULTI : 'parallelMultiple',
  63. TERMINATE : 'terminate',
  64. GW_EXCLUSIVE : 'exclusiveGw',
  65. GW_PARALLEL : 'parallelGw',
  66. GW_COMPLEX : 'complexGw'};
  67. mxBpmnShape.prototype.miscEnum = {
  68. OUTLINE : 'outline',
  69. BACKGROUND : 'background',
  70. SYMBOL : 'symbol',
  71. GATEWAY : 'gateway'};
  72. /**
  73. * Function: paintVertexShape
  74. *
  75. * Paints the vertex shape.
  76. */
  77. mxBpmnShape.prototype.paintVertexShape = function(c, x, y, w, h)
  78. {
  79. this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.BACKGROUND);
  80. var bg = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.BACKGROUND, mxBpmnShape.prototype.eventTypeEnum.NONE);
  81. if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)
  82. {
  83. c.setShadow(false);
  84. }
  85. this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.OUTLINE);
  86. this.redrawPath(c, x, y, w, h, mxBpmnShape.prototype.miscEnum.SYMBOL);
  87. };
  88. /**
  89. * Function: redrawPath
  90. *
  91. * Draws the path for this shape.
  92. */
  93. mxBpmnShape.prototype.redrawPath = function(c, x, y, w, h, layer)
  94. {
  95. var bg = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.BACKGROUND, mxBpmnShape.prototype.eventTypeEnum.NONE);
  96. if (layer == mxBpmnShape.prototype.miscEnum.BACKGROUND)
  97. {
  98. if (bg != null)
  99. {
  100. var f = this.backgrounds[bg];
  101. if (f != null)
  102. {
  103. c.translate(x, y);
  104. f.call(this, c, x, y, w, h, layer);
  105. }
  106. }
  107. }
  108. else if (layer == mxBpmnShape.prototype.miscEnum.OUTLINE)
  109. {
  110. if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)
  111. {
  112. c.translate(w / 4, h / 4);
  113. h /= 2;
  114. w /= 2;
  115. //add rhombus connections here
  116. this.constraints = [
  117. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  118. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  119. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  120. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  121. new mxConnectionConstraint(new mxPoint(0.25, 0.25), false),
  122. new mxConnectionConstraint(new mxPoint(0.25, 0.75), false),
  123. new mxConnectionConstraint(new mxPoint(0.75, 0.25), false),
  124. new mxConnectionConstraint(new mxPoint(0.75, 0.75), false)
  125. ];
  126. }
  127. else
  128. {
  129. //add ellipse connections here
  130. this.constraints = [
  131. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  132. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  133. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  134. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  135. new mxConnectionConstraint(new mxPoint(0.145, 0.145), false),
  136. new mxConnectionConstraint(new mxPoint(0.145, 0.855), false),
  137. new mxConnectionConstraint(new mxPoint(0.855, 0.145), false),
  138. new mxConnectionConstraint(new mxPoint(0.855, 0.855), false)
  139. ];
  140. }
  141. var o = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.OUTLINE, mxBpmnShape.prototype.eventTypeEnum.NONE);
  142. if (o != null)
  143. {
  144. var f = this.outlines[o];
  145. if (f != null)
  146. {
  147. f.call(this, c, x, y, w, h, bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY);
  148. }
  149. }
  150. }
  151. else if (layer == mxBpmnShape.prototype.miscEnum.SYMBOL)
  152. {
  153. if (bg === mxBpmnShape.prototype.eventTypeEnum.GATEWAY)
  154. {
  155. h /= 2;
  156. w /= 2;
  157. }
  158. var s = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.SYMBOL, null);
  159. if (s != null)
  160. {
  161. var f = this.symbols[s];
  162. if (f != null)
  163. {
  164. var strokeColor = c.state.strokeColor;
  165. var fillColor = c.state.fillColor;
  166. var o = mxUtils.getValue(this.style, mxBpmnShape.prototype.miscEnum.OUTLINE, mxBpmnShape.prototype.eventTypeEnum.NONE);
  167. if (s === mxBpmnShape.prototype.eventEnum.MESSAGE)
  168. {
  169. c.translate(w * 0.15, h * 0.3);
  170. w = w * 0.7;
  171. h = h * 0.4;
  172. }
  173. else if (s === mxBpmnShape.prototype.eventEnum.TIMER)
  174. {
  175. c.translate(w * 0.11, h * 0.11);
  176. w = w * 0.78;
  177. h = h * 0.78;
  178. }
  179. else if (s === mxBpmnShape.prototype.eventEnum.ESCALATION)
  180. {
  181. c.translate(w * 0.19, h * 0.15);
  182. w = w * 0.62;
  183. h = h * 0.57;
  184. }
  185. else if (s === mxBpmnShape.prototype.eventEnum.CONDITIONAL)
  186. {
  187. c.translate(w * 0.3, h * 0.16);
  188. w = w * 0.4;
  189. h = h * 0.68;
  190. }
  191. else if (s === mxBpmnShape.prototype.eventEnum.LINK)
  192. {
  193. c.translate(w * 0.27, h * 0.33);
  194. w = w * 0.46;
  195. h = h * 0.34;
  196. }
  197. else if (s === mxBpmnShape.prototype.eventEnum.ERROR)
  198. {
  199. c.translate(w * 0.212, h * 0.243);
  200. w = w * 0.58;
  201. h = h * 0.507;
  202. }
  203. else if (s === mxBpmnShape.prototype.eventEnum.CANCEL)
  204. {
  205. c.translate(w * 0.22, h * 0.22);
  206. w = w * 0.56;
  207. h = h * 0.56;
  208. }
  209. else if (s === mxBpmnShape.prototype.eventEnum.COMPENSATION)
  210. {
  211. c.translate(w * 0.28, h * 0.35);
  212. w = w * 0.44;
  213. h = h * 0.3;
  214. }
  215. else if (s === mxBpmnShape.prototype.eventEnum.SIGNAL)
  216. {
  217. c.translate(w * 0.19, h * 0.15);
  218. w = w * 0.62;
  219. h = h * 0.57;
  220. }
  221. else if (s === mxBpmnShape.prototype.eventEnum.MULTIPLE)
  222. {
  223. c.translate(w * 0.2, h * 0.19);
  224. w = w * 0.6;
  225. h = h * 0.565;
  226. }
  227. else if (s === mxBpmnShape.prototype.eventEnum.PAR_MULTI)
  228. {
  229. c.translate(w * 0.2, h * 0.2);
  230. w = w * 0.6;
  231. h = h * 0.6;
  232. }
  233. else if (s === mxBpmnShape.prototype.eventEnum.TERMINATE)
  234. {
  235. c.translate(w * 0.05, h * 0.05);
  236. w = w * 0.9;
  237. h = h * 0.9;
  238. }
  239. else if (s === mxBpmnShape.prototype.eventEnum.GW_EXCLUSIVE)
  240. {
  241. c.translate(w * 0.12, 0);
  242. w = w * 0.76;
  243. }
  244. else if (s === mxBpmnShape.prototype.eventEnum.GW_PARALLEL)
  245. {
  246. }
  247. else if (s === mxBpmnShape.prototype.eventEnum.GW_COMPLEX)
  248. {
  249. }
  250. if (o === mxBpmnShape.prototype.eventTypeEnum.THROWING || o === mxBpmnShape.prototype.eventTypeEnum.END)
  251. {
  252. c.setStrokeColor(fillColor);
  253. c.setFillColor(strokeColor);
  254. }
  255. f.call(this, c, x, y, w, h, layer);
  256. if (o === mxBpmnShape.prototype.eventTypeEnum.THROWING || o === mxBpmnShape.prototype.eventTypeEnum.END)
  257. {
  258. c.setStrokeColor(strokeColor);
  259. c.setFillColor(fillColor);
  260. }
  261. }
  262. }
  263. }
  264. };
  265. //Contains all possible backgrounds
  266. mxBpmnShape.prototype.backgrounds = {
  267. 'none': function(c, x, y, w, h)
  268. {
  269. },
  270. 'gateway': function(c, x, y, w, h)
  271. {
  272. c.begin();
  273. c.moveTo(w / 2, 0);
  274. c.lineTo(w, h / 2);
  275. c.lineTo(w / 2, h);
  276. c.lineTo(0, h / 2);
  277. c.close();
  278. c.fillAndStroke();
  279. }
  280. };
  281. //Contains all possible outlines
  282. mxBpmnShape.prototype.outlines = {
  283. 'none' : function(c, x, y, w, h, isGateway)
  284. {
  285. if (!isGateway)
  286. {
  287. c.setShadow(false);
  288. }
  289. },
  290. 'standard': function(c, x, y, w, h, isGateway)
  291. {
  292. c.ellipse(0, 0, w, h);
  293. c.fillAndStroke();
  294. if (!isGateway)
  295. {
  296. c.setShadow(false);
  297. }
  298. },
  299. 'eventInt': function(c, x, y, w, h, isGateway)
  300. {
  301. c.ellipse(0, 0, w, h);
  302. c.fillAndStroke();
  303. if (!isGateway)
  304. {
  305. c.setShadow(false);
  306. }
  307. },
  308. 'eventNonint': function(c, x, y, w, h, isGateway)
  309. {
  310. var dashed = c.state.dashed;
  311. c.setDashed(true);
  312. c.ellipse(0, 0, w, h);
  313. c.fillAndStroke();
  314. c.setDashed(dashed);
  315. if (!isGateway)
  316. {
  317. c.setShadow(false);
  318. }
  319. },
  320. 'catching': function(c, x, y, w, h, isGateway)
  321. {
  322. c.ellipse(0, 0, w, h);
  323. c.fillAndStroke();
  324. if (!isGateway)
  325. {
  326. c.setShadow(false);
  327. }
  328. var inset = 2;
  329. c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
  330. c.stroke();
  331. },
  332. 'boundInt': function(c, x, y, w, h, isGateway)
  333. {
  334. c.ellipse(0, 0, w, h);
  335. c.fillAndStroke();
  336. if (!isGateway)
  337. {
  338. c.setShadow(false);
  339. }
  340. var inset = 2;
  341. c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
  342. c.stroke();
  343. },
  344. 'boundNonint': function(c, x, y, w, h, isGateway)
  345. {
  346. var dashed = c.state.dashed;
  347. c.setDashed(true);
  348. c.ellipse(0, 0, w, h);
  349. c.fillAndStroke();
  350. if (!isGateway)
  351. {
  352. c.setShadow(false);
  353. }
  354. var inset = 2;
  355. c.ellipse(inset, inset, w - 2 *inset, h - 2 * inset);
  356. c.stroke();
  357. c.setDashed(dashed);
  358. },
  359. 'throwing': function(c, x, y, w, h, isGateway)
  360. {
  361. c.ellipse(0, 0, w, h);
  362. c.fillAndStroke();
  363. if (!isGateway)
  364. {
  365. c.setShadow(false);
  366. }
  367. var inset = 2;
  368. c.ellipse(w * 0.02 + inset, h * 0.02 + inset, w * 0.96 - 2 *inset, h * 0.96 - 2 * inset);
  369. c.stroke();
  370. },
  371. 'end': function(c, x, y, w, h, isGateway)
  372. {
  373. var sw = c.state.strokeWidth;
  374. c.setStrokeWidth(sw * 3);
  375. c.ellipse(0, 0, w, h);
  376. c.fillAndStroke();
  377. c.setStrokeWidth(sw);
  378. if (!isGateway)
  379. {
  380. c.setShadow(false);
  381. }
  382. }
  383. };
  384. //Contains all possible symbols
  385. mxBpmnShape.prototype.symbols = {
  386. 'general' : function(c, x, y, w, h)
  387. {
  388. },
  389. 'message': function(c, x, y, w, h)
  390. {
  391. c.rect(0, 0, w, h);
  392. c.fillAndStroke();
  393. c.begin();
  394. c.moveTo(0, 0);
  395. c.lineTo(w * 0.5, h * 0.5);
  396. c.lineTo(w, 0);
  397. c.stroke();
  398. },
  399. 'timer' : function(c, x, y, w, h)
  400. {
  401. c.ellipse(0, 0, w, h);
  402. c.fillAndStroke();
  403. c.begin();
  404. c.moveTo(w * 0.5, 0);
  405. c.lineTo(w * 0.5, h * 0.0642);
  406. c.moveTo(w * 0.7484, h * 0.0654);
  407. c.lineTo(w * 0.7126, h * 0.1281);
  408. c.moveTo(w * 0.93, h * 0.2471);
  409. c.lineTo(w * 0.8673, h * 0.2854);
  410. c.moveTo(w, h * 0.5);
  411. c.lineTo(w * 0.9338, h * 0.5);
  412. c.moveTo(w * 0.93, h * 0.7509);
  413. c.lineTo(w * 0.8673, h * 0.7126);
  414. c.moveTo(w * 0.7484, h * 0.9326);
  415. c.lineTo(w * 0.7126, h * 0.8699);
  416. c.moveTo(w * 0.5, h * 0.9338);
  417. c.lineTo(w * 0.5, h);
  418. c.moveTo(w * 0.2496, h * 0.9325);
  419. c.lineTo(w * 0.2854, h * 0.8699);
  420. c.moveTo(w * 0.068, h * 0.7509);
  421. c.lineTo(w * 0.1307, h * 0.7126);
  422. c.moveTo(0, h * 0.5);
  423. c.lineTo(w * 0.0642, h * 0.5);
  424. c.moveTo(w * 0.068, h * 0.2471);
  425. c.lineTo(w * 0.1307, h * 0.2854);
  426. c.moveTo(w * 0.2496, h * 0.0654);
  427. c.lineTo(w * 0.2854, h * 0.1281);
  428. c.moveTo(w * 0.5246, h * 0.0706);
  429. c.lineTo(w * 0.5, h * 0.5);
  430. c.lineTo(w * 0.7804, h * 0.5118);
  431. c.stroke();
  432. },
  433. 'escalation' : function(c, x, y, w, h)
  434. {
  435. c.begin();
  436. c.moveTo(0, h);
  437. c.lineTo(w * 0.5, 0);
  438. c.lineTo(w, h);
  439. c.lineTo(w * 0.5, h * 0.5);
  440. c.close();
  441. c.fillAndStroke();
  442. },
  443. 'conditional' : function(c, x, y, w, h)
  444. {
  445. c.rect(0, 0, w, h);
  446. c.fillAndStroke();
  447. c.begin();
  448. c.moveTo(0, h * 0.1027);
  449. c.lineTo(w * 0.798, h * 0.1027);
  450. c.moveTo(0, h * 0.3669);
  451. c.lineTo(w * 0.798, h * 0.3669);
  452. c.moveTo(0, h * 0.6311);
  453. c.lineTo(w * 0.798, h * 0.6311);
  454. c.moveTo(0, h * 0.8953);
  455. c.lineTo(w * 0.798, h * 0.8953);
  456. c.stroke();
  457. },
  458. 'link' : function(c, x, y, w, h)
  459. {
  460. c.begin();
  461. c.moveTo(0, h * 0.76);
  462. c.lineTo(0, h * 0.24);
  463. c.lineTo(w * 0.63, h * 0.24);
  464. c.lineTo(w * 0.63, 0);
  465. c.lineTo(w, h * 0.5);
  466. c.lineTo(w * 0.63, h);
  467. c.lineTo(w * 0.63, h * 0.76);
  468. c.close();
  469. c.fillAndStroke();
  470. },
  471. 'error' : function(c, x, y, w, h)
  472. {
  473. c.begin();
  474. c.moveTo(0, h);
  475. c.lineTo(w * 0.3287, h * 0.123);
  476. c.lineTo(w * 0.6194, h * 0.6342);
  477. c.lineTo(w, 0);
  478. c.lineTo(w * 0.6625, h * 0.939);
  479. c.lineTo(w * 0.3717, h * 0.5064);
  480. c.close();
  481. c.fillAndStroke();
  482. },
  483. 'cancel' : function(c, x, y, w, h)
  484. {
  485. c.begin();
  486. c.moveTo(w * 0.1051, 0);
  487. c.lineTo(w * 0.5, h * 0.3738);
  488. c.lineTo(w * 0.8909, 0);
  489. c.lineTo(w, h * 0.1054);
  490. c.lineTo(w * 0.623, h * 0.5);
  491. c.lineTo(w, h * 0.8926);
  492. c.lineTo(w * 0.8909, h);
  493. c.lineTo(w * 0.5, h * 0.6242);
  494. c.lineTo(w * 0.1051, h);
  495. c.lineTo(0, h * 0.8926);
  496. c.lineTo(w * 0.373, h * 0.5);
  497. c.lineTo(0, h * 0.1054);
  498. c.close();
  499. c.fillAndStroke();
  500. },
  501. 'compensation' : function(c, x, y, w, h)
  502. {
  503. c.begin();
  504. c.moveTo(0, h * 0.5);
  505. c.lineTo(w * 0.5, 0);
  506. c.lineTo(w * 0.5, h);
  507. c.close();
  508. c.moveTo(w * 0.5, h * 0.5);
  509. c.lineTo(w, 0);
  510. c.lineTo(w, h);
  511. c.close();
  512. c.fillAndStroke();
  513. },
  514. 'signal' : function(c, x, y, w, h)
  515. {
  516. c.begin();
  517. c.moveTo(0, h);
  518. c.lineTo(w * 0.5, 0);
  519. c.lineTo(w, h);
  520. c.close();
  521. c.fillAndStroke();
  522. },
  523. 'multiple' : function(c, x, y, w, h)
  524. {
  525. c.begin();
  526. c.moveTo(0, h * 0.39);
  527. c.lineTo(w * 0.5, 0);
  528. c.lineTo(w, h * 0.39);
  529. c.lineTo(w * 0.815, h);
  530. c.lineTo(w * 0.185, h);
  531. c.close();
  532. c.fillAndStroke();
  533. },
  534. 'parallelMultiple' : function(c, x, y, w, h)
  535. {
  536. c.begin();
  537. c.moveTo(w * 0.38, 0);
  538. c.lineTo(w * 0.62, 0);
  539. c.lineTo(w * 0.62, h * 0.38);
  540. c.lineTo(w, h * 0.38);
  541. c.lineTo(w, h * 0.62);
  542. c.lineTo(w * 0.62, h * 0.62);
  543. c.lineTo(w * 0.62, h);
  544. c.lineTo(w * 0.38, h);
  545. c.lineTo(w * 0.38, h * 0.62);
  546. c.lineTo(0, h * 0.62);
  547. c.lineTo(0, h * 0.38);
  548. c.lineTo(w * 0.38, h * 0.38);
  549. c.close();
  550. c.fillAndStroke();
  551. },
  552. 'terminate' : function(c, x, y, w, h)
  553. {
  554. c.ellipse(0, 0, w, h);
  555. c.fillAndStroke();
  556. },
  557. 'exclusiveGw' : function(c, x, y, w, h)
  558. {
  559. var strokeColor = c.state.strokeColor;
  560. var fillColor = c.state.fillColor;
  561. c.setStrokeColor(fillColor);
  562. c.setFillColor(strokeColor);
  563. c.begin();
  564. c.moveTo(w * 0.105, 0);
  565. c.lineTo(w * 0.5, h * 0.38);
  566. c.lineTo(w * 0.895, h * 0);
  567. c.lineTo(w, h * 0.11);
  568. c.lineTo(w * 0.6172, h * 0.5);
  569. c.lineTo(w, h * 0.89);
  570. c.lineTo(w * 0.895, h);
  571. c.lineTo(w * 0.5, h * 0.62);
  572. c.lineTo(w * 0.105, h);
  573. c.lineTo(0, h * 0.89);
  574. c.lineTo(w * 0.3808, h * 0.5);
  575. c.lineTo(0, h * 0.11);
  576. c.close();
  577. c.fillAndStroke();
  578. c.setStrokeColor(strokeColor);
  579. c.setFillColor(fillColor);
  580. },
  581. 'parallelGw' : function(c, x, y, w, h)
  582. {
  583. var strokeColor = c.state.strokeColor;
  584. var fillColor = c.state.fillColor;
  585. c.setStrokeColor(fillColor);
  586. c.setFillColor(strokeColor);
  587. c.begin();
  588. c.moveTo(w * 0.38, 0);
  589. c.lineTo(w * 0.62, 0);
  590. c.lineTo(w * 0.62, h * 0.38);
  591. c.lineTo(w, h * 0.38);
  592. c.lineTo(w, h * 0.62);
  593. c.lineTo(w * 0.62, h * 0.62);
  594. c.lineTo(w * 0.62, h);
  595. c.lineTo(w * 0.38, h);
  596. c.lineTo(w * 0.38, h * 0.62);
  597. c.lineTo(0, h * 0.62);
  598. c.lineTo(0, h * 0.38);
  599. c.lineTo(w * 0.38, h * 0.38);
  600. c.close();
  601. c.fillAndStroke();
  602. c.setStrokeColor(strokeColor);
  603. c.setFillColor(fillColor);
  604. },
  605. 'complexGw' : function(c, x, y, w, h)
  606. {
  607. var strokeColor = c.state.strokeColor;
  608. var fillColor = c.state.fillColor;
  609. c.setStrokeColor(fillColor);
  610. c.setFillColor(strokeColor);
  611. c.begin();
  612. c.moveTo(0, h * 0.44);
  613. c.lineTo(w * 0.36, h * 0.44);
  614. c.lineTo(w * 0.1, h * 0.18);
  615. c.lineTo(w * 0.18, h * 0.1);
  616. c.lineTo(w * 0.44, h * 0.36);
  617. c.lineTo(w * 0.44, 0);
  618. c.lineTo(w * 0.56, 0);
  619. c.lineTo(w * 0.56, h * 0.36);
  620. c.lineTo(w * 0.82, h * 0.1);
  621. c.lineTo(w * 0.90, h * 0.18);
  622. c.lineTo(w * 0.64, h * 0.44);
  623. c.lineTo(w, h * 0.44);
  624. c.lineTo(w, h * 0.56);
  625. c.lineTo(w * 0.64, h * 0.56);
  626. c.lineTo(w * 0.9, h * 0.82);
  627. c.lineTo(w * 0.82, h * 0.9);
  628. c.lineTo(w * 0.56, h * 0.64);
  629. c.lineTo(w * 0.56, h);
  630. c.lineTo(w * 0.44, h);
  631. c.lineTo(w * 0.44, h * 0.64);
  632. c.lineTo(w * 0.18, h * 0.9);
  633. c.lineTo(w * 0.1, h * 0.82);
  634. c.lineTo(w * 0.36, h * 0.56);
  635. c.lineTo(0, h * 0.56);
  636. c.close();
  637. c.fillAndStroke();
  638. c.setStrokeColor(strokeColor);
  639. c.setFillColor(fillColor);
  640. }
  641. };
  642. mxCellRenderer.prototype.defaultShapes['mxgraph.bpmn.shape'] = mxBpmnShape;