GUI.pattern.metamodel 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. {
  2. "types": {
  3. "__pVisualElement": [
  4. {
  5. "name": "__pLabel",
  6. "type": "string",
  7. "default": ""
  8. },
  9. {
  10. "name": "__pMatchSubtypes",
  11. "type": "boolean",
  12. "default": false
  13. },
  14. {
  15. "name": "code",
  16. "type": "code",
  17. "default": "getAttr()"
  18. },
  19. {
  20. "name": "size",
  21. "type": "code",
  22. "default": "getAttr()"
  23. },
  24. {
  25. "name": "position",
  26. "type": "code",
  27. "default": "getAttr()"
  28. },
  29. {
  30. "name": "id",
  31. "type": "code",
  32. "default": "getAttr()"
  33. }
  34. ],
  35. "__pInput": [
  36. {
  37. "name": "__pLabel",
  38. "type": "string",
  39. "default": ""
  40. },
  41. {
  42. "name": "__pMatchSubtypes",
  43. "type": "boolean",
  44. "default": false
  45. },
  46. {
  47. "name": "text",
  48. "type": "code",
  49. "default": "getAttr()"
  50. },
  51. {
  52. "name": "code",
  53. "type": "code",
  54. "default": "getAttr()"
  55. },
  56. {
  57. "name": "size",
  58. "type": "code",
  59. "default": "getAttr()"
  60. },
  61. {
  62. "name": "position",
  63. "type": "code",
  64. "default": "getAttr()"
  65. },
  66. {
  67. "name": "id",
  68. "type": "code",
  69. "default": "getAttr()"
  70. }
  71. ],
  72. "__pList": [
  73. {
  74. "name": "__pLabel",
  75. "type": "string",
  76. "default": ""
  77. },
  78. {
  79. "name": "__pMatchSubtypes",
  80. "type": "boolean",
  81. "default": false
  82. },
  83. {
  84. "name": "choices",
  85. "type": "code",
  86. "default": "getAttr()"
  87. },
  88. {
  89. "name": "clickable",
  90. "type": "code",
  91. "default": "getAttr()"
  92. },
  93. {
  94. "name": "code",
  95. "type": "code",
  96. "default": "getAttr()"
  97. },
  98. {
  99. "name": "size",
  100. "type": "code",
  101. "default": "getAttr()"
  102. },
  103. {
  104. "name": "position",
  105. "type": "code",
  106. "default": "getAttr()"
  107. },
  108. {
  109. "name": "id",
  110. "type": "code",
  111. "default": "getAttr()"
  112. }
  113. ],
  114. "__pLabel": [
  115. {
  116. "name": "__pLabel",
  117. "type": "string",
  118. "default": ""
  119. },
  120. {
  121. "name": "__pMatchSubtypes",
  122. "type": "boolean",
  123. "default": false
  124. },
  125. {
  126. "name": "text",
  127. "type": "code",
  128. "default": "getAttr()"
  129. },
  130. {
  131. "name": "code",
  132. "type": "code",
  133. "default": "getAttr()"
  134. },
  135. {
  136. "name": "size",
  137. "type": "code",
  138. "default": "getAttr()"
  139. },
  140. {
  141. "name": "position",
  142. "type": "code",
  143. "default": "getAttr()"
  144. },
  145. {
  146. "name": "id",
  147. "type": "code",
  148. "default": "getAttr()"
  149. }
  150. ],
  151. "__pContainer": [
  152. {
  153. "name": "__pLabel",
  154. "type": "string",
  155. "default": ""
  156. },
  157. {
  158. "name": "__pMatchSubtypes",
  159. "type": "boolean",
  160. "default": false
  161. },
  162. {
  163. "name": "layout",
  164. "type": "code",
  165. "default": "getAttr()"
  166. },
  167. {
  168. "name": "orientation",
  169. "type": "code",
  170. "default": "getAttr()"
  171. },
  172. {
  173. "name": "code",
  174. "type": "code",
  175. "default": "getAttr()"
  176. },
  177. {
  178. "name": "size",
  179. "type": "code",
  180. "default": "getAttr()"
  181. },
  182. {
  183. "name": "position",
  184. "type": "code",
  185. "default": "getAttr()"
  186. },
  187. {
  188. "name": "id",
  189. "type": "code",
  190. "default": "getAttr()"
  191. }
  192. ],
  193. "__pButton": [
  194. {
  195. "name": "__pLabel",
  196. "type": "string",
  197. "default": ""
  198. },
  199. {
  200. "name": "__pMatchSubtypes",
  201. "type": "boolean",
  202. "default": false
  203. },
  204. {
  205. "name": "text",
  206. "type": "code",
  207. "default": "getAttr()"
  208. },
  209. {
  210. "name": "code",
  211. "type": "code",
  212. "default": "getAttr()"
  213. },
  214. {
  215. "name": "size",
  216. "type": "code",
  217. "default": "getAttr()"
  218. },
  219. {
  220. "name": "position",
  221. "type": "code",
  222. "default": "getAttr()"
  223. },
  224. {
  225. "name": "id",
  226. "type": "code",
  227. "default": "getAttr()"
  228. }
  229. ],
  230. "__pContain": [
  231. {
  232. "name": "__pLabel",
  233. "type": "string",
  234. "default": ""
  235. },
  236. {
  237. "name": "__pMatchSubtypes",
  238. "type": "boolean",
  239. "default": false
  240. }
  241. ],
  242. "__pCanvas": [
  243. {
  244. "name": "__pLabel",
  245. "type": "string",
  246. "default": ""
  247. },
  248. {
  249. "name": "__pMatchSubtypes",
  250. "type": "boolean",
  251. "default": false
  252. }
  253. ],
  254. "__pCanvasContents": [
  255. {
  256. "name": "__pLabel",
  257. "type": "string",
  258. "default": ""
  259. },
  260. {
  261. "name": "__pMatchSubtypes",
  262. "type": "boolean",
  263. "default": false
  264. }
  265. ]
  266. },
  267. "constraints": [
  268. {
  269. "name": "noAbstractInstances",
  270. "event": "pre-create",
  271. "code": "/* comment next line to enable this constraint */\nthrow \"IgnoredConstraint\"\nfalse",
  272. "targetType": "VisualElement"
  273. }
  274. ],
  275. "actions": [
  276. {
  277. "name": "distinctPLabels",
  278. "event": "post-create",
  279. "code": "if( getAttr(\"__pLabel\") == \"\" )\n{\n\tvar pLabels = getAllNodes().\n\t\t\t\t\t\t\tfilter( function(n) {return hasAttr(\"__pLabel\",n);} ).\n\t\t\t\t\t\t\t\tmap( function(n) {return getAttr(\"__pLabel\",n);} ),\n\t\t i\t\t\t= \"0\";\n\n\twhile( _utils.contains(pLabels,i) )\n\t\ti = String(parseInt(i)+1);\n\tsetAttr(\"__pLabel\",i);\n}",
  280. "targetType": "*"
  281. }
  282. ],
  283. "cardinalities": {
  284. "__pVisualElement": [
  285. {
  286. "dir": "in",
  287. "type": "__pContain",
  288. "min": 0,
  289. "max": "Infinity"
  290. },
  291. {
  292. "dir": "in",
  293. "type": "__pCanvasContents",
  294. "min": 0,
  295. "max": "Infinity"
  296. }
  297. ],
  298. "__pInput": [
  299. {
  300. "dir": "in",
  301. "type": "__pContain",
  302. "min": 0,
  303. "max": "Infinity"
  304. },
  305. {
  306. "dir": "in",
  307. "type": "__pCanvasContents",
  308. "min": 0,
  309. "max": "Infinity"
  310. }
  311. ],
  312. "__pList": [
  313. {
  314. "dir": "in",
  315. "type": "__pContain",
  316. "min": 0,
  317. "max": "Infinity"
  318. },
  319. {
  320. "dir": "in",
  321. "type": "__pCanvasContents",
  322. "min": 0,
  323. "max": "Infinity"
  324. }
  325. ],
  326. "__pLabel": [
  327. {
  328. "dir": "in",
  329. "type": "__pContain",
  330. "min": 0,
  331. "max": "Infinity"
  332. },
  333. {
  334. "dir": "in",
  335. "type": "__pCanvasContents",
  336. "min": 0,
  337. "max": "Infinity"
  338. }
  339. ],
  340. "__pContainer": [
  341. {
  342. "dir": "out",
  343. "type": "__pContain",
  344. "min": 0,
  345. "max": "Infinity"
  346. },
  347. {
  348. "dir": "in",
  349. "type": "__pContain",
  350. "min": 0,
  351. "max": "Infinity"
  352. },
  353. {
  354. "dir": "in",
  355. "type": "__pCanvasContents",
  356. "min": 0,
  357. "max": "Infinity"
  358. }
  359. ],
  360. "__pButton": [
  361. {
  362. "dir": "in",
  363. "type": "__pContain",
  364. "min": 0,
  365. "max": "Infinity"
  366. },
  367. {
  368. "dir": "in",
  369. "type": "__pCanvasContents",
  370. "min": 0,
  371. "max": "Infinity"
  372. }
  373. ],
  374. "__pContain": [
  375. {
  376. "dir": "in",
  377. "type": "__pContainer",
  378. "min": 0,
  379. "max": "1"
  380. },
  381. {
  382. "dir": "out",
  383. "type": "__pVisualElement",
  384. "min": 0,
  385. "max": "1"
  386. },
  387. {
  388. "dir": "out",
  389. "type": "__pInput",
  390. "min": 0,
  391. "max": "1"
  392. },
  393. {
  394. "dir": "out",
  395. "type": "__pList",
  396. "min": 0,
  397. "max": "1"
  398. },
  399. {
  400. "dir": "out",
  401. "type": "__pLabel",
  402. "min": 0,
  403. "max": "1"
  404. },
  405. {
  406. "dir": "out",
  407. "type": "__pContainer",
  408. "min": 0,
  409. "max": "1"
  410. },
  411. {
  412. "dir": "out",
  413. "type": "__pButton",
  414. "min": 0,
  415. "max": "1"
  416. }
  417. ],
  418. "__pCanvas": [
  419. {
  420. "dir": "out",
  421. "type": "__pCanvasContents",
  422. "min": 0,
  423. "max": "Infinity"
  424. }
  425. ],
  426. "__pCanvasContents": [
  427. {
  428. "dir": "in",
  429. "type": "__pCanvas",
  430. "min": 0,
  431. "max": "1"
  432. },
  433. {
  434. "dir": "out",
  435. "type": "__pVisualElement",
  436. "min": 0,
  437. "max": "1"
  438. },
  439. {
  440. "dir": "out",
  441. "type": "__pInput",
  442. "min": 0,
  443. "max": "1"
  444. },
  445. {
  446. "dir": "out",
  447. "type": "__pList",
  448. "min": 0,
  449. "max": "1"
  450. },
  451. {
  452. "dir": "out",
  453. "type": "__pLabel",
  454. "min": 0,
  455. "max": "1"
  456. },
  457. {
  458. "dir": "out",
  459. "type": "__pContainer",
  460. "min": 0,
  461. "max": "1"
  462. },
  463. {
  464. "dir": "out",
  465. "type": "__pButton",
  466. "min": 0,
  467. "max": "1"
  468. }
  469. ]
  470. },
  471. "legalConnections": {
  472. "__pContainer": {
  473. "__pVisualElement": [
  474. "__pContain"
  475. ],
  476. "__pInput": [
  477. "__pContain"
  478. ],
  479. "__pList": [
  480. "__pContain"
  481. ],
  482. "__pLabel": [
  483. "__pContain"
  484. ],
  485. "__pContainer": [
  486. "__pContain"
  487. ],
  488. "__pButton": [
  489. "__pContain"
  490. ]
  491. },
  492. "__pCanvas": {
  493. "__pVisualElement": [
  494. "__pCanvasContents"
  495. ],
  496. "__pInput": [
  497. "__pCanvasContents"
  498. ],
  499. "__pList": [
  500. "__pCanvasContents"
  501. ],
  502. "__pLabel": [
  503. "__pCanvasContents"
  504. ],
  505. "__pContainer": [
  506. "__pCanvasContents"
  507. ],
  508. "__pButton": [
  509. "__pCanvasContents"
  510. ]
  511. }
  512. },
  513. "connectorTypes": {
  514. "__pContain": "containment",
  515. "__pCanvasContents": "containment"
  516. },
  517. "types2parentTypes": {
  518. "__pVisualElement": [],
  519. "__pInput": [
  520. "__pVisualElement"
  521. ],
  522. "__pList": [
  523. "__pVisualElement"
  524. ],
  525. "__pLabel": [
  526. "__pVisualElement"
  527. ],
  528. "__pContainer": [
  529. "__pVisualElement"
  530. ],
  531. "__pButton": [
  532. "__pVisualElement"
  533. ],
  534. "__pContain": [],
  535. "__pCanvas": [],
  536. "__pCanvasContents": []
  537. }
  538. }