LCA.pattern.metamodel 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. {
  2. "types": {
  3. "__pNode": [
  4. {
  5. "name": "__pLabel",
  6. "type": "string",
  7. "default": ""
  8. },
  9. {
  10. "name": "__pPivotIn",
  11. "type": "string",
  12. "default": ""
  13. },
  14. {
  15. "name": "__pPivotOut",
  16. "type": "string",
  17. "default": ""
  18. },
  19. {
  20. "name": "__pMatchSubtypes",
  21. "type": "boolean",
  22. "default": false
  23. },
  24. {
  25. "name": "id",
  26. "type": "code",
  27. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  28. },
  29. {
  30. "name": "input",
  31. "type": "code",
  32. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  33. },
  34. {
  35. "name": "highlight",
  36. "type": "code",
  37. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  38. }
  39. ],
  40. "__pparent": [
  41. {
  42. "name": "__pLabel",
  43. "type": "string",
  44. "default": ""
  45. },
  46. {
  47. "name": "__pPivotIn",
  48. "type": "string",
  49. "default": ""
  50. },
  51. {
  52. "name": "__pPivotOut",
  53. "type": "string",
  54. "default": ""
  55. },
  56. {
  57. "name": "__pMatchSubtypes",
  58. "type": "boolean",
  59. "default": false
  60. }
  61. ],
  62. "__pancestor": [
  63. {
  64. "name": "__pLabel",
  65. "type": "string",
  66. "default": ""
  67. },
  68. {
  69. "name": "__pPivotIn",
  70. "type": "string",
  71. "default": ""
  72. },
  73. {
  74. "name": "__pPivotOut",
  75. "type": "string",
  76. "default": ""
  77. },
  78. {
  79. "name": "__pMatchSubtypes",
  80. "type": "boolean",
  81. "default": false
  82. }
  83. ]
  84. },
  85. "constraints": [],
  86. "actions": [
  87. {
  88. "name": "distinctPLabels",
  89. "event": "post-create",
  90. "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}",
  91. "targetType": "*"
  92. }
  93. ],
  94. "cardinalities": {
  95. "__pNode": [
  96. {
  97. "dir": "out",
  98. "type": "__pparent",
  99. "min": 0,
  100. "max": "Infinity"
  101. },
  102. {
  103. "dir": "in",
  104. "type": "__pparent",
  105. "min": 0,
  106. "max": "Infinity"
  107. },
  108. {
  109. "dir": "out",
  110. "type": "__pancestor",
  111. "min": 0,
  112. "max": "Infinity"
  113. },
  114. {
  115. "dir": "in",
  116. "type": "__pancestor",
  117. "min": 0,
  118. "max": "Infinity"
  119. }
  120. ],
  121. "__pparent": [
  122. {
  123. "dir": "in",
  124. "type": "__pNode",
  125. "min": 0,
  126. "max": "1"
  127. },
  128. {
  129. "dir": "out",
  130. "type": "__pNode",
  131. "min": 0,
  132. "max": "1"
  133. }
  134. ],
  135. "__pancestor": [
  136. {
  137. "dir": "in",
  138. "type": "__pNode",
  139. "min": 0,
  140. "max": "1"
  141. },
  142. {
  143. "dir": "out",
  144. "type": "__pNode",
  145. "min": 0,
  146. "max": "1"
  147. }
  148. ]
  149. },
  150. "legalConnections": {
  151. "__pNode": {
  152. "__pNode": [
  153. "__pparent",
  154. "__pancestor"
  155. ]
  156. }
  157. },
  158. "connectorTypes": {
  159. "__pparent": "visual",
  160. "__pancestor": "visual"
  161. },
  162. "types2parentTypes": {
  163. "__pNode": [],
  164. "__pparent": [],
  165. "__pancestor": []
  166. }
  167. }