mxEip.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. /**
  2. * Copyright (c) 2006-2015, JGraph Holdings Ltd
  3. */
  4. //**********************************************************************************************************************************************************
  5. //Message Expiration
  6. //**********************************************************************************************************************************************************
  7. /**
  8. * Extends mxShape.
  9. */
  10. function mxShapeEipMessageExpiration(bounds, fill, stroke, strokewidth)
  11. {
  12. mxShape.call(this);
  13. this.bounds = bounds;
  14. this.fill = fill;
  15. this.stroke = stroke;
  16. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  17. };
  18. /**
  19. * Extends mxShape.
  20. */
  21. mxUtils.extend(mxShapeEipMessageExpiration, mxShape);
  22. mxShapeEipMessageExpiration.prototype.cst = {
  23. SHAPE_MESS_EXP : 'mxgraph.eip.messExp'
  24. };
  25. mxShapeEipMessageExpiration.prototype.customProperties = [
  26. {name: 'handsColor', dispName: 'Hands Color', defVal: '#808080', type: 'color', primary:true}
  27. ];
  28. /**
  29. * Function: paintVertexShape
  30. *
  31. * Paints the vertex shape.
  32. */
  33. mxShapeEipMessageExpiration.prototype.paintVertexShape = function(c, x, y, w, h)
  34. {
  35. c.translate(x, y);
  36. this.background(c, x, y, w, h);
  37. };
  38. mxShapeEipMessageExpiration.prototype.background = function(c, x, y, w, h)
  39. {
  40. c.ellipse(0, 0, w, h);
  41. c.stroke();
  42. c.setStrokeColor(mxUtils.getValue(this.style, 'handsColor', '#808080'));
  43. c.begin();
  44. c.moveTo(w * 0.5, h * 0.1);
  45. c.lineTo(w * 0.5, h * 0.5);
  46. c.lineTo(w * 0.6, h * 0.8);
  47. c.stroke();
  48. };
  49. mxCellRenderer.registerShape(mxShapeEipMessageExpiration.prototype.cst.SHAPE_MESS_EXP, mxShapeEipMessageExpiration);
  50. mxShapeEipMessageExpiration.prototype.getConstraints = function(style, w, h)
  51. {
  52. var constr = [];
  53. constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.145), false));
  54. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  55. constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.145), false));
  56. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  57. constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.855), false));
  58. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  59. constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.855), false));
  60. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  61. return (constr);
  62. };
  63. //**********************************************************************************************************************************************************
  64. //Return Address
  65. //**********************************************************************************************************************************************************
  66. /**
  67. * Extends mxShape.
  68. */
  69. function mxShapeEipReturnAddress(bounds, fill, stroke, strokewidth)
  70. {
  71. mxShape.call(this);
  72. this.bounds = bounds;
  73. this.fill = fill;
  74. this.stroke = stroke;
  75. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  76. };
  77. /**
  78. * Extends mxShape.
  79. */
  80. mxUtils.extend(mxShapeEipReturnAddress, mxShape);
  81. mxShapeEipReturnAddress.prototype.cst = {
  82. SHAPE_RET_ADDR : 'mxgraph.eip.retAddr'
  83. };
  84. mxShapeEipReturnAddress.prototype.customProperties = [
  85. {name: 'stampColor', dispName: 'Stamp Color', defVal: '#EDEDED', type: 'color', primary:true}
  86. ];
  87. /**
  88. * Function: paintVertexShape
  89. *
  90. * Paints the vertex shape.
  91. */
  92. mxShapeEipReturnAddress.prototype.paintVertexShape = function(c, x, y, w, h)
  93. {
  94. c.translate(x, y);
  95. this.background(c, x, y, w, h);
  96. c.setShadow(false);
  97. this.foreground(c, x, y, w, h);
  98. };
  99. mxShapeEipReturnAddress.prototype.background = function(c, x, y, w, h)
  100. {
  101. c.rect(0, 0, w, h);
  102. c.fillAndStroke();
  103. };
  104. mxShapeEipReturnAddress.prototype.foreground = function(c, x, y, w, h)
  105. {
  106. c.begin();
  107. c.moveTo(w * 0.05, h * 0.11);
  108. c.lineTo(w * 0.25, h * 0.11);
  109. c.moveTo(w * 0.05, h * 0.18);
  110. c.lineTo(w * 0.25, h * 0.18);
  111. c.moveTo(w * 0.05, h * 0.25);
  112. c.lineTo(w * 0.25, h * 0.25);
  113. c.setStrokeWidth(2);
  114. c.moveTo(w * 0.3, h * 0.63);
  115. c.lineTo(w * 0.8, h * 0.63);
  116. c.moveTo(w * 0.3, h * 0.72);
  117. c.lineTo(w * 0.8, h * 0.72);
  118. c.moveTo(w * 0.3, h * 0.80);
  119. c.lineTo(w * 0.8, h * 0.80);
  120. c.stroke();
  121. c.setFillColor(mxUtils.getValue(this.style, 'stampColor', '#EDEDED'));
  122. c.rect(w * 0.8, h * 0.1, w * 0.12, h * 0.19);
  123. c.fillAndStroke();
  124. };
  125. mxCellRenderer.registerShape(mxShapeEipReturnAddress.prototype.cst.SHAPE_RET_ADDR, mxShapeEipReturnAddress);
  126. mxShapeEipReturnAddress.prototype.getConstraints = function(style, w, h)
  127. {
  128. var constr = [];
  129. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
  130. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
  131. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
  132. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
  133. constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
  134. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
  135. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
  136. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
  137. constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
  138. constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
  139. constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
  140. constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
  141. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
  142. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
  143. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
  144. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
  145. return (constr);
  146. };
  147. //**********************************************************************************************************************************************************
  148. //Anchor
  149. //**********************************************************************************************************************************************************
  150. /**
  151. * Extends mxShape.
  152. */
  153. function mxShapeEipAnchor(bounds, fill, stroke, strokewidth)
  154. {
  155. mxShape.call(this);
  156. this.bounds = bounds;
  157. this.fill = fill;
  158. this.stroke = stroke;
  159. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  160. };
  161. /**
  162. * Extends mxShape.
  163. */
  164. mxUtils.extend(mxShapeEipAnchor, mxShape);
  165. mxShapeEipAnchor.prototype.cst = {
  166. SHAPE_ANCHOR : 'mxgraph.eip.anchor'
  167. };
  168. /**
  169. * Function: paintVertexShape
  170. *
  171. * Paints the vertex shape.
  172. */
  173. mxShapeEipAnchor.prototype.paintVertexShape = function(c, x, y, w, h)
  174. {
  175. };
  176. mxCellRenderer.registerShape(mxShapeEipAnchor.prototype.cst.SHAPE_ANCHOR, mxShapeEipAnchor);
  177. //**********************************************************************************************************************************************************
  178. //Message Channel
  179. //**********************************************************************************************************************************************************
  180. /**
  181. * Extends mxShape.
  182. */
  183. function mxShapeEipMessageChannel(bounds, fill, stroke, strokewidth)
  184. {
  185. mxShape.call(this);
  186. this.bounds = bounds;
  187. this.fill = fill;
  188. this.stroke = stroke;
  189. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  190. };
  191. /**
  192. * Extends mxShape.
  193. */
  194. mxUtils.extend(mxShapeEipMessageChannel, mxShape);
  195. mxShapeEipMessageChannel.prototype.cst = {
  196. SHAPE_MESSAGE_CHANNEL : 'mxgraph.eip.messageChannel'
  197. };
  198. mxShapeEipMessageChannel.prototype.customProperties = [
  199. {name: 'channelColor1', dispName: 'Channel Color 1', defVal: '#e6e6e6', type: 'color', primary:true},
  200. {name: 'channelColor2', dispName: 'Channel Color 2', defVal: '#808080', type: 'color', primary:true}
  201. ];
  202. /**
  203. * Function: paintVertexShape
  204. *
  205. * Paints the vertex shape.
  206. */
  207. mxShapeEipMessageChannel.prototype.paintVertexShape = function(c, x, y, w, h)
  208. {
  209. c.translate(x, y);
  210. this.background(c, x, y, w, h);
  211. c.setShadow(false);
  212. this.foreground(c, x, y, w, h);
  213. };
  214. mxShapeEipMessageChannel.prototype.background = function(c, x, y, w, h)
  215. {
  216. c.setGradient(mxUtils.getValue(this.style, 'channelColor1', '#e6e6e6'), mxUtils.getValue(this.style, 'channelColor2', '#808080'), 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  217. c.begin();
  218. c.moveTo(8, h * 0.5 + 10);
  219. c.arcTo(12, 12, 0, 0, 1, 8, h * 0.5 - 10);
  220. c.lineTo(w - 8, h * 0.5 - 10);
  221. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
  222. c.close();
  223. c.fillAndStroke();
  224. };
  225. mxShapeEipMessageChannel.prototype.foreground = function(c, x, y, w, h)
  226. {
  227. c.setFillColor(mxUtils.getValue(this.style, 'channelColor1', '#e6e6e6'));
  228. c.begin();
  229. c.moveTo(w - 8, h * 0.5 - 10);
  230. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
  231. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 - 10);
  232. c.fillAndStroke();
  233. };
  234. mxCellRenderer.registerShape(mxShapeEipMessageChannel.prototype.cst.SHAPE_MESSAGE_CHANNEL, mxShapeEipMessageChannel);
  235. mxShapeEipMessageChannel.prototype.getConstraints = function(style, w, h)
  236. {
  237. var constr = [];
  238. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 2.7, 0));
  239. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -2.7, 0));
  240. var currW = 10;
  241. while (currW < w)
  242. {
  243. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, currW, 0));
  244. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, currW, 0));
  245. currW = currW + 10;
  246. }
  247. return (constr);
  248. };
  249. //**********************************************************************************************************************************************************
  250. //Datatype Channel
  251. //**********************************************************************************************************************************************************
  252. /**
  253. * Extends mxShape.
  254. */
  255. function mxShapeEipDatatypeChannel(bounds, fill, stroke, strokewidth)
  256. {
  257. mxShape.call(this);
  258. this.bounds = bounds;
  259. this.fill = fill;
  260. this.stroke = stroke;
  261. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  262. };
  263. /**
  264. * Extends mxShape.
  265. */
  266. mxUtils.extend(mxShapeEipDatatypeChannel, mxShape);
  267. mxShapeEipDatatypeChannel.prototype.cst = {
  268. SHAPE_DATATYPE_CHANNEL : 'mxgraph.eip.dataChannel'
  269. };
  270. mxShapeEipDatatypeChannel.prototype.customProperties = [
  271. {name: 'channelColor1', dispName: 'Channel Color 1', defVal: '#e6e6e6', type: 'color', primary:true},
  272. {name: 'channelColor2', dispName: 'Channel Color 2', defVal: '#808080', type: 'color', primary:true},
  273. {name: 'markerColor', dispName: 'Marker Color', defVal: '#fffbc0', type: 'color', primary:true}
  274. ];
  275. /**
  276. * Function: paintVertexShape
  277. *
  278. * Paints the vertex shape.
  279. */
  280. mxShapeEipDatatypeChannel.prototype.paintVertexShape = function(c, x, y, w, h)
  281. {
  282. c.translate(x, y);
  283. this.background(c, x, y, w, h);
  284. c.setShadow(false);
  285. this.foreground(c, x, y, w, h);
  286. };
  287. mxShapeEipDatatypeChannel.prototype.background = function(c, x, y, w, h)
  288. {
  289. c.setGradient(mxUtils.getValue(this.style, 'channelColor1', '#e6e6e6'), mxUtils.getValue(this.style, 'channelColor2', '#808080'), 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  290. c.begin();
  291. c.moveTo(8, h * 0.5 + 10);
  292. c.arcTo(12, 12, 0, 0, 1, 8, h * 0.5 - 10);
  293. c.lineTo(w - 8, h * 0.5 - 10);
  294. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
  295. c.close();
  296. c.fillAndStroke();
  297. };
  298. mxShapeEipDatatypeChannel.prototype.foreground = function(c, x, y, w, h)
  299. {
  300. c.setFillColor(mxUtils.getValue(this.style, 'channelColor1', '#e6e6e6'));
  301. c.begin();
  302. c.moveTo(w - 8, h * 0.5 - 10);
  303. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
  304. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 - 10);
  305. c.fillAndStroke();
  306. c.setFillColor(mxUtils.getValue(this.style, 'markerColor', '#fffbc0'));
  307. c.setStrokeWidth("1");
  308. for(var i = 1; i * 20 + 10 < w - 14; i++)
  309. {
  310. c.rect(i * 20, h * 0.5 - 5, 10, 10);
  311. c.fillAndStroke();
  312. };
  313. };
  314. mxCellRenderer.registerShape(mxShapeEipDatatypeChannel.prototype.cst.SHAPE_DATATYPE_CHANNEL, mxShapeEipDatatypeChannel);
  315. mxShapeEipDatatypeChannel.prototype.getConstraints = function(style, w, h)
  316. {
  317. var constr = [];
  318. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 2.7, 0));
  319. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -2.7, 0));
  320. var currW = 10;
  321. while (currW < w)
  322. {
  323. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, currW, 0));
  324. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, currW, 0));
  325. currW = currW + 10;
  326. }
  327. return (constr);
  328. };
  329. //**********************************************************************************************************************************************************
  330. //Dead Letter Channel
  331. //**********************************************************************************************************************************************************
  332. /**
  333. * Extends mxShape.
  334. */
  335. function mxShapeEipDeadLetterChannel(bounds, fill, stroke, strokewidth)
  336. {
  337. mxShape.call(this);
  338. this.bounds = bounds;
  339. this.fill = fill;
  340. this.stroke = stroke;
  341. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  342. };
  343. /**
  344. * Extends mxShape.
  345. */
  346. mxUtils.extend(mxShapeEipDeadLetterChannel, mxShape);
  347. mxShapeEipDeadLetterChannel.prototype.cst = {
  348. SHAPE_DEAD_LETTER_CHANNEL : 'mxgraph.eip.deadLetterChannel'
  349. };
  350. mxShapeEipDeadLetterChannel.prototype.customProperties = [
  351. {name: 'channelColor1', dispName: 'Channel Color 1', defVal: '#e6e6e6', type: 'color', primary:true},
  352. {name: 'channelColor2', dispName: 'Channel Color 2', defVal: '#808080', type: 'color', primary:true},
  353. {name: 'markerColor', dispName: 'Marker Color', defVal: '#ff0000', type: 'color', primary:true},
  354. {name: 'markerIconColor', dispName: 'Marker Icon', defVal: '#ffffff', type: 'color', primary:true}
  355. ];
  356. /**
  357. * Function: paintVertexShape
  358. *
  359. * Paints the vertex shape.
  360. */
  361. mxShapeEipDeadLetterChannel.prototype.paintVertexShape = function(c, x, y, w, h)
  362. {
  363. c.translate(x, y);
  364. this.background(c, x, y, w, h);
  365. c.setShadow(false);
  366. this.foreground(c, x, y, w, h);
  367. };
  368. mxShapeEipDeadLetterChannel.prototype.background = function(c, x, y, w, h)
  369. {
  370. c.setGradient(mxUtils.getValue(this.style, 'channelColor1', '#e6e6e6'), mxUtils.getValue(this.style, 'channelColor2', '#808080'), 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  371. c.begin();
  372. c.moveTo(8, h * 0.5 + 10);
  373. c.arcTo(12, 12, 0, 0, 1, 8, h * 0.5 - 10);
  374. c.lineTo(w - 8, h * 0.5 - 10);
  375. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
  376. c.close();
  377. c.fillAndStroke();
  378. };
  379. mxShapeEipDeadLetterChannel.prototype.foreground = function(c, x, y, w, h)
  380. {
  381. c.setFillColor(mxUtils.getValue(this.style, 'channelColor1', '#e6e6e6'));
  382. c.begin();
  383. c.moveTo(w - 8, h * 0.5 - 10);
  384. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
  385. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 - 10);
  386. c.fillAndStroke();
  387. c.setFillColor(mxUtils.getValue(this.style, 'markerColor', '#ff0000'));
  388. c.setStrokeWidth("1");
  389. c.begin();
  390. c.moveTo(w * 0.5 - 6, h * 0.5 - 3);
  391. c.lineTo(w * 0.5 - 3, h * 0.5 - 6);
  392. c.lineTo(w * 0.5 + 3, h * 0.5 - 6);
  393. c.lineTo(w * 0.5 + 6, h * 0.5 - 3);
  394. c.lineTo(w * 0.5 + 6, h * 0.5 + 3);
  395. c.lineTo(w * 0.5 + 3, h * 0.5 + 6);
  396. c.lineTo(w * 0.5 - 3, h * 0.5 + 6);
  397. c.lineTo(w * 0.5 - 6, h * 0.5 + 3);
  398. c.close();
  399. c.fillAndStroke();
  400. c.setStrokeWidth("2");
  401. c.setStrokeColor(mxUtils.getValue(this.style, 'markerIconColor', '#ffffff'));
  402. c.begin();
  403. c.moveTo(w * 0.5 - 4, h * 0.5);
  404. c.lineTo(w * 0.5 + 4, h * 0.5);
  405. c.stroke();
  406. };
  407. mxCellRenderer.registerShape(mxShapeEipDeadLetterChannel.prototype.cst.SHAPE_DEAD_LETTER_CHANNEL, mxShapeEipDeadLetterChannel);
  408. mxShapeEipDeadLetterChannel.prototype.getConstraints = function(style, w, h)
  409. {
  410. var constr = [];
  411. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 2.7, 0));
  412. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -2.7, 0));
  413. var currW = 10;
  414. while (currW < w)
  415. {
  416. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, currW, 0));
  417. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, currW, 0));
  418. currW = currW + 10;
  419. }
  420. return (constr);
  421. };
  422. //**********************************************************************************************************************************************************
  423. //Invalid Message Channel
  424. //**********************************************************************************************************************************************************
  425. /**
  426. * Extends mxShape.
  427. */
  428. function mxShapeEipInvalidMessageChannel(bounds, fill, stroke, strokewidth)
  429. {
  430. mxShape.call(this);
  431. this.bounds = bounds;
  432. this.fill = fill;
  433. this.stroke = stroke;
  434. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  435. };
  436. /**
  437. * Extends mxShape.
  438. */
  439. mxUtils.extend(mxShapeEipInvalidMessageChannel, mxShape);
  440. mxShapeEipInvalidMessageChannel.prototype.cst = {
  441. SHAPE_INVALID_MESSAGE_CHANNEL : 'mxgraph.eip.invalidMessageChannel'
  442. };
  443. mxShapeEipInvalidMessageChannel.prototype.customProperties = [
  444. {name: 'channelColor1', dispName: 'Channel Color 1', defVal: '#e6e6e6', type: 'color', primary:true},
  445. {name: 'channelColor2', dispName: 'Channel Color 2', defVal: '#808080', type: 'color', primary:true},
  446. {name: 'markerColor', dispName: 'Marker Color', defVal: '#ffe040', type: 'color', primary:true}
  447. ];
  448. /**
  449. * Function: paintVertexShape
  450. *
  451. * Paints the vertex shape.
  452. */
  453. mxShapeEipInvalidMessageChannel.prototype.paintVertexShape = function(c, x, y, w, h)
  454. {
  455. c.translate(x, y);
  456. this.background(c, x, y, w, h);
  457. c.setShadow(false);
  458. this.foreground(c, x, y, w, h);
  459. };
  460. mxShapeEipInvalidMessageChannel.prototype.background = function(c, x, y, w, h)
  461. {
  462. c.setGradient(mxUtils.getValue(this.style, 'channelColor1', '#e6e6e6'), mxUtils.getValue(this.style, 'channelColor2', '#808080'), 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  463. c.begin();
  464. c.moveTo(8, h * 0.5 + 10);
  465. c.arcTo(12, 12, 0, 0, 1, 8, h * 0.5 - 10);
  466. c.lineTo(w - 8, h * 0.5 - 10);
  467. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
  468. c.close();
  469. c.fillAndStroke();
  470. };
  471. mxShapeEipInvalidMessageChannel.prototype.foreground = function(c, x, y, w, h)
  472. {
  473. c.setFillColor(mxUtils.getValue(this.style, 'channelColor1', '#e6e6e6'));
  474. c.begin();
  475. c.moveTo(w - 8, h * 0.5 - 10);
  476. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
  477. c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 - 10);
  478. c.fillAndStroke();
  479. c.setFillColor(mxUtils.getValue(this.style, 'markerColor', '#ffe040'));
  480. c.setStrokeWidth("1");
  481. c.begin();
  482. c.moveTo(w * 0.5 - 6, h * 0.5 + 5);
  483. c.lineTo(w * 0.5, h * 0.5 - 5);
  484. c.lineTo(w * 0.5 + 6, h * 0.5 + 5);
  485. c.close();
  486. c.fillAndStroke();
  487. c.setStrokeWidth("1");
  488. c.begin();
  489. c.moveTo(w * 0.5, h * 0.5 - 2);
  490. c.lineTo(w * 0.5, h * 0.5 + 2);
  491. c.moveTo(w * 0.5, h * 0.5 + 3);
  492. c.lineTo(w * 0.5, h * 0.5 + 4);
  493. c.stroke();
  494. };
  495. mxCellRenderer.registerShape(mxShapeEipInvalidMessageChannel.prototype.cst.SHAPE_INVALID_MESSAGE_CHANNEL, mxShapeEipInvalidMessageChannel);
  496. mxShapeEipInvalidMessageChannel.prototype.getConstraints = function(style, w, h)
  497. {
  498. var constr = [];
  499. constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 2.7, 0));
  500. constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -2.7, 0));
  501. var currW = 10;
  502. while (currW < w)
  503. {
  504. constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, currW, 0));
  505. constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, currW, 0));
  506. currW = currW + 10;
  507. }
  508. return (constr);
  509. };