AttributedGenericGraph.pattern.metamodel 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {
  2. "types": {
  3. "__p$*": [
  4. {
  5. "name": "__pLabel",
  6. "type": "string",
  7. "default": ""
  8. },
  9. {
  10. "name": "__pMatchSubtypes",
  11. "type": "boolean",
  12. "default": false
  13. }
  14. ],
  15. "__pAttributedGenericLink": [
  16. {
  17. "name": "__pLabel",
  18. "type": "string",
  19. "default": ""
  20. },
  21. {
  22. "name": "__pMatchSubtypes",
  23. "type": "boolean",
  24. "default": false
  25. },
  26. {
  27. "name": "name",
  28. "type": "code",
  29. "default": "getAttr()"
  30. },
  31. {
  32. "name": "data",
  33. "type": "code",
  34. "default": "getAttr()"
  35. }
  36. ]
  37. },
  38. "constraints": [],
  39. "actions": [
  40. {
  41. "name": "distinctPLabels",
  42. "event": "post-create",
  43. "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}",
  44. "targetType": "*"
  45. }
  46. ],
  47. "cardinalities": {
  48. "__p$*": [
  49. {
  50. "dir": "out",
  51. "type": "__pAttributedGenericLink",
  52. "min": 0,
  53. "max": "Infinity"
  54. },
  55. {
  56. "dir": "in",
  57. "type": "__pAttributedGenericLink",
  58. "min": 0,
  59. "max": "Infinity"
  60. }
  61. ],
  62. "__pAttributedGenericLink": [
  63. {
  64. "dir": "in",
  65. "type": "__p$*",
  66. "min": 0,
  67. "max": "1"
  68. },
  69. {
  70. "dir": "out",
  71. "type": "__p$*",
  72. "min": 0,
  73. "max": "1"
  74. }
  75. ]
  76. },
  77. "legalConnections": {
  78. "__p$*": {
  79. "__p$*": [
  80. "__pAttributedGenericLink"
  81. ]
  82. }
  83. },
  84. "connectorTypes": {
  85. "__pAttributedGenericLink": "visual"
  86. },
  87. "types2parentTypes": {
  88. "__p$*": [],
  89. "__pAttributedGenericLink": []
  90. }
  91. }