FSA.pattern.metamodel 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. {
  2. "types": {
  3. "__pState": [
  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": "name",
  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": "current",
  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. "__pInputEvents": [
  36. {
  37. "name": "__pLabel",
  38. "type": "string",
  39. "default": ""
  40. },
  41. {
  42. "name": "__pPivotIn",
  43. "type": "string",
  44. "default": ""
  45. },
  46. {
  47. "name": "__pPivotOut",
  48. "type": "string",
  49. "default": ""
  50. },
  51. {
  52. "name": "__pMatchSubtypes",
  53. "type": "boolean",
  54. "default": false
  55. },
  56. {
  57. "name": "eventList",
  58. "type": "code",
  59. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  60. }
  61. ],
  62. "__pTransition": [
  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. "name": "event",
  85. "type": "code",
  86. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  87. }
  88. ]
  89. },
  90. "constraints": [],
  91. "actions": [
  92. {
  93. "name": "distinctPLabels",
  94. "event": "post-create",
  95. "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}",
  96. "targetType": "*"
  97. }
  98. ],
  99. "cardinalities": {
  100. "__pState": [
  101. {
  102. "dir": "out",
  103. "type": "__pTransition",
  104. "min": 0,
  105. "max": "Infinity"
  106. },
  107. {
  108. "dir": "in",
  109. "type": "__pTransition",
  110. "min": 0,
  111. "max": "Infinity"
  112. }
  113. ],
  114. "__pInputEvents": [],
  115. "__pTransition": [
  116. {
  117. "dir": "in",
  118. "type": "__pState",
  119. "min": 0,
  120. "max": "1"
  121. },
  122. {
  123. "dir": "out",
  124. "type": "__pState",
  125. "min": 0,
  126. "max": "1"
  127. }
  128. ]
  129. },
  130. "legalConnections": {
  131. "__pState": {
  132. "__pState": [
  133. "__pTransition"
  134. ]
  135. }
  136. },
  137. "connectorTypes": {
  138. "__pTransition": "visual"
  139. },
  140. "types2parentTypes": {
  141. "__pState": [],
  142. "__pInputEvents": [],
  143. "__pTransition": []
  144. }
  145. }