mxPidInstruments.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /**
  2. * $Id: mxPidInstruments.js,v 1.4 2014/01/21 13:10:17 gaudenz Exp $
  3. * Copyright (c) 2006-2013, JGraph Ltd
  4. */
  5. //**********************************************************************************************************************************************************
  6. //Discrete Instrument
  7. //**********************************************************************************************************************************************************
  8. /**
  9. * Extends mxShape.
  10. */
  11. function mxShapePidDiscInst(bounds, fill, stroke, strokewidth)
  12. {
  13. mxShape.call(this);
  14. this.bounds = bounds;
  15. this.fill = fill;
  16. this.stroke = stroke;
  17. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  18. };
  19. /**
  20. * Extends mxShape.
  21. */
  22. mxUtils.extend(mxShapePidDiscInst, mxShape);
  23. mxShapePidDiscInst.prototype.cst = {
  24. SHAPE_DISC_INST : 'mxgraph.pid2inst.discInst',
  25. MOUNTING : 'mounting',
  26. FIELD : 'field',
  27. ROOM : 'room',
  28. INACCESSIBLE : 'inaccessible',
  29. LOCAL : 'local'
  30. };
  31. /**
  32. * Function: paintVertexShape
  33. *
  34. * Paints the vertex shape.
  35. */
  36. mxShapePidDiscInst.prototype.paintVertexShape = function(c, x, y, w, h)
  37. {
  38. c.translate(x, y);
  39. this.background(c, x, y, w, h);
  40. c.setShadow(false);
  41. this.foreground(c, x, y, w, h);
  42. };
  43. mxShapePidDiscInst.prototype.background = function(c, x, y, w, h)
  44. {
  45. c.ellipse(0, 0, w, h);
  46. c.fillAndStroke();
  47. };
  48. mxShapePidDiscInst.prototype.foreground = function(c, x, y, w, h)
  49. {
  50. var mounting = mxUtils.getValue(this.style, mxShapePidDiscInst.prototype.cst.MOUNTING, 'field');
  51. if (mounting === mxShapePidDiscInst.prototype.cst.ROOM)
  52. {
  53. c.begin();
  54. c.moveTo(0, h * 0.5);
  55. c.lineTo(w, h * 0.5);
  56. c.stroke();
  57. }
  58. else if (mounting === mxShapePidDiscInst.prototype.cst.INACCESSIBLE)
  59. {
  60. c.setDashed(true);
  61. c.begin();
  62. c.moveTo(0, h * 0.5);
  63. c.lineTo(w, h * 0.5);
  64. c.stroke();
  65. }
  66. else if (mounting === mxShapePidDiscInst.prototype.cst.LOCAL)
  67. {
  68. c.begin();
  69. c.moveTo(w * 0.005, h * 0.48);
  70. c.lineTo(w * 0.995, h * 0.48);
  71. c.moveTo(w * 0.005, h * 0.52);
  72. c.lineTo(w * 0.995, h * 0.52);
  73. c.stroke();
  74. }
  75. };
  76. mxCellRenderer.prototype.defaultShapes[mxShapePidDiscInst.prototype.cst.SHAPE_DISC_INST] = mxShapePidDiscInst;
  77. mxShapePidDiscInst.prototype.constraints = [
  78. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  79. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  80. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  81. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  82. new mxConnectionConstraint(new mxPoint(0.145, 0.145), false),
  83. new mxConnectionConstraint(new mxPoint(0.145, 0.855), false),
  84. new mxConnectionConstraint(new mxPoint(0.855, 0.145), false),
  85. new mxConnectionConstraint(new mxPoint(0.855, 0.855), false)
  86. ];
  87. //**********************************************************************************************************************************************************
  88. //Shared Control/Display
  89. //**********************************************************************************************************************************************************
  90. /**
  91. * Extends mxShape.
  92. */
  93. function mxShapePidSharedCont(bounds, fill, stroke, strokewidth)
  94. {
  95. mxShape.call(this);
  96. this.bounds = bounds;
  97. this.fill = fill;
  98. this.stroke = stroke;
  99. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  100. };
  101. /**
  102. * Extends mxShape.
  103. */
  104. mxUtils.extend(mxShapePidSharedCont, mxShape);
  105. mxShapePidSharedCont.prototype.cst = {
  106. SHAPE_SHARED_CONT : 'mxgraph.pid2inst.sharedCont',
  107. MOUNTING : 'mounting',
  108. FIELD : 'field',
  109. ROOM : 'room',
  110. INACCESSIBLE : 'inaccessible',
  111. LOCAL : 'local'
  112. };
  113. /**
  114. * Function: paintVertexShape
  115. *
  116. * Paints the vertex shape.
  117. */
  118. mxShapePidSharedCont.prototype.paintVertexShape = function(c, x, y, w, h)
  119. {
  120. c.translate(x, y);
  121. this.background(c, x, y, w, h);
  122. c.setShadow(false);
  123. this.foreground(c, x, y, w, h);
  124. };
  125. mxShapePidSharedCont.prototype.background = function(c, x, y, w, h)
  126. {
  127. c.rect(0, 0, w, h);
  128. c.fillAndStroke();
  129. };
  130. mxShapePidSharedCont.prototype.foreground = function(c, x, y, w, h)
  131. {
  132. var mounting = mxUtils.getValue(this.style, mxShapePidSharedCont.prototype.cst.MOUNTING, 'field');
  133. c.ellipse(0, 0, w, h);
  134. c.fillAndStroke();
  135. if (mounting === mxShapePidSharedCont.prototype.cst.ROOM)
  136. {
  137. c.begin();
  138. c.moveTo(0, h * 0.5);
  139. c.lineTo(w, h * 0.5);
  140. c.stroke();
  141. }
  142. else if (mounting === mxShapePidSharedCont.prototype.cst.INACCESSIBLE)
  143. {
  144. c.setDashed(true);
  145. c.begin();
  146. c.moveTo(0, h * 0.5);
  147. c.lineTo(w, h * 0.5);
  148. c.stroke();
  149. }
  150. else if (mounting === mxShapePidDiscInst.prototype.cst.LOCAL)
  151. {
  152. c.begin();
  153. c.moveTo(w * 0.005, h * 0.48);
  154. c.lineTo(w * 0.995, h * 0.48);
  155. c.moveTo(w * 0.005, h * 0.52);
  156. c.lineTo(w * 0.995, h * 0.52);
  157. c.stroke();
  158. }
  159. };
  160. mxCellRenderer.prototype.defaultShapes[mxShapePidSharedCont.prototype.cst.SHAPE_SHARED_CONT] = mxShapePidSharedCont;
  161. mxShapePidSharedCont.prototype.constraints = [
  162. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  163. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  164. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  165. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  166. new mxConnectionConstraint(new mxPoint(0, 0), false),
  167. new mxConnectionConstraint(new mxPoint(0, 1), false),
  168. new mxConnectionConstraint(new mxPoint(1, 0), false),
  169. new mxConnectionConstraint(new mxPoint(1, 1), false)
  170. ];
  171. //**********************************************************************************************************************************************************
  172. //Computer Function
  173. //**********************************************************************************************************************************************************
  174. /**
  175. * Extends mxShape.
  176. */
  177. function mxShapePidCompFunc(bounds, fill, stroke, strokewidth)
  178. {
  179. mxShape.call(this);
  180. this.bounds = bounds;
  181. this.fill = fill;
  182. this.stroke = stroke;
  183. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  184. };
  185. /**
  186. * Extends mxShape.
  187. */
  188. mxUtils.extend(mxShapePidCompFunc, mxShape);
  189. mxShapePidCompFunc.prototype.cst = {
  190. SHAPE_COMP_FUNC : 'mxgraph.pid2inst.compFunc',
  191. MOUNTING : 'mounting',
  192. FIELD : 'field',
  193. ROOM : 'room',
  194. INACCESSIBLE : 'inaccessible',
  195. LOCAL : 'local'
  196. };
  197. /**
  198. * Function: paintVertexShape
  199. *
  200. * Paints the vertex shape.
  201. */
  202. mxShapePidCompFunc.prototype.paintVertexShape = function(c, x, y, w, h)
  203. {
  204. c.translate(x, y);
  205. this.background(c, x, y, w, h);
  206. c.setShadow(false);
  207. this.foreground(c, x, y, w, h);
  208. };
  209. mxShapePidCompFunc.prototype.background = function(c, x, y, w, h)
  210. {
  211. c.begin();
  212. c.moveTo(0, h * 0.5);
  213. c.lineTo(w * 0.25, 0);
  214. c.lineTo(w * 0.75, 0);
  215. c.lineTo(w, h * 0.5);
  216. c.lineTo(w * 0.75, h);
  217. c.lineTo(w * 0.25, h);
  218. c.close();
  219. c.fillAndStroke();
  220. };
  221. mxShapePidCompFunc.prototype.foreground = function(c, x, y, w, h)
  222. {
  223. var mounting = mxUtils.getValue(this.style, mxShapePidCompFunc.prototype.cst.MOUNTING, 'field');
  224. if (mounting === mxShapePidCompFunc.prototype.cst.ROOM)
  225. {
  226. c.begin();
  227. c.moveTo(0, h * 0.5);
  228. c.lineTo(w, h * 0.5);
  229. c.stroke();
  230. }
  231. else if (mounting === mxShapePidCompFunc.prototype.cst.INACCESSIBLE)
  232. {
  233. c.setDashed(true);
  234. c.begin();
  235. c.moveTo(0, h * 0.5);
  236. c.lineTo(w, h * 0.5);
  237. c.stroke();
  238. }
  239. else if (mounting === mxShapePidDiscInst.prototype.cst.LOCAL)
  240. {
  241. c.begin();
  242. c.moveTo(w * 0.01, h * 0.48);
  243. c.lineTo(w * 0.99, h * 0.48);
  244. c.moveTo(w * 0.01, h * 0.52);
  245. c.lineTo(w * 0.99, h * 0.52);
  246. c.stroke();
  247. }
  248. };
  249. mxCellRenderer.prototype.defaultShapes[mxShapePidCompFunc.prototype.cst.SHAPE_COMP_FUNC] = mxShapePidCompFunc;
  250. mxShapePidCompFunc.prototype.constraints = [
  251. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  252. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  253. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  254. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  255. new mxConnectionConstraint(new mxPoint(0.25, 0), false),
  256. new mxConnectionConstraint(new mxPoint(0.75, 0), false),
  257. new mxConnectionConstraint(new mxPoint(0.25, 1), false),
  258. new mxConnectionConstraint(new mxPoint(0.75, 1), false)
  259. ];
  260. //**********************************************************************************************************************************************************
  261. //Computer Function
  262. //**********************************************************************************************************************************************************
  263. /**
  264. * Extends mxShape.
  265. */
  266. function mxShapePidProgLogCont(bounds, fill, stroke, strokewidth)
  267. {
  268. mxShape.call(this);
  269. this.bounds = bounds;
  270. this.fill = fill;
  271. this.stroke = stroke;
  272. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  273. };
  274. /**
  275. * Extends mxShape.
  276. */
  277. mxUtils.extend(mxShapePidProgLogCont, mxShape);
  278. mxShapePidProgLogCont.prototype.cst = {
  279. SHAPE_PROG_LOG_CONT : 'mxgraph.pid2inst.progLogCont',
  280. MOUNTING : 'mounting',
  281. FIELD : 'field',
  282. ROOM : 'room',
  283. INACCESSIBLE : 'inaccessible',
  284. LOCAL : 'local'
  285. };
  286. /**
  287. * Function: paintVertexShape
  288. *
  289. * Paints the vertex shape.
  290. */
  291. mxShapePidProgLogCont.prototype.paintVertexShape = function(c, x, y, w, h)
  292. {
  293. c.translate(x, y);
  294. this.background(c, x, y, w, h);
  295. c.setShadow(false);
  296. this.foreground(c, x, y, w, h);
  297. };
  298. mxShapePidProgLogCont.prototype.background = function(c, x, y, w, h)
  299. {
  300. c.rect(0, 0, w, h);
  301. c.fillAndStroke();
  302. };
  303. mxShapePidProgLogCont.prototype.foreground = function(c, x, y, w, h)
  304. {
  305. var mounting = mxUtils.getValue(this.style, mxShapePidProgLogCont.prototype.cst.MOUNTING, 'field');
  306. c.begin();
  307. c.moveTo(0, h * 0.5);
  308. c.lineTo(w * 0.5, 0);
  309. c.lineTo(w, h * 0.5);
  310. c.lineTo(w * 0.5, h);
  311. c.close();
  312. c.stroke();
  313. if (mounting === mxShapePidProgLogCont.prototype.cst.ROOM)
  314. {
  315. c.begin();
  316. c.moveTo(0, h * 0.5);
  317. c.lineTo(w, h * 0.5);
  318. c.stroke();
  319. }
  320. else if (mounting === mxShapePidProgLogCont.prototype.cst.INACCESSIBLE)
  321. {
  322. c.setDashed(true);
  323. c.begin();
  324. c.moveTo(0, h * 0.5);
  325. c.lineTo(w, h * 0.5);
  326. c.stroke();
  327. }
  328. else if (mounting === mxShapePidDiscInst.prototype.cst.LOCAL)
  329. {
  330. c.begin();
  331. c.moveTo(w * 0.02, h * 0.48);
  332. c.lineTo(w * 0.98, h * 0.48);
  333. c.moveTo(w * 0.02, h * 0.52);
  334. c.lineTo(w * 0.98, h * 0.52);
  335. c.stroke();
  336. }
  337. };
  338. mxCellRenderer.prototype.defaultShapes[mxShapePidProgLogCont.prototype.cst.SHAPE_PROG_LOG_CONT] = mxShapePidProgLogCont;
  339. mxShapePidProgLogCont.prototype.constraints = [
  340. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  341. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  342. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  343. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  344. new mxConnectionConstraint(new mxPoint(0, 0), false),
  345. new mxConnectionConstraint(new mxPoint(0, 1), false),
  346. new mxConnectionConstraint(new mxPoint(1, 0), false),
  347. new mxConnectionConstraint(new mxPoint(1, 1), false)
  348. ];
  349. //**********************************************************************************************************************************************************
  350. //Indicator
  351. //**********************************************************************************************************************************************************
  352. /**
  353. * Extends mxShape.
  354. */
  355. function mxShapePidIndicator(bounds, fill, stroke, strokewidth)
  356. {
  357. mxShape.call(this);
  358. this.bounds = bounds;
  359. this.fill = fill;
  360. this.stroke = stroke;
  361. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  362. };
  363. /**
  364. * Extends mxShape.
  365. */
  366. mxUtils.extend(mxShapePidIndicator, mxShape);
  367. mxShapePidIndicator.prototype.cst = {
  368. SHAPE_INDICATOR : 'mxgraph.pid2inst.indicator',
  369. MOUNTING : 'mounting',
  370. FIELD : 'field',
  371. ROOM : 'room',
  372. INACCESSIBLE : 'inaccessible',
  373. LOCAL : 'local',
  374. IND_TYPE : 'indType',
  375. INSTRUMENT : 'inst',
  376. CONTROL : 'ctrl',
  377. FUNCTION : 'func',
  378. PLC : 'plc'
  379. };
  380. /**
  381. * Function: paintVertexShape
  382. *
  383. * Paints the vertex shape.
  384. */
  385. mxShapePidIndicator.prototype.paintVertexShape = function(c, x, y, w, h)
  386. {
  387. c.translate(x, y);
  388. this.background(c, x, y, w, h);
  389. c.setShadow(false);
  390. this.foreground(c, x, y, w, h);
  391. };
  392. mxShapePidIndicator.prototype.background = function(c, x, y, w, h)
  393. {
  394. var type = mxUtils.getValue(this.style, mxShapePidIndicator.prototype.cst.IND_TYPE, 'inst');
  395. c.begin();
  396. c.moveTo(w * 0.5, w);
  397. c.lineTo(w * 0.5, h);
  398. c.stroke();
  399. if (type === mxShapePidIndicator.prototype.cst.INSTRUMENT)
  400. {
  401. c.ellipse(0, 0, w, w);
  402. c.fillAndStroke();
  403. }
  404. else if (type === mxShapePidIndicator.prototype.cst.CONTROL)
  405. {
  406. c.rect(0, 0, w, w);
  407. c.fillAndStroke();
  408. }
  409. else if (type === mxShapePidIndicator.prototype.cst.FUNCTION)
  410. {
  411. c.begin();
  412. c.moveTo(0, w * 0.5);
  413. c.lineTo(w * 0.25, 0);
  414. c.lineTo(w * 0.75, 0);
  415. c.lineTo(w, w * 0.5);
  416. c.lineTo(w * 0.75, w);
  417. c.lineTo(w * 0.25, w);
  418. c.close();
  419. c.fillAndStroke();
  420. }
  421. else if (type === mxShapePidIndicator.prototype.cst.PLC)
  422. {
  423. c.rect(0, 0, w, w);
  424. c.fillAndStroke();
  425. }
  426. };
  427. mxShapePidIndicator.prototype.foreground = function(c, x, y, w, h)
  428. {
  429. var mounting = mxUtils.getValue(this.style, mxShapePidIndicator.prototype.cst.MOUNTING, 'field');
  430. var type = mxUtils.getValue(this.style, mxShapePidIndicator.prototype.cst.IND_TYPE, 'inst');
  431. if (type === mxShapePidIndicator.prototype.cst.CONTROL)
  432. {
  433. c.ellipse(0, 0, w, w);
  434. c.stroke();
  435. }
  436. else if (type === mxShapePidIndicator.prototype.cst.PLC)
  437. {
  438. c.begin();
  439. c.moveTo(0, w * 0.5);
  440. c.lineTo(w * 0.5, 0);
  441. c.lineTo(w, w * 0.5);
  442. c.lineTo(w * 0.5, w);
  443. c.close();
  444. c.stroke();
  445. }
  446. if (mounting === mxShapePidIndicator.prototype.cst.ROOM)
  447. {
  448. c.begin();
  449. c.moveTo(0, w * 0.5);
  450. c.lineTo(w, w * 0.5);
  451. c.stroke();
  452. }
  453. else if (mounting === mxShapePidIndicator.prototype.cst.INACCESSIBLE)
  454. {
  455. c.setDashed(true);
  456. c.begin();
  457. c.moveTo(0, w * 0.5);
  458. c.lineTo(w, w * 0.5);
  459. c.stroke();
  460. }
  461. else if (mounting === mxShapePidIndicator.prototype.cst.LOCAL)
  462. {
  463. c.begin();
  464. c.moveTo(w * 0.005, w * 0.48);
  465. c.lineTo(w * 0.995, w * 0.48);
  466. c.moveTo(w * 0.005, w * 0.52);
  467. c.lineTo(w * 0.995, w * 0.52);
  468. c.stroke();
  469. }
  470. };
  471. mxCellRenderer.prototype.defaultShapes[mxShapePidIndicator.prototype.cst.SHAPE_INDICATOR] = mxShapePidIndicator;
  472. mxShapePidIndicator.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0.5, 1), true)];
  473. //**********************************************************************************************************************************************************
  474. //Logic
  475. //**********************************************************************************************************************************************************
  476. /**
  477. * Extends mxShape.
  478. */
  479. function mxShapePidLogic(bounds, fill, stroke, strokewidth)
  480. {
  481. mxShape.call(this);
  482. this.bounds = bounds;
  483. this.fill = fill;
  484. this.stroke = stroke;
  485. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  486. };
  487. /**
  488. * Extends mxShape.
  489. */
  490. mxUtils.extend(mxShapePidLogic, mxShape);
  491. mxShapePidLogic.prototype.cst = {
  492. SHAPE_LOGIC : 'mxgraph.pid2inst.logic',
  493. MOUNTING : 'mounting',
  494. FIELD : 'field',
  495. ROOM : 'room',
  496. INACCESSIBLE : 'inaccessible',
  497. LOCAL : 'local'
  498. };
  499. /**
  500. * Function: paintVertexShape
  501. *
  502. * Paints the vertex shape.
  503. */
  504. mxShapePidLogic.prototype.paintVertexShape = function(c, x, y, w, h)
  505. {
  506. c.translate(x, y);
  507. this.background(c, x, y, w, h);
  508. c.setShadow(false);
  509. this.foreground(c, x, y, w, h);
  510. };
  511. mxShapePidLogic.prototype.background = function(c, x, y, w, h)
  512. {
  513. c.begin();
  514. c.moveTo(0, h * 0.5);
  515. c.lineTo(w * 0.5, 0);
  516. c.lineTo(w, h * 0.5);
  517. c.lineTo(w * 0.5, h);
  518. c.close();
  519. c.fillAndStroke();
  520. };
  521. mxShapePidLogic.prototype.foreground = function(c, x, y, w, h)
  522. {
  523. var mounting = mxUtils.getValue(this.style, mxShapePidLogic.prototype.cst.MOUNTING, 'field');
  524. if (mounting === mxShapePidLogic.prototype.cst.ROOM)
  525. {
  526. c.begin();
  527. c.moveTo(0, h * 0.5);
  528. c.lineTo(w, h * 0.5);
  529. c.stroke();
  530. }
  531. else if (mounting === mxShapePidLogic.prototype.cst.INACCESSIBLE)
  532. {
  533. c.setDashed(true);
  534. c.begin();
  535. c.moveTo(0, h * 0.5);
  536. c.lineTo(w, h * 0.5);
  537. c.stroke();
  538. }
  539. else if (mounting === mxShapePidLogic.prototype.cst.LOCAL)
  540. {
  541. c.begin();
  542. c.moveTo(w * 0.02, h * 0.48);
  543. c.lineTo(w * 0.98, h * 0.48);
  544. c.moveTo(w * 0.02, h * 0.52);
  545. c.lineTo(w * 0.98, h * 0.52);
  546. c.stroke();
  547. }
  548. };
  549. mxCellRenderer.prototype.defaultShapes[mxShapePidLogic.prototype.cst.SHAPE_LOGIC] = mxShapePidLogic;
  550. mxShapePidLogic.prototype.constraints = [
  551. new mxConnectionConstraint(new mxPoint(0.5, 0), true),
  552. new mxConnectionConstraint(new mxPoint(0.5, 1), true),
  553. new mxConnectionConstraint(new mxPoint(0, 0.5), true),
  554. new mxConnectionConstraint(new mxPoint(1, 0.5), true),
  555. new mxConnectionConstraint(new mxPoint(0.25, 0.25), false),
  556. new mxConnectionConstraint(new mxPoint(0.25, 0.75), false),
  557. new mxConnectionConstraint(new mxPoint(0.75, 0.25), false),
  558. new mxConnectionConstraint(new mxPoint(0.75, 0.75), false)
  559. ];