GenericGraph.pattern.metamodel 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {
  2. "types": {
  3. "__p$*": [
  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. "__pGenericLink": [
  26. {
  27. "name": "__pLabel",
  28. "type": "string",
  29. "default": ""
  30. },
  31. {
  32. "name": "__pPivotIn",
  33. "type": "string",
  34. "default": ""
  35. },
  36. {
  37. "name": "__pPivotOut",
  38. "type": "string",
  39. "default": ""
  40. },
  41. {
  42. "name": "__pMatchSubtypes",
  43. "type": "boolean",
  44. "default": false
  45. }
  46. ]
  47. },
  48. "constraints": [],
  49. "actions": [
  50. {
  51. "name": "distinctPLabels",
  52. "event": "post-create",
  53. "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}",
  54. "targetType": "*"
  55. }
  56. ],
  57. "cardinalities": {
  58. "__p$*": [
  59. {
  60. "dir": "out",
  61. "type": "__pGenericLink",
  62. "min": 0,
  63. "max": "Infinity"
  64. },
  65. {
  66. "dir": "in",
  67. "type": "__pGenericLink",
  68. "min": 0,
  69. "max": "Infinity"
  70. }
  71. ],
  72. "__pGenericLink": [
  73. {
  74. "dir": "in",
  75. "type": "__p$*",
  76. "min": 0,
  77. "max": "1"
  78. },
  79. {
  80. "dir": "out",
  81. "type": "__p$*",
  82. "min": 0,
  83. "max": "1"
  84. }
  85. ]
  86. },
  87. "legalConnections": {
  88. "__p$*": {
  89. "__p$*": [
  90. "__pGenericLink"
  91. ]
  92. }
  93. },
  94. "connectorTypes": {
  95. "__pGenericLink": "visual"
  96. },
  97. "types2parentTypes": {
  98. "__p$*": [],
  99. "__pGenericLink": []
  100. }
  101. }