cpee 1.5.19 → 1.5.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (243) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/model.css +24 -0
  3. data/cockpit/css/ui.css +25 -0
  4. data/cockpit/index.html +6 -6
  5. data/cockpit/js/details.js +70 -52
  6. data/cockpit/js/instance.js +61 -17
  7. data/cockpit/js/model.js +41 -0
  8. data/cockpit/js/ui.js +3 -0
  9. data/cockpit/model.html +191 -0
  10. data/cockpit/themes/compact/rngs/alternative.rng +1 -0
  11. data/cockpit/themes/compact/rngs/call.rng +111 -0
  12. data/cockpit/themes/compact/rngs/callmanipulate.rng +134 -0
  13. data/cockpit/themes/compact/rngs/choose.rng +1 -0
  14. data/cockpit/themes/compact/rngs/critical.rng +1 -0
  15. data/cockpit/themes/compact/rngs/escape.rng +1 -0
  16. data/cockpit/themes/compact/rngs/group.rng +1 -0
  17. data/cockpit/themes/compact/rngs/loop.rng +1 -0
  18. data/cockpit/themes/compact/rngs/manipulate.rng +1 -0
  19. data/cockpit/themes/compact/rngs/otherwise.rng +1 -0
  20. data/cockpit/themes/compact/rngs/parallel.rng +1 -0
  21. data/cockpit/themes/compact/rngs/parallel_branch.rng +1 -0
  22. data/cockpit/themes/compact/rngs/scripts.rng +24 -0
  23. data/cockpit/themes/compact/rngs/stop.rng +1 -0
  24. data/cockpit/themes/compact/rngs/terminate.rng +1 -0
  25. data/cockpit/themes/compact/symbols/alternative.svg +5 -0
  26. data/cockpit/themes/compact/symbols/arrow.svg +3 -0
  27. data/cockpit/themes/compact/symbols/call.svg +6 -0
  28. data/cockpit/themes/compact/symbols/callmanipulate.svg +8 -0
  29. data/cockpit/themes/compact/symbols/choose.svg +5 -0
  30. data/cockpit/themes/compact/symbols/choose_exclusive.svg +5 -0
  31. data/cockpit/themes/compact/symbols/choose_inclusive.svg +4 -0
  32. data/cockpit/themes/compact/symbols/complex.svg +8 -0
  33. data/cockpit/themes/compact/symbols/critical.svg +4 -0
  34. data/cockpit/themes/compact/symbols/end.svg +3 -0
  35. data/cockpit/themes/compact/symbols/escape.svg +5 -0
  36. data/cockpit/themes/compact/symbols/event_end.svg +3 -0
  37. data/cockpit/themes/compact/symbols/loop.svg +5 -0
  38. data/cockpit/themes/compact/symbols/manipulate.svg +4 -0
  39. data/cockpit/themes/compact/symbols/otherwise.svg +5 -0
  40. data/cockpit/themes/compact/symbols/parallel.svg +5 -0
  41. data/cockpit/themes/compact/symbols/parallel_branch.svg +5 -0
  42. data/cockpit/themes/compact/symbols/parallel_branch_compact.svg +4 -0
  43. data/cockpit/themes/compact/symbols/parallel_branch_event.svg +14 -0
  44. data/cockpit/themes/compact/symbols/parallel_branch_normal.svg +5 -0
  45. data/cockpit/themes/compact/symbols/scripts.svg +4 -0
  46. data/cockpit/themes/compact/symbols/start.svg +3 -0
  47. data/cockpit/themes/compact/symbols/stop.svg +5 -0
  48. data/cockpit/themes/compact/symbols/terminate.svg +4 -0
  49. data/cockpit/themes/compact/theme.js +30 -18
  50. data/cockpit/themes/default/rngs/callmanipulate.rng +5 -0
  51. data/cockpit/themes/default/theme.js +97 -57
  52. data/cockpit/themes/extended/rngs/alternative.rng +1 -0
  53. data/cockpit/themes/extended/rngs/call.rng +111 -0
  54. data/cockpit/themes/extended/rngs/callmanipulate.rng +134 -0
  55. data/cockpit/themes/extended/rngs/choose.rng +1 -0
  56. data/cockpit/themes/extended/rngs/critical.rng +1 -0
  57. data/cockpit/themes/extended/rngs/escape.rng +1 -0
  58. data/cockpit/themes/extended/rngs/group.rng +1 -0
  59. data/cockpit/themes/extended/rngs/loop.rng +1 -0
  60. data/cockpit/themes/extended/rngs/manipulate.rng +1 -0
  61. data/cockpit/themes/extended/rngs/otherwise.rng +1 -0
  62. data/cockpit/themes/extended/rngs/parallel.rng +1 -0
  63. data/cockpit/themes/extended/rngs/parallel_branch.rng +1 -0
  64. data/cockpit/themes/extended/rngs/scripts.rng +24 -0
  65. data/cockpit/themes/extended/rngs/stop.rng +1 -0
  66. data/cockpit/themes/extended/rngs/terminate.rng +1 -0
  67. data/cockpit/themes/extended/symbols/alternative.svg +5 -0
  68. data/cockpit/themes/extended/symbols/arrow.svg +3 -0
  69. data/cockpit/themes/extended/symbols/call.svg +6 -0
  70. data/cockpit/themes/extended/symbols/callmanipulate.svg +8 -0
  71. data/cockpit/themes/extended/symbols/choose.svg +5 -0
  72. data/cockpit/themes/extended/symbols/choose_exclusive.svg +5 -0
  73. data/cockpit/themes/extended/symbols/choose_inclusive.svg +4 -0
  74. data/cockpit/themes/extended/symbols/complex.svg +8 -0
  75. data/cockpit/themes/extended/symbols/critical.svg +4 -0
  76. data/cockpit/themes/extended/symbols/end.svg +3 -0
  77. data/cockpit/themes/extended/symbols/escape.svg +5 -0
  78. data/cockpit/themes/extended/symbols/event_end.svg +3 -0
  79. data/cockpit/themes/extended/symbols/loop.svg +5 -0
  80. data/cockpit/themes/extended/symbols/manipulate.svg +4 -0
  81. data/cockpit/themes/extended/symbols/otherwise.svg +5 -0
  82. data/cockpit/themes/extended/symbols/parallel.svg +5 -0
  83. data/cockpit/themes/extended/symbols/parallel_branch.svg +5 -0
  84. data/cockpit/themes/extended/symbols/parallel_branch_compact.svg +4 -0
  85. data/cockpit/themes/extended/symbols/parallel_branch_event.svg +14 -0
  86. data/cockpit/themes/extended/symbols/parallel_branch_normal.svg +5 -0
  87. data/cockpit/themes/extended/symbols/scripts.svg +4 -0
  88. data/cockpit/themes/extended/symbols/start.svg +3 -0
  89. data/cockpit/themes/extended/symbols/stop.svg +5 -0
  90. data/cockpit/themes/extended/symbols/terminate.svg +4 -0
  91. data/cockpit/themes/extended/theme.js +30 -18
  92. data/cockpit/themes/labels/rngs/alternative.rng +25 -0
  93. data/cockpit/themes/labels/rngs/call.rng +81 -0
  94. data/cockpit/themes/labels/rngs/callmanipulate.rng +101 -0
  95. data/cockpit/themes/labels/rngs/choose.rng +12 -0
  96. data/cockpit/themes/labels/rngs/critical.rng +5 -0
  97. data/cockpit/themes/labels/rngs/escape.rng +1 -0
  98. data/cockpit/themes/labels/rngs/finalize.rng +6 -0
  99. data/cockpit/themes/labels/rngs/group.rng +3 -0
  100. data/cockpit/themes/labels/rngs/loop.rng +22 -0
  101. data/cockpit/themes/labels/rngs/manipulate.rng +9 -0
  102. data/cockpit/themes/labels/rngs/otherwise.rng +22 -0
  103. data/cockpit/themes/labels/rngs/parallel.rng +13 -0
  104. data/cockpit/themes/labels/rngs/parallel_branch.rng +8 -0
  105. data/cockpit/themes/labels/rngs/stop.rng +5 -0
  106. data/cockpit/themes/labels/rngs/terminate.rng +1 -0
  107. data/cockpit/themes/labels/rngs/update.rng +6 -0
  108. data/cockpit/themes/labels/symbols/alternative.svg +5 -0
  109. data/cockpit/themes/labels/symbols/arrow.svg +3 -0
  110. data/cockpit/themes/labels/symbols/call.svg +6 -0
  111. data/cockpit/themes/labels/symbols/callmanipulate.svg +8 -0
  112. data/cockpit/themes/labels/symbols/choose.svg +5 -0
  113. data/cockpit/themes/labels/symbols/choose_exclusive.svg +5 -0
  114. data/cockpit/themes/labels/symbols/choose_inclusive.svg +4 -0
  115. data/cockpit/themes/labels/symbols/complex.svg +8 -0
  116. data/cockpit/themes/labels/symbols/critical.svg +4 -0
  117. data/cockpit/themes/labels/symbols/end.svg +3 -0
  118. data/cockpit/themes/labels/symbols/escape.svg +5 -0
  119. data/cockpit/themes/labels/symbols/event_end.svg +3 -0
  120. data/cockpit/themes/labels/symbols/loop.svg +5 -0
  121. data/cockpit/themes/labels/symbols/manipulate.svg +4 -0
  122. data/cockpit/themes/labels/symbols/otherwise.svg +5 -0
  123. data/cockpit/themes/labels/symbols/parallel.svg +5 -0
  124. data/cockpit/themes/labels/symbols/parallel_branch.svg +5 -0
  125. data/cockpit/themes/labels/symbols/parallel_branch_compact.svg +4 -0
  126. data/cockpit/themes/labels/symbols/parallel_branch_event.svg +14 -0
  127. data/cockpit/themes/labels/symbols/parallel_branch_normal.svg +5 -0
  128. data/cockpit/themes/labels/symbols/scripts.svg +4 -0
  129. data/cockpit/themes/labels/symbols/start.svg +3 -0
  130. data/cockpit/themes/labels/symbols/stop.svg +5 -0
  131. data/cockpit/themes/labels/symbols/terminate.svg +4 -0
  132. data/cockpit/themes/model/rngs/alternative.rng +1 -0
  133. data/cockpit/themes/model/rngs/call.rng +62 -0
  134. data/cockpit/themes/model/rngs/callmanipulate.rng +67 -0
  135. data/cockpit/themes/model/rngs/choose.rng +1 -0
  136. data/cockpit/themes/model/rngs/critical.rng +1 -0
  137. data/cockpit/themes/model/rngs/escape.rng +1 -0
  138. data/cockpit/themes/model/rngs/group.rng +1 -0
  139. data/cockpit/themes/model/rngs/loop.rng +1 -0
  140. data/cockpit/themes/model/rngs/manipulate.rng +1 -0
  141. data/cockpit/themes/model/rngs/otherwise.rng +1 -0
  142. data/cockpit/themes/model/rngs/parallel.rng +1 -0
  143. data/cockpit/themes/model/rngs/parallel_branch.rng +1 -0
  144. data/cockpit/themes/model/rngs/scripts.rng +8 -0
  145. data/cockpit/themes/model/rngs/stop.rng +1 -0
  146. data/cockpit/themes/model/rngs/terminate.rng +1 -0
  147. data/cockpit/themes/model/symbols/alternative.svg +5 -0
  148. data/cockpit/themes/model/symbols/arrow.svg +3 -0
  149. data/cockpit/themes/model/symbols/call.svg +6 -0
  150. data/cockpit/themes/model/symbols/callmanipulate.svg +8 -0
  151. data/cockpit/themes/model/symbols/choose.svg +5 -0
  152. data/cockpit/themes/model/symbols/choose_exclusive.svg +5 -0
  153. data/cockpit/themes/model/symbols/choose_inclusive.svg +4 -0
  154. data/cockpit/themes/model/symbols/complex.svg +8 -0
  155. data/cockpit/themes/model/symbols/critical.svg +4 -0
  156. data/cockpit/themes/model/symbols/end.svg +3 -0
  157. data/cockpit/themes/model/symbols/escape.svg +5 -0
  158. data/cockpit/themes/model/symbols/event_end.svg +3 -0
  159. data/cockpit/themes/model/symbols/loop.svg +5 -0
  160. data/cockpit/themes/model/symbols/manipulate.svg +4 -0
  161. data/cockpit/themes/model/symbols/otherwise.svg +5 -0
  162. data/cockpit/themes/model/symbols/parallel.svg +5 -0
  163. data/cockpit/themes/model/symbols/parallel_branch.svg +5 -0
  164. data/cockpit/themes/model/symbols/parallel_branch_compact.svg +4 -0
  165. data/cockpit/themes/model/symbols/parallel_branch_event.svg +14 -0
  166. data/cockpit/themes/model/symbols/parallel_branch_normal.svg +5 -0
  167. data/cockpit/themes/model/symbols/scripts.svg +4 -0
  168. data/cockpit/themes/model/symbols/start.svg +3 -0
  169. data/cockpit/themes/model/symbols/stop.svg +5 -0
  170. data/cockpit/themes/model/symbols/terminate.svg +4 -0
  171. data/cockpit/themes/model/theme.js +1267 -0
  172. data/cockpit/themes/packed/rngs/alternative.rng +1 -0
  173. data/cockpit/themes/packed/rngs/call.rng +111 -0
  174. data/cockpit/themes/packed/rngs/callmanipulate.rng +134 -0
  175. data/cockpit/themes/packed/rngs/choose.rng +1 -0
  176. data/cockpit/themes/packed/rngs/critical.rng +1 -0
  177. data/cockpit/themes/packed/rngs/escape.rng +1 -0
  178. data/cockpit/themes/packed/rngs/group.rng +1 -0
  179. data/cockpit/themes/packed/rngs/loop.rng +1 -0
  180. data/cockpit/themes/packed/rngs/manipulate.rng +1 -0
  181. data/cockpit/themes/packed/rngs/otherwise.rng +1 -0
  182. data/cockpit/themes/packed/rngs/parallel.rng +1 -0
  183. data/cockpit/themes/packed/rngs/parallel_branch.rng +1 -0
  184. data/cockpit/themes/packed/rngs/scripts.rng +24 -0
  185. data/cockpit/themes/packed/rngs/stop.rng +1 -0
  186. data/cockpit/themes/packed/rngs/terminate.rng +1 -0
  187. data/cockpit/themes/packed/symbols/alternative.svg +5 -0
  188. data/cockpit/themes/packed/symbols/arrow.svg +3 -0
  189. data/cockpit/themes/packed/symbols/call.svg +6 -0
  190. data/cockpit/themes/packed/symbols/callmanipulate.svg +8 -0
  191. data/cockpit/themes/packed/symbols/choose.svg +5 -0
  192. data/cockpit/themes/packed/symbols/choose_exclusive.svg +5 -0
  193. data/cockpit/themes/packed/symbols/choose_inclusive.svg +4 -0
  194. data/cockpit/themes/packed/symbols/complex.svg +8 -0
  195. data/cockpit/themes/packed/symbols/critical.svg +4 -0
  196. data/cockpit/themes/packed/symbols/end.svg +3 -0
  197. data/cockpit/themes/packed/symbols/escape.svg +5 -0
  198. data/cockpit/themes/packed/symbols/event_end.svg +3 -0
  199. data/cockpit/themes/packed/symbols/loop.svg +5 -0
  200. data/cockpit/themes/packed/symbols/manipulate.svg +4 -0
  201. data/cockpit/themes/packed/symbols/otherwise.svg +5 -0
  202. data/cockpit/themes/packed/symbols/parallel.svg +5 -0
  203. data/cockpit/themes/packed/symbols/parallel_branch.svg +5 -0
  204. data/cockpit/themes/packed/symbols/parallel_branch_compact.svg +4 -0
  205. data/cockpit/themes/packed/symbols/parallel_branch_event.svg +14 -0
  206. data/cockpit/themes/packed/symbols/parallel_branch_normal.svg +5 -0
  207. data/cockpit/themes/packed/symbols/scripts.svg +4 -0
  208. data/cockpit/themes/packed/symbols/start.svg +3 -0
  209. data/cockpit/themes/packed/symbols/stop.svg +5 -0
  210. data/cockpit/themes/packed/symbols/terminate.svg +4 -0
  211. data/cockpit/themes/packed/theme.js +30 -18
  212. data/cockpit/themes/preset/rngs/call.rng +0 -10
  213. data/cockpit/themes/preset/rngs/callmanipulate.rng +0 -13
  214. data/cockpit/themes/preset/symbols/alternative.svg +5 -0
  215. data/cockpit/themes/preset/symbols/arrow.svg +3 -0
  216. data/cockpit/themes/preset/symbols/call.svg +6 -0
  217. data/cockpit/themes/preset/symbols/callmanipulate.svg +8 -0
  218. data/cockpit/themes/preset/symbols/choose.svg +5 -0
  219. data/cockpit/themes/preset/symbols/choose_exclusive.svg +5 -0
  220. data/cockpit/themes/preset/symbols/choose_inclusive.svg +4 -0
  221. data/cockpit/themes/preset/symbols/complex.svg +8 -0
  222. data/cockpit/themes/preset/symbols/critical.svg +4 -0
  223. data/cockpit/themes/preset/symbols/end.svg +3 -0
  224. data/cockpit/themes/preset/symbols/escape.svg +5 -0
  225. data/cockpit/themes/preset/symbols/event_end.svg +3 -0
  226. data/cockpit/themes/preset/symbols/loop.svg +5 -0
  227. data/cockpit/themes/preset/symbols/manipulate.svg +4 -0
  228. data/cockpit/themes/preset/symbols/otherwise.svg +5 -0
  229. data/cockpit/themes/preset/symbols/parallel.svg +5 -0
  230. data/cockpit/themes/preset/symbols/parallel_branch.svg +5 -0
  231. data/cockpit/themes/preset/symbols/parallel_branch_compact.svg +4 -0
  232. data/cockpit/themes/preset/symbols/parallel_branch_event.svg +14 -0
  233. data/cockpit/themes/preset/symbols/parallel_branch_normal.svg +5 -0
  234. data/cockpit/themes/preset/symbols/scripts.svg +4 -0
  235. data/cockpit/themes/preset/symbols/start.svg +3 -0
  236. data/cockpit/themes/preset/symbols/stop.svg +5 -0
  237. data/cockpit/themes/preset/symbols/terminate.svg +4 -0
  238. data/cockpit/themes/preset/theme.js +30 -18
  239. data/cpee.gemspec +2 -2
  240. data/lib/cpee/implementation.rb +28 -0
  241. data/lib/engine.xml +4 -0
  242. data/log/azure.rb +1 -1
  243. metadata +227 -3
@@ -0,0 +1,5 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <rect transform="rotate(45,14,12)" x="7" y="3" width="21" height="21" class="cline hfill stand"/>
3
+ <line x1="10.5" y1="20.5" x2="20.5" y2="10.5" class="stand"/>
4
+ <line x1="10.5" y1="10.5" x2="20.5" y2="20.5" class="stand"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="1" y="1" width="28" height="28" rx="4" class="rfill hfill cline stand"/>
3
+ <text transform="translate(15,21)" class="normal">s</text>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="15" cy="15" r="11" class="hfill standtrans"/>
3
+ <line x1="9" y1="21" x2="21" y2="9" class="stand cline hline"/>
4
+ <line x1="15.6" y1="4" x2="15.6" y2="27" class="ourline"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <rect transform="rotate(45,14,12)" x="7" y="3" width="21" height="21" class="cline hfill stand"/>
3
+ <text transform="translate(15,25)" class="normallarge">+</text>
4
+ </svg>
5
+
@@ -0,0 +1,5 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="11" y="6" width="9" height="18" rx="0" class="hline white"/>
3
+ <path class="cline hfill stand" d="M 11,5 C 2,9 2,21 11,25 M 20,5 C 29,9 29,21 20,25" style="stroke-dasharray:1,4;"/>
4
+ <line x1="15.6" y1="4" x2="15.6" y2="27" class="ourline"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <rect transform="rotate(45,14,12)" x="7" y="3" width="21" height="21" class="cline hfill stand"/>
3
+ <text transform="translate(15,20)" class="small">|||</text>
4
+ </svg>
@@ -0,0 +1,14 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="1" y="3" width="24" height="24" rx="4" class="hfill rfill cline stand"/>
3
+
4
+ <circle cx="24" cy="15" r="10" class="cline rfill stand" style="stroke-dasharray: 1,3"/>
5
+ <circle cx="24" cy="15" r="7" class="cline rfill stand" style="stroke-dasharray: 1,3"/>
6
+ <line x1="24" y1="11" x2="20" y2="18" class="stand"/>
7
+ <line x1="20" y1="18" x2="28" y2="18" class="stand"/>
8
+ <line x1="28" y1="18" x2="24" y2="11" class="stand"/>
9
+
10
+ <circle cx="55.5" cy="15" r="14" class="cline hfill rfill stand"/>
11
+ <line x1="55.5" y1="11" x2="51.5" y2="18" class="stand"/>
12
+ <line x1="51.5" y1="18" x2="59.5" y2="18" class="stand"/>
13
+ <line x1="59.5" y1="18" x2="55.5" y2="11" class="stand"/>
14
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="11" y="6" width="9" height="18" rx="0" class="hline white"/>
3
+ <path class="cline hfill stand" d="M 11,5 C 2,9 2,21 11,25 M 20,5 C 29,9 29,21 20,25" style="stroke-dasharray:1,4;"/>
4
+ <line x1="15.6" y1="4" x2="15.6" y2="27" class="ourline"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="1" y="1" width="28" height="28" rx="4" class="hfill rfill cline stand"/>
3
+ <text transform="translate(15,21)" class="normal">s</text>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="15" cy="15" r="14" class="stand"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="15" cy="15" r="14" class="hfill rfill cline stand"/>
3
+ <line x1="12.5" y1="22.5" x2="12.5" y2="8.5" class="stand"/>
4
+ <line x1="17.5" y1="22.5" x2="17.5" y2="8.5" class="stand"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg class="clickable" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="15" cy="15" r="14" class="standfat"/>
3
+ <circle cx="15" cy="15" r="9" class="black"/>
4
+ </svg>
@@ -0,0 +1,1267 @@
1
+ function WFAdaptorManifestation(adaptor) {
2
+ var self = this;
3
+
4
+ this.adaptor = adaptor;
5
+ this.resources = {};
6
+ this.elements = {};
7
+ this.events = {};
8
+ this.compact = false;
9
+ this.striped = false;
10
+ this.endpoints = {};
11
+
12
+ //{{{ transform the details data to description parts based on rng
13
+ this.source = function(base,opts) {
14
+ if (base[0].namespaceURI == "http://relaxng.org/ns/structure/1.0") {
15
+ $('#relaxngworker').empty();
16
+ var rngw = new RelaxNGui(base,$('#relaxngworker'),self.adaptor.description.context_eval);
17
+ var nnew = $(rngw.save().documentElement);
18
+ nnew.attr('trans-xmlns','http://cpee.org/ns/description/1.0');
19
+ var ntxt = nnew.serializeXML();
20
+ ntxt = ntxt.replace(/trans-xmlns/,'xmlns');
21
+
22
+ return($X(ntxt));
23
+ } else {
24
+ if (opts && opts == 'clone') {
25
+ base = base.clone();
26
+ if (base.attr('id')) {
27
+ base.attr('id',self.adaptor.description.get_free_id());
28
+ }
29
+ base.find('*[id]').each(function(k,v){
30
+ $(v).attr('id',self.adaptor.description.get_free_id(base));
31
+ });
32
+ }
33
+ return base;
34
+ }
35
+ }; //}}}
36
+ //{{{ Return the svgid for the selected task
37
+ this.selected = function(){
38
+ var svgid = 'unknown';
39
+ _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
40
+ if ($(value).hasClass('selected')) {
41
+ svgid = $(value).attr('element-id');
42
+ }
43
+ });
44
+ return svgid;
45
+ }; //}}}
46
+ //{{{ Return the svgids for all marked tasks
47
+ this.marked = function(){
48
+ var svgid = [];
49
+ _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
50
+ if ($(value).hasClass('marked')) {
51
+ svgid.push($(value).attr('element-id'));
52
+ }
53
+ });
54
+ return svgid;
55
+ }; //}}}
56
+ //{{{ Render the details from rng (right hand side of graph tab)
57
+ this.update_details = function(svgid){
58
+ var tab = $('#dat_details');
59
+ var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
60
+ tab.empty();
61
+ if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
62
+ save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
63
+ var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
64
+ if (save['endpoints_cache'][$(node).attr('endpoint')] && save['endpoints_cache'][$(node).attr('endpoint')].schema) {
65
+ var schema = save['endpoints_cache'][$(node).attr('endpoint')].schema.documentElement;
66
+ $(rng).find(' > element[name="parameters"] > element[name="arguments"]').replaceWith($(schema).clone());
67
+ }
68
+ if (save['endpoints_list'][$(node).attr('endpoint')] && !save['endpoints_list'][$(node).attr('endpoint')].startsWith('http')) {
69
+ $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
70
+ }
71
+ save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
72
+ save['details'].content(node);
73
+ format_visual_forms();
74
+ }
75
+ }; //}}}
76
+
77
+ function copyOrMove(menu,group,xml_node,mode) { //{{{
78
+ var markymark = _.uniq(self.marked());
79
+ var check1 = [];
80
+ var check2 = [];
81
+ $(markymark).each(function(key,svgid){
82
+ var node = self.adaptor.description.get_node_by_svg_id(svgid);
83
+ check1.push($(node).attr('svg-type'));
84
+ });
85
+ $(group).each(function(key,value){
86
+ check2.push(value.type);
87
+ });
88
+
89
+ if (markymark.length > 0 && _.uniq(check1).length == _.intersection(check1,check2).length) {
90
+ var nodes = [];
91
+ $(markymark).each(function(key,svgid){
92
+ var node = self.adaptor.description.get_node_by_svg_id(svgid);
93
+ nodes.unshift(node);
94
+ });
95
+
96
+ var iconm = self.resources['arrow'].clone();
97
+ var iconc = self.resources['arrow'].clone();
98
+ iconm.children('.rfill').addClass('menu');
99
+ menu.push(
100
+ {
101
+ 'label': '<em>Move Marked Elements</em>',
102
+ 'function_call': mode,
103
+ 'menu_icon': iconm,
104
+ 'type': undefined,
105
+ 'params': [nodes, xml_node]
106
+ },
107
+ {
108
+ 'label': '<em>Copy Marked Elements</em>',
109
+ 'function_call': mode,
110
+ 'menu_icon': iconc,
111
+ 'type': undefined,
112
+ 'params': [nodes, xml_node, 'clone']
113
+ }
114
+ );
115
+ }
116
+ } //}}}
117
+
118
+ // Events
119
+ this.events.mousedown = function(svgid, e, child, sibling) { // {{{
120
+ if(e.button == 0) { // left-click
121
+ } else if(e.button == 1) { // middle-click
122
+ } else if(e.button == 2) { // right-click
123
+ if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
124
+
125
+ var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
126
+ var group = null;
127
+ var menu = {};
128
+
129
+ if (child) {
130
+ group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
131
+ if(group.length > 0) {
132
+ menu['Insert into'] = group;
133
+ copyOrMove(menu['Insert into'],group,xml_node,self.adaptor.description.insert_first_into);
134
+ }
135
+ if (self.elements[xml_node.get(0).tagName].permissible_children_expert) {
136
+ group = self.elements[xml_node.get(0).tagName].permissible_children_expert(xml_node,'into');
137
+ if(group.length > 0) {
138
+ menu['Insert into (Experts Only!)'] = group;
139
+ copyOrMove(menu['Insert into (Experts Only!)'],group,xml_node,self.adaptor.description.insert_first_into);
140
+ }
141
+ }
142
+ }
143
+ if (sibling) {
144
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
145
+ if(group.length > 0) {
146
+ menu['Insert after'] = group;
147
+ copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
148
+ }
149
+ if (self.elements[xml_node.parent().get(0).tagName].permissible_children_expert) {
150
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children_expert(xml_node,'after');
151
+ if(group.length > 0) {
152
+ menu['Insert after (Experts Only!)'] = group;
153
+ copyOrMove(menu['Insert after (Experts Only!)'],group,xml_node,self.adaptor.description.insert_after);
154
+ }
155
+ }
156
+ }
157
+
158
+ if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
159
+ var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
160
+ icon.children('.rfill').addClass('menu');
161
+ menu['Delete'] = [{
162
+ 'label': 'Remove Element',
163
+ 'function_call': function(selector,target,selected){ self.adaptor.description.remove(selector,target); self.adaptor.illustrator.get_label_by_svg_id(selected).addClass('selected'); },
164
+ 'menu_icon': icon,
165
+ 'type': undefined,
166
+ 'params': [null, xml_node, self.selected()]
167
+ }];
168
+ }
169
+ if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
170
+ var icon = self.elements.callmanipulate.illustrator.svg.clone();
171
+ icon.children('.rfill:last').addClass('menu');
172
+ menu['Delete'].push({
173
+ 'label': 'Remove Output Transformation',
174
+ 'function_call': self.adaptor.description.remove,
175
+ 'menu_icon': icon,
176
+ 'type': undefined,
177
+ 'params': ['> code', xml_node]
178
+ });
179
+ }
180
+ new CustomMenu(e).contextmenu(menu);
181
+ }
182
+ return false;
183
+ } // }}}
184
+ this.events.suppress = function(svgid, e, child, sibling) { // {{{
185
+ return false;
186
+ } // }}}
187
+ this.events.click = function(svgid, e) { // {{{
188
+ if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
189
+ return;
190
+ }
191
+
192
+ self.adaptor.illustrator.get_elements().removeClass('selected');
193
+ self.adaptor.illustrator.get_labels().removeClass('selected');
194
+
195
+ if (e && e.ctrlKey) {
196
+ if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
197
+ var tab = $('#dat_details');
198
+ tab.empty();
199
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
200
+ if (vtarget.length > 0) {
201
+ vtarget.parents('g.element[element-id]').toggleClass('marked');
202
+ }
203
+ } else {
204
+ self.adaptor.illustrator.get_elements().removeClass('marked');
205
+
206
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
207
+ if (vtarget.length > 0) {
208
+ vtarget.parents('g.element[element-id]').addClass('selected');
209
+ }
210
+ self.adaptor.illustrator.get_label_by_svg_id(svgid).addClass('selected');
211
+
212
+ self.update_details(svgid);
213
+ }
214
+ } // }}}
215
+ this.events.dblclick = function(svgid, e) { // {{{
216
+ } // }}}
217
+ this.events.mouseover = function(svgid, e) { // {{{
218
+ self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','block');
219
+ self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').addClass('hover');
220
+ self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').addClass('hover');
221
+ return false;
222
+ } // }}}
223
+ this.events.mouseout = function(svgid, e) { // {{{
224
+ self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','none');
225
+ self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').removeClass('hover');
226
+ self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').removeClass('hover');
227
+ return false;
228
+ } // }}}
229
+ this.events.dragstart = function (svgid, e) { //{{{
230
+ } //}}}
231
+
232
+ // other resources
233
+ this.resources.arrow = self.adaptor.theme_dir + 'symbols/arrow.svg';
234
+
235
+ // Primitive Elements
236
+ this.elements.call = { /*{{{*/
237
+ 'type': 'primitive',
238
+ 'illustrator': {//{{{
239
+ 'endnodes': 'this',
240
+ 'label': function(node){
241
+ var ret;
242
+ if ($('> url',$(node).children('parameters').children('arguments')).length > 0) {
243
+ ret = [ { column: 'Label', value: '<a target="blank_" href="' + $('> url',$(node).children('parameters').children('arguments')).text() + '">' + $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') + '</a>' } ];
244
+ } else {
245
+ ret = [ { column: 'Label', value: $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') } ];
246
+ }
247
+ return ret;
248
+ },
249
+ 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
250
+ 'resolve_symbol': function(node) {
251
+ if($('code', node).length > 0) {
252
+ return 'callmanipulate';
253
+ } else {
254
+ return 'call';
255
+ }
256
+ },
257
+ 'svg': self.adaptor.theme_dir + 'symbols/call.svg'
258
+ },//}}}
259
+ 'description': self.adaptor.theme_dir + 'rngs/call.rng',
260
+ 'permissible_children': function(node,mode) { //{{{
261
+ if(node.children('code').length < 1)
262
+ return [
263
+ {'label': 'Output Transformation',
264
+ 'function_call': self.adaptor.description.insert_last_into,
265
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
266
+ 'type': undefined,
267
+ 'params': [self.adaptor.description.elements.scripts, node]}
268
+ ];
269
+ return [];
270
+ }, //}}}
271
+ 'adaptor': {//{{{
272
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
273
+ 'click': self.events.click,
274
+ 'dragstart': self.events.dragstart,
275
+ 'mouseover': self.events.mouseover,
276
+ 'mouseout': self.events.mouseout
277
+ }//}}}
278
+ }; /*}}}*/
279
+ this.elements.manipulate = { /*{{{*/
280
+ 'type': 'primitive',
281
+ 'illustrator': {//{{{
282
+ 'endnodes': 'this',
283
+ 'label': function(node){
284
+ var lab = $(node).attr('label');
285
+ if (lab) {
286
+ return [ { column: 'Label', value: lab.replace(/^['"]/,'').replace(/['"]$/,'') } ];
287
+ } else {
288
+ return [];
289
+ }
290
+ },
291
+ 'svg': self.adaptor.theme_dir + 'symbols/manipulate.svg'
292
+ },//}}}
293
+ 'description': self.adaptor.theme_dir + 'rngs/manipulate.rng',
294
+ 'permissible_children': function(node,mode) { //{{{
295
+ return [];
296
+ }, //}}}
297
+ 'adaptor': {//{{{
298
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
299
+ 'click': self.events.click,
300
+ 'mouseover': self.events.mouseover,
301
+ 'mouseout': self.events.mouseout
302
+ }//}}}
303
+ }; /*}}}*/
304
+ this.elements.escape = { /*{{{*/
305
+ 'type': 'primitive',
306
+ 'illustrator': {//{{{
307
+ 'endnodes': 'this',
308
+ 'svg': self.adaptor.theme_dir + 'symbols/escape.svg'
309
+ },//}}}
310
+ 'description': self.adaptor.theme_dir + 'rngs/escape.rng',
311
+ 'permissible_children': function(node,mode) { //{{{
312
+ return [];
313
+ }, //}}}
314
+ 'adaptor': {//{{{
315
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
316
+ 'click': self.events.click,
317
+ 'mouseover': self.events.mouseover,
318
+ 'mouseout': self.events.mouseout
319
+ }//}}}
320
+ }; /*}}}*/
321
+ this.elements.stop = { /*{{{*/
322
+ 'type': 'primitive',
323
+ 'illustrator': {//{{{
324
+ 'endnodes': 'this',
325
+ 'svg': self.adaptor.theme_dir + 'symbols/stop.svg'
326
+ },//}}}
327
+ 'description': self.adaptor.theme_dir + 'rngs/stop.rng',
328
+ 'permissible_children': function(node,mode) { //{{{
329
+ return [];
330
+ }, //}}}
331
+ 'adaptor': {//{{{
332
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
333
+ 'click': self.events.click,
334
+ 'mouseover': self.events.mouseover,
335
+ 'mouseout': self.events.mouseout
336
+ }//}}}
337
+ }; /*}}}*/
338
+ this.elements.terminate = { /*{{{*/
339
+ 'type': 'primitive',
340
+ 'illustrator': {//{{{
341
+ 'endnodes': 'this',
342
+ 'final': true,
343
+ 'svg': self.adaptor.theme_dir + 'symbols/terminate.svg'
344
+ },//}}}
345
+ 'description': self.adaptor.theme_dir + 'rngs/terminate.rng',
346
+ 'permissible_children': function(node,mode) { //{{{
347
+ return [];
348
+ }, //}}}
349
+ 'adaptor': {//{{{
350
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,false); },
351
+ 'mouseover': self.events.mouseover,
352
+ 'mouseout': self.events.mouseout
353
+ }//}}}
354
+ }; /*}}}*/
355
+ this.elements.end = { /*{{{*/
356
+ 'type': 'primitive',
357
+ 'illustrator': {//{{{
358
+ 'endnodes': 'this',
359
+ 'svg': self.adaptor.theme_dir + 'symbols/end.svg'
360
+ }, //}}}
361
+ 'adaptor': {//{{{
362
+ 'mousedown': function (node,e) {
363
+ self.events.suppress();
364
+ }
365
+ }//}}}
366
+ }; /*}}}*/
367
+ this.elements.event_end = { /*{{{*/
368
+ 'type': 'primitive',
369
+ 'illustrator': {//{{{
370
+ 'endnodes': 'this',
371
+ 'svg': self.adaptor.theme_dir + 'symbols/event_end.svg'
372
+ }, //}}}
373
+ 'adaptor': {//{{{
374
+ 'mousedown': function (node,e) {
375
+ self.events.suppress();
376
+ },
377
+ 'click': self.events.click,
378
+ 'dblclick': self.events.dblclick,
379
+ 'mouseover': self.events.mouseover,
380
+ 'mouseout': self.events.mouseout
381
+ }//}}}
382
+ }; /*}}}*/
383
+ this.elements.choose_finish = { /*{{{*/
384
+ 'type': 'primitive',
385
+ 'illustrator': {//{{{
386
+ 'endnodes': 'this',
387
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg',
388
+ 'resolve_symbol': function(node) {
389
+ if($(node).attr('mode') == 'exclusive') {
390
+ return 'choose_exclusive_finish';
391
+ } else {
392
+ return 'choose_inclusive_finish';
393
+ }
394
+ },
395
+ }, //}}}
396
+ 'adaptor': {//{{{
397
+ 'mousedown': function (node,e) {
398
+ self.events.mousedown(node,e,true,true);
399
+ },
400
+ 'click': self.events.click,
401
+ 'dblclick': self.events.dblclick,
402
+ 'mouseover': self.events.mouseover,
403
+ 'mouseout': self.events.mouseout
404
+ }//}}}
405
+ }; /*}}}*/
406
+ this.elements.loop_finish = { /*{{{*/
407
+ 'type': 'primitive',
408
+ 'illustrator': {//{{{
409
+ 'endnodes': 'this',
410
+ 'closeblock': true,
411
+ 'label': function(node){
412
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
413
+ return ret;
414
+ },
415
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg',
416
+ }, //}}}
417
+ 'adaptor': {//{{{
418
+ 'mousedown': function (node,e) {
419
+ self.events.mousedown(node,e,true,true);
420
+ },
421
+ 'click': self.events.click,
422
+ 'dblclick': self.events.dblclick,
423
+ 'mouseover': self.events.mouseover,
424
+ 'mouseout': self.events.mouseout
425
+ }//}}}
426
+ }; /*}}}*/
427
+ this.elements.parallel_finish = { /*{{{*/
428
+ 'type': 'primitive',
429
+ 'illustrator': {//{{{
430
+ 'endnodes': 'this',
431
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
432
+ 'resolve_symbol': function(node) {
433
+ if($(node).attr('wait') == '-1') {
434
+ return 'parallel_simple';
435
+ } else {
436
+ return 'parallel_complex';
437
+ }
438
+ },
439
+ }, //}}}
440
+ 'adaptor': {//{{{
441
+ 'mousedown': function (node,e) {
442
+ self.events.mousedown(node,e,true,true);
443
+ },
444
+ 'click': self.events.click,
445
+ 'dblclick': self.events.dblclick,
446
+ 'mouseover': self.events.mouseover,
447
+ 'mouseout': self.events.mouseout
448
+ }//}}}
449
+ }; /*}}}*/
450
+
451
+ // Complex Elements
452
+ this.elements.choose = { /*{{{*/
453
+ 'type': 'complex',
454
+ 'illustrator': {//{{{
455
+ 'label': function(node){ return [ { column: 'Label', value: $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' } ]; },
456
+ 'endnodes': 'aggregate',
457
+ 'closeblock': false,
458
+ 'closing_symbol': 'choose_finish',
459
+ 'expansion': function(node) {
460
+ return 'horizontal';
461
+ },
462
+ 'resolve_symbol': function(node) {
463
+ if($(node).attr('mode') == 'exclusive') {
464
+ return 'choose_exclusive';
465
+ } else {
466
+ return 'choose_inclusive';
467
+ }
468
+ },
469
+ 'col_shift': function(node) {
470
+ return false;
471
+ },
472
+ 'svg': self.adaptor.theme_dir + 'symbols/choose.svg'
473
+ },//}}}
474
+ 'description': self.adaptor.theme_dir + 'rngs/choose.rng',
475
+ 'permissible_children': function(node,mode) { //{{{
476
+ var func = null;
477
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
478
+ else { func = self.adaptor.description.insert_after }
479
+ if(node.children('parallel_branch').length > 0) {
480
+ return [{'label': 'Parallel Branch',
481
+ 'function_call': func,
482
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
483
+ 'type': 'parallel_branch',
484
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}];
485
+ }
486
+ var childs = [{'label': 'Alternative',
487
+ 'function_call': func,
488
+ 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
489
+ 'type': 'alternative',
490
+ 'params': [self.adaptor.description.elements.alternative, node]}];
491
+ if((node.children('otherwise').length == 0) && node.parents('parallel').length == node.parents('parallel_branch').length && node.parent('choose').length == 0)
492
+ childs.push({'label': 'Otherwise',
493
+ 'function_call': self.adaptor.description.insert_last_into,
494
+ 'menu_icon': self.elements.otherwise.illustrator.svg.clone(),
495
+ 'type': 'otherwise',
496
+ 'params': [self.adaptor.description.elements.otherwise, node]});
497
+ if(node.parents('parallel').length > node.parents('parallel_branch').length)
498
+ childs.push({'label': 'Parallel Branch',
499
+ 'function_call': func,
500
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
501
+ 'type': 'parallel_branch',
502
+ 'params': [self.adaptor.description.elements.parallel_branch, node]});
503
+ return childs;
504
+ }, //}}}
505
+ 'adaptor': {//{{{
506
+ 'mousedown': function (node,e) {
507
+ self.events.mousedown(node,e,true,true);
508
+ },
509
+ 'click': self.events.click,
510
+ 'dblclick': self.events.dblclick,
511
+ 'mouseover': self.events.mouseover,
512
+ 'mouseout': self.events.mouseout
513
+ }//}}}
514
+ }; /*}}}*/
515
+ this.elements.otherwise = { /*{{{*/
516
+ 'type': 'complex',
517
+ 'illustrator': {//{{{
518
+ 'endnodes': 'passthrough',
519
+ 'closeblock': false,
520
+ 'noarrow': true,
521
+ 'expansion': function(node) {
522
+ return 'vertical';
523
+ },
524
+ 'col_shift': function(node) {
525
+ return false;
526
+ },
527
+ 'svg': self.adaptor.theme_dir + 'symbols/otherwise.svg'
528
+ },//}}}
529
+ 'description': self.adaptor.theme_dir + 'rngs/otherwise.rng',
530
+ 'neverdelete': true,
531
+ 'permissible_children': function(node,mode) { //{{{
532
+ var func = null;
533
+ var childs = null;
534
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
535
+ else { func = self.adaptor.description.insert_after }
536
+ var childs = [
537
+ {'label': 'Task with Output Transformation',
538
+ 'function_call': func,
539
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
540
+ 'type': 'callmanipulate',
541
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
542
+ {'label': 'Task',
543
+ 'function_call': func,
544
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
545
+ 'type': 'call',
546
+ 'params': [self.adaptor.description.elements.call, node]},
547
+ {'label': 'Script',
548
+ 'function_call': func,
549
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
550
+ 'type': 'manipulate',
551
+ 'params': [self.adaptor.description.elements.manipulate, node]},
552
+ {'label': 'Parallel',
553
+ 'function_call': func,
554
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
555
+ 'type': 'parallel',
556
+ 'params': [self.adaptor.description.elements.parallel, node]},
557
+ {'label': 'Decision',
558
+ 'function_call': func,
559
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
560
+ 'type': 'choose',
561
+ 'params': [self.adaptor.description.elements.choose, node]},
562
+ {'label': 'Loop',
563
+ 'function_call': func,
564
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
565
+ 'type': 'loop',
566
+ 'params': [self.adaptor.description.elements.loop, node]},
567
+ {'label': 'Terminate',
568
+ 'function_call': func,
569
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
570
+ 'type': 'terminate',
571
+ 'params': [self.adaptor.description.elements.terminate, node]},
572
+ {'label': 'Stop',
573
+ 'function_call': func,
574
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
575
+ 'type': 'stop',
576
+ 'params': [self.adaptor.description.elements.stop, node]}
577
+ ];
578
+ if(node.parent('parallel_branch').length > 0) {
579
+ childs.push({
580
+ 'label': 'Critical',
581
+ 'function_call': func,
582
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
583
+ 'type': 'critical',
584
+ 'params': [self.adaptor.description.elements.critical, node]
585
+ });
586
+ }
587
+ return childs;
588
+ }, //}}}
589
+ 'adaptor': {//{{{
590
+ 'mousedown': function (node,e) {
591
+ self.events.mousedown(node,e,true,false);
592
+ },
593
+ 'click': self.events.click,
594
+ 'dblclick': self.events.dblclick,
595
+ 'mouseover': self.events.mouseover,
596
+ 'mouseout': self.events.mouseout,
597
+ }//}}}
598
+ }; /*}}}*/
599
+ this.elements.alternative = { /*{{{*/
600
+ 'type': 'complex',
601
+ 'illustrator': {//{{{
602
+ 'label': function(node){
603
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
604
+ return ret;
605
+ },
606
+ 'endnodes': 'passthrough',
607
+ 'noarrow': true,
608
+ 'closeblock':false,
609
+ 'expansion': function(node) {
610
+ return 'vertical';
611
+ },
612
+ 'col_shift': function(node) {
613
+ return false;
614
+ },
615
+ 'svg': self.adaptor.theme_dir + 'symbols/alternative.svg'
616
+ },//}}}
617
+ 'description': self.adaptor.theme_dir + 'rngs/alternative.rng',
618
+ 'permissible_children': function(node,mode) { //{{{
619
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
620
+ else { func = self.adaptor.description.insert_after }
621
+ if(node.parents('parallel').length > node.parents('parallel_branch').length && node.get(0).tagName == 'alternative') {
622
+ return [{'label': 'Parallel Branch',
623
+ 'function_call': func,
624
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
625
+ 'type': 'parallel_branch',
626
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}];
627
+ }
628
+ var childs = [
629
+ {'label': 'Task with Output Transformation',
630
+ 'function_call': func,
631
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
632
+ 'type': 'callmanipulate',
633
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
634
+ {'label': 'Task',
635
+ 'function_call': func,
636
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
637
+ 'type': 'call',
638
+ 'params': [self.adaptor.description.elements.call, node]},
639
+ {'label': 'Script',
640
+ 'function_call': func,
641
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
642
+ 'type': 'manipulate',
643
+ 'params': [self.adaptor.description.elements.manipulate, node]},
644
+ {'label': 'Parallel',
645
+ 'function_call': func,
646
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
647
+ 'type': 'parallel',
648
+ 'params': [self.adaptor.description.elements.parallel, node]},
649
+ {'label': 'Decision',
650
+ 'function_call': func,
651
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
652
+ 'type': 'choose',
653
+ 'params': [self.adaptor.description.elements.choose, node]},
654
+ {'label': 'Loop',
655
+ 'function_call': func,
656
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
657
+ 'type': 'loop',
658
+ 'params': [self.adaptor.description.elements.loop, node]},
659
+ {'label': 'Terminate',
660
+ 'function_call': func,
661
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
662
+ 'type': 'terminate',
663
+ 'params': [self.adaptor.description.elements.terminate, node]},
664
+ {'label': 'Stop',
665
+ 'function_call': func,
666
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
667
+ 'type': 'stop',
668
+ 'params': [self.adaptor.description.elements.stop, node]}
669
+ ];
670
+ if(node.parent('parallel_branch').length > 0) {
671
+ childs.push({
672
+ 'label': 'Critical',
673
+ 'function_call': func,
674
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
675
+ 'type': 'critical',
676
+ 'params': [self.adaptor.description.elements.critical, node]
677
+ });
678
+ }
679
+ return childs;
680
+ }, //}}}
681
+ 'adaptor': {//{{{
682
+ 'mousedown': function (node,e) {
683
+ self.events.mousedown(node,e,true,true);
684
+ },
685
+ 'click': self.events.click,
686
+ 'dblclick': self.events.dblclick,
687
+ 'mouseover': self.events.mouseover,
688
+ 'mouseout': self.events.mouseout,
689
+ }//}}}
690
+ }; /*}}}*/
691
+ this.elements.loop = { /*{{{*/
692
+ 'type': 'complex',
693
+ 'illustrator': {//{{{
694
+ 'resolve_symbol': function(node) {
695
+ if($(node).attr('mode') == 'pre_test') {
696
+ return 'loop_head';
697
+ } else {
698
+ return 'loop_tail';
699
+ }
700
+ },
701
+ 'expansion': function(node) {
702
+ return 'vertical';
703
+ },
704
+ 'col_shift': function(node) {
705
+ return true;
706
+ },
707
+ 'svg': self.adaptor.theme_dir + 'symbols/loop.svg'
708
+ },// }}}
709
+ 'description': self.adaptor.theme_dir + 'rngs/loop.rng',
710
+ 'permissible_children': function(node,mode) { //{{{
711
+ var func = null;
712
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
713
+ else { func = self.adaptor.description.insert_after }
714
+ var childs = [
715
+ {'label': 'Task with Output Transformation',
716
+ 'function_call': func,
717
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
718
+ 'type': 'callmanipulate',
719
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
720
+ {'label': 'Task',
721
+ 'function_call': func,
722
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
723
+ 'type': 'call',
724
+ 'params': [self.adaptor.description.elements.call, node]},
725
+ {'label': 'Script',
726
+ 'function_call': func,
727
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
728
+ 'type': 'manipulate',
729
+ 'params': [self.adaptor.description.elements.manipulate, node]},
730
+ {'label': 'Decision',
731
+ 'function_call': func,
732
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
733
+ 'type': 'choose',
734
+ 'params': [self.adaptor.description.elements.choose, node]},
735
+ {'label': 'Loop',
736
+ 'function_call': func,
737
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
738
+ 'type': 'loop',
739
+ 'params': [self.adaptor.description.elements.loop, node]},
740
+ {'label': 'Terminate',
741
+ 'function_call': func,
742
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
743
+ 'type': 'terminate',
744
+ 'params': [self.adaptor.description.elements.terminate, node]},
745
+ {'label': 'Stop',
746
+ 'function_call': func,
747
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
748
+ 'type': 'stop',
749
+ 'params': [self.adaptor.description.elements.stop, node]}
750
+ ];
751
+ if(node.parent('parallel_branch').length > 0) {
752
+ childs.push({
753
+ 'label': 'Critical',
754
+ 'function_call': func,
755
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
756
+ 'type': 'critical',
757
+ 'params': [self.adaptor.description.elements.critical, node]
758
+ });
759
+ }
760
+ if(node.parent('parallel').length > node.parent('parallel_branch').length) {
761
+ childs.push({'label': 'Parallel Branch',
762
+ 'function_call': func,
763
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
764
+ 'type': 'parallel_branch',
765
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}
766
+ );
767
+ } else {
768
+ childs.push({'label': 'Parallel',
769
+ 'function_call': func,
770
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
771
+ 'type': 'parallel',
772
+ 'params': [self.adaptor.description.elements.parallel, node]}
773
+ );
774
+ }
775
+ return childs;
776
+ }, //}}}
777
+ 'adaptor': {//{{{
778
+ 'mousedown': function (node,e) {
779
+ self.events.mousedown(node,e,true,true);
780
+ },
781
+ 'click': self.events.click,
782
+ 'dblclick': self.events.dblclick,
783
+ 'mouseover': self.events.mouseover,
784
+ 'mouseout': self.events.mouseout,
785
+ }//}}}
786
+ }; /*}}}*/
787
+ this.elements.parallel = { /*{{{*/
788
+ 'type': 'complex',
789
+ 'illustrator': {//{{{
790
+ 'endnodes': 'aggregate',
791
+ 'closeblock': false,
792
+ 'closing_symbol': 'parallel_finish',
793
+ 'expansion': function(node) {
794
+ // check if any sibling other than 'parallel_branch' is present
795
+ if($(node).children(':not(parallel_branch)').length > 0) return 'vertical';
796
+ return 'horizontal';
797
+ },
798
+ 'col_shift': function(node) {
799
+ return true;
800
+ },
801
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
802
+ },//}}}
803
+ 'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
804
+ 'permissible_children': function(node,mode) { //{{{
805
+ var func = null;
806
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
807
+ else { func = self.adaptor.description.insert_after }
808
+ var childs = [
809
+ {'label': 'Parallel Branch',
810
+ 'function_call': func,
811
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
812
+ 'type': 'parallel_branch',
813
+ 'params': [self.adaptor.description.elements.parallel_branch, node]},
814
+ ];
815
+ return childs;
816
+ }, //}}}
817
+ 'permissible_children_expert': function(node,mode) { //{{{
818
+ var func = null;
819
+ if (mode.match(/into/)) { func = self.adaptor.description.insert_first_into }
820
+ else { func = self.adaptor.description.insert_after }
821
+ var childs = [
822
+ {'label': 'Task with Output Transformation',
823
+ 'function_call': func,
824
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
825
+ 'type': 'callmanipulate',
826
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
827
+ {'label': 'Task',
828
+ 'function_call': func,
829
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
830
+ 'type': 'call',
831
+ 'params': [self.adaptor.description.elements.call, node]},
832
+ {'label': 'Script',
833
+ 'function_call': func,
834
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
835
+ 'type': 'manipulate',
836
+ 'params': [self.adaptor.description.elements.manipulate, node]},
837
+ {'label': 'Decision',
838
+ 'function_call': func,
839
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
840
+ 'type': 'choose',
841
+ 'params': [self.adaptor.description.elements.choose, node]},
842
+ {'label': 'Loop',
843
+ 'function_call': func,
844
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
845
+ 'type': 'loop',
846
+ 'params': [self.adaptor.description.elements.loop, node]},
847
+ {'label': 'Stop',
848
+ 'function_call': func,
849
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
850
+ 'type': 'stop',
851
+ 'params': [self.adaptor.description.elements.stop, node]}
852
+ ];
853
+ if(node.get(0).tagName != 'parallel')
854
+ childs.push({'label': 'Parallel',
855
+ 'function_call': self.adaptor.description.insert_last_into,
856
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
857
+ 'type': 'parallel',
858
+ 'params': [self.adaptor.description.elements.parallel, node]});
859
+ return childs;
860
+ }, //}}}
861
+ 'adaptor': {//{{{
862
+ 'mousedown': function (node,e) {
863
+ self.events.mousedown(node,e,true,true);
864
+ },
865
+ 'click': self.events.click,
866
+ 'dblclick': self.events.dblclick,
867
+ 'mouseover': self.events.mouseover,
868
+ 'mouseout': self.events.mouseout,
869
+ }//}}}
870
+ }; /*}}}*/
871
+ this.elements.parallel_branch = { /*{{{*/
872
+ 'type': 'complex',
873
+ 'illustrator': {//{{{
874
+ 'endnodes': 'passthrough',
875
+ 'closeblock': false,
876
+ 'noarrow': true,
877
+ 'expansion': function(node) {
878
+ return 'vertical';
879
+ },
880
+ 'resolve_symbol': function(node,shift) {
881
+ if(shift == true) {
882
+ return 'parallel_branch_event';
883
+ } else {
884
+ return 'parallel_branch_normal';
885
+ }
886
+ },
887
+ 'col_shift': function(node) {
888
+ if(node.parentNode.tagName == 'choose') return false;
889
+ if($(node).parents('parallel').first().children(':not(parallel_branch)').length > 0) return true;
890
+ return false;
891
+ },
892
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg'
893
+ },//}}}
894
+ 'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng',
895
+ 'permissible_children': function(node,mode) { //{{{
896
+ var func = null;
897
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
898
+ else { func = self.adaptor.description.insert_after }
899
+ var childs = [
900
+ {'label': 'Task with Output Transformation',
901
+ 'function_call': func,
902
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
903
+ 'type': 'callmanipulate',
904
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
905
+ {'label': 'Task',
906
+ 'function_call': func,
907
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
908
+ 'type': 'call',
909
+ 'params': [self.adaptor.description.elements.call, node]},
910
+ {'label': 'Script',
911
+ 'function_call': func,
912
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
913
+ 'type': 'manipulate',
914
+ 'params': [self.adaptor.description.elements.manipulate, node]},
915
+ {'label': 'Parallel',
916
+ 'function_call': func,
917
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
918
+ 'type': 'parallel',
919
+ 'params': [self.adaptor.description.elements.parallel, node]},
920
+ {'label': 'Decision',
921
+ 'function_call': func,
922
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
923
+ 'type': 'choose',
924
+ 'params': [self.adaptor.description.elements.choose, node]},
925
+ {'label': 'Loop',
926
+ 'function_call': func,
927
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
928
+ 'type': 'loop',
929
+ 'params': [self.adaptor.description.elements.loop, node]},
930
+ {'label': 'Terminate',
931
+ 'function_call': func,
932
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
933
+ 'type': 'terminate',
934
+ 'params': [self.adaptor.description.elements.terminate, node]},
935
+ {'label': 'Stop',
936
+ 'function_call': func,
937
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
938
+ 'type': 'stop',
939
+ 'params': [self.adaptor.description.elements.stop, node]},
940
+ {'label': 'Critical',
941
+ 'function_call': func,
942
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
943
+ 'type': 'critical',
944
+ 'params': [self.adaptor.description.elements.critical, node]}
945
+ ];
946
+ if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') {
947
+ return [{'label': 'Alternative',
948
+ 'function_call': func,
949
+ 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
950
+ 'type': 'alternative',
951
+ 'params': [self.adaptor.description.elements.alternative, node]}];
952
+ }
953
+ return childs;
954
+ }, //}}}
955
+ 'adaptor': {//{{{
956
+ 'mousedown': function (node,e) {
957
+ self.events.mousedown(node,e,true,true);
958
+ },
959
+ 'click': self.events.click,
960
+ 'dblclick': self.events.dblclick,
961
+ 'mouseover': self.events.mouseover,
962
+ 'mouseout': self.events.mouseout,
963
+ }//}}}
964
+ }; /*}}}*/
965
+ this.elements.critical = { /*{{{*/
966
+ 'type': 'complex',
967
+ 'illustrator': {//{{{
968
+ 'endnodes': 'aggregate',
969
+ 'closeblock': false,
970
+ 'border': true,
971
+ 'expansion': function(node) {
972
+ return 'vertical';
973
+ },
974
+ 'col_shift': function(node) {
975
+ return true;
976
+ },
977
+ 'svg': self.adaptor.theme_dir + 'symbols/critical.svg'
978
+ },//}}}
979
+ 'description': self.adaptor.theme_dir + 'rngs/critical.rng',
980
+ 'permissible_children': function(node,mode) { //{{{
981
+ var func = null;
982
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
983
+ else { func = self.adaptor.description.insert_after }
984
+ var childs = [
985
+ {'label': 'Task with Output Transformation',
986
+ 'function_call': func,
987
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
988
+ 'type': 'callmanipulate',
989
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
990
+ {'label': 'Task',
991
+ 'function_call': func,
992
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
993
+ 'type': 'call',
994
+ 'params': [self.adaptor.description.elements.call, node]},
995
+ {'label': 'Script',
996
+ 'function_call': func,
997
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
998
+ 'type': 'manipulate',
999
+ 'params': [self.adaptor.description.elements.manipulate, node]},
1000
+ {'label': 'Parallel',
1001
+ 'function_call': func,
1002
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1003
+ 'type': 'parallel',
1004
+ 'params': [self.adaptor.description.elements.parallel, node]},
1005
+ {'label': 'Decision',
1006
+ 'function_call': func,
1007
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1008
+ 'type': 'choose',
1009
+ 'params': [self.adaptor.description.elements.choose, node]},
1010
+ {'label': 'Loop',
1011
+ 'function_call': func,
1012
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1013
+ 'type': 'loop',
1014
+ 'params': [self.adaptor.description.elements.loop, node]},
1015
+ {'label': 'Terminate',
1016
+ 'function_call': func,
1017
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
1018
+ 'type': 'terminate',
1019
+ 'params': [self.adaptor.description.elements.terminate, node]},
1020
+ {'label': 'Stop',
1021
+ 'function_call': func,
1022
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1023
+ 'type': 'stop',
1024
+ 'params': [self.adaptor.description.elements.stop, node]}
1025
+ ];
1026
+ if(node.parent('parallel_branch').length > 0) {
1027
+ childs.push({
1028
+ 'label': 'Critical',
1029
+ 'function_call': func,
1030
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1031
+ 'type': 'critical',
1032
+ 'params': [self.adaptor.description.elements.critical, node]
1033
+ });
1034
+ }
1035
+ return childs;
1036
+ }, //}}}
1037
+ 'adaptor': {//{{{
1038
+ 'mousedown': function (node,e) {
1039
+ self.events.mousedown(node,e,true,true);
1040
+ },
1041
+ 'click': self.events.click,
1042
+ 'dblclick': self.events.dblclick,
1043
+ 'mouseover': self.events.mouseover,
1044
+ 'mouseout': self.events.mouseout,
1045
+ }//}}}
1046
+ }; /*}}}*/
1047
+ this.elements.group = { /*{{{*/
1048
+ 'type': 'complex',
1049
+ 'illustrator': {//{{{
1050
+ 'endnodes': 'aggregate',
1051
+ 'closeblock': false,
1052
+ 'border': 'injectiongroup', // other value than true,false inidcates the used class for the svg-object
1053
+ 'expansion': function(node) {
1054
+ return 'vertical';
1055
+ },
1056
+ 'col_shift': function(node) {
1057
+ return true;
1058
+ },
1059
+ 'svg': null
1060
+ },//}}}
1061
+ 'description': self.adaptor.theme_dir + 'rngs/group.rng',
1062
+ 'permissible_children': function(node,mode) { //{{{
1063
+ var func = null;
1064
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1065
+ else { func = self.adaptor.description.insert_after }
1066
+ return [
1067
+ ];
1068
+ }, //}}}
1069
+ 'adaptor': {//{{{
1070
+ 'mousedown': function (node,e) {
1071
+ self.events.mousedown(node,e,true,true);
1072
+ },
1073
+ 'click': self.events.click,
1074
+ 'dblclick': self.events.dblclick,
1075
+ 'mouseover': self.events.mouseover,
1076
+ 'mouseout': self.events.mouseout,
1077
+ }//}}}
1078
+ }; /*}}}*/
1079
+ this.elements.start = this.elements.description = { /*{{{*/
1080
+ 'type': 'description',
1081
+ 'illustrator': {//{{{
1082
+ 'endnodes': 'passthrough',
1083
+ 'closeblock': false,
1084
+ 'balance': true,
1085
+ 'expansion': function(node) {
1086
+ return 'vertical';
1087
+ },
1088
+ 'closing_symbol': 'end',
1089
+ 'col_shift': function(node) {
1090
+ return true;
1091
+ },
1092
+ 'svg': self.adaptor.theme_dir + 'symbols/start.svg'
1093
+ },//}}}
1094
+ 'description': null,
1095
+ 'permissible_children': function(node,mode) { //{{{
1096
+ var func = null;
1097
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1098
+ else { func = self.adaptor.description.insert_after }
1099
+ var childs = [
1100
+ {'label': 'Task with Output Transformation',
1101
+ 'function_call': func,
1102
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1103
+ 'type': 'callmanipulate',
1104
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
1105
+ {'label': 'Task',
1106
+ 'function_call': func,
1107
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
1108
+ 'type': 'call',
1109
+ 'params': [self.adaptor.description.elements.call, node]},
1110
+ {'label': 'Script',
1111
+ 'function_call': func,
1112
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1113
+ 'type': 'manipulate',
1114
+ 'params': [self.adaptor.description.elements.manipulate, node]},
1115
+ {'label': 'Parallel',
1116
+ 'function_call': func,
1117
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1118
+ 'type': 'parallel',
1119
+ 'params': [self.adaptor.description.elements.parallel, node]},
1120
+ {'label': 'Decision',
1121
+ 'function_call': func,
1122
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1123
+ 'type': 'choose',
1124
+ 'params': [self.adaptor.description.elements.choose, node]},
1125
+ {'label': 'Loop',
1126
+ 'function_call': func,
1127
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1128
+ 'type': 'loop',
1129
+ 'params': [self.adaptor.description.elements.loop, node]},
1130
+ {'label': 'Stop',
1131
+ 'function_call': func,
1132
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1133
+ 'type': 'stop',
1134
+ 'params': [self.adaptor.description.elements.stop, node]}
1135
+ ];
1136
+ if(node.parent('parallel_branch').length > 0) {
1137
+ childs.push({
1138
+ 'label': 'Critical',
1139
+ 'function_call': func,
1140
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1141
+ 'type': 'critical',
1142
+ 'params': [self.adaptor.description.elements.critical, node]
1143
+ });
1144
+ }
1145
+ return childs;
1146
+ }, //}}}
1147
+ 'adaptor': {//{{{
1148
+ 'mousedown': function (node,e) {
1149
+ self.events.mousedown(node,e,true,false);
1150
+ },
1151
+ 'click': self.events.click,
1152
+ 'dblclick': self.events.dblclick,
1153
+ 'mouseover': self.events.mouseover,
1154
+ 'mouseout': self.events.mouseout,
1155
+ }//}}}
1156
+ }; /*}}}*/
1157
+
1158
+ // Abstract Elements
1159
+ // * they may only have an illustrator (or other parts)
1160
+ // * they HAVE TO have a parent
1161
+ this.elements.callmanipulate = { /*{{{*/
1162
+ 'parent': 'call',
1163
+ 'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1164
+ 'illustrator': {//{{{
1165
+ 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
1166
+ 'svg': self.adaptor.theme_dir + 'symbols/callmanipulate.svg'
1167
+ },//}}}
1168
+ }; /*}}}*/
1169
+ this.elements.loop_head = { /*{{{*/
1170
+ 'parent': 'loop',
1171
+ 'illustrator': {//{{{
1172
+ 'endnodes': 'this',
1173
+ 'closeblock': true,
1174
+ 'label': function(node){
1175
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
1176
+ return ret;
1177
+ },
1178
+ }//}}}
1179
+ }; /*}}}*/
1180
+ this.elements.loop_tail = { /*{{{*/
1181
+ 'parent': 'loop',
1182
+ 'illustrator': {//{{{
1183
+ 'endnodes': 'aggregate',
1184
+ 'closeblock': false,
1185
+ 'closing_symbol': 'loop_finish'
1186
+ },//}}}
1187
+ }; /*}}}*/
1188
+ this.elements.choose_inclusive = { /*{{{*/
1189
+ 'parent': 'choose',
1190
+ 'illustrator': {//{{{
1191
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1192
+ }//}}}
1193
+ }; /*}}}*/
1194
+ this.elements.choose_exclusive = { /*{{{*/
1195
+ 'parent': 'choose',
1196
+ 'illustrator': {//{{{
1197
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1198
+ },//}}}
1199
+ }; /*}}}*/
1200
+ this.elements.choose_inclusive_finish = { /*{{{*/
1201
+ 'parent': 'choose_finish',
1202
+ 'illustrator': {//{{{
1203
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1204
+ }//}}}
1205
+ }; /*}}}*/
1206
+ this.elements.choose_exclusive_finish = { /*{{{*/
1207
+ 'parent': 'choose_finish',
1208
+ 'illustrator': {//{{{
1209
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1210
+ },//}}}
1211
+ }; /*}}}*/
1212
+ this.elements.loop_head_finish = { /*{{{*/
1213
+ 'parent': 'loop_finish',
1214
+ 'illustrator': {//{{{
1215
+ 'endnodes': 'this',
1216
+ 'closeblock': true,
1217
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1218
+ }//}}}
1219
+ }; /*}}}*/
1220
+ this.elements.loop_tail_finish = { /*{{{*/
1221
+ 'parent': 'loop_finish',
1222
+ 'illustrator': {//{{{
1223
+ 'endnodes': 'this',
1224
+ 'closeblock': false,
1225
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1226
+ },//}}}
1227
+ }; /*}}}*/
1228
+ this.elements.parallel_simple = { /*{{{*/
1229
+ 'parent': 'parallel_finish',
1230
+ 'illustrator': {//{{{
1231
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
1232
+ }//}}}
1233
+ }; /*}}}*/
1234
+ this.elements.parallel_complex = { /*{{{*/
1235
+ 'parent': 'parallel_finish',
1236
+ 'illustrator': {//{{{
1237
+ 'svg': self.adaptor.theme_dir + 'symbols/complex.svg'
1238
+ },//}}}
1239
+ }; /*}}}*/
1240
+ this.elements.parallel_branch_normal = { /*{{{*/
1241
+ 'parent': 'parallel_branch',
1242
+ 'illustrator': {//{{{
1243
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_normal.svg'
1244
+ }//}}}
1245
+ }; /*}}}*/
1246
+ this.elements.parallel_branch_event = { /*{{{*/
1247
+ 'parent': 'parallel_branch',
1248
+ 'illustrator': {//{{{
1249
+ 'endnodes': 'this',
1250
+ 'noarrow': false,
1251
+ 'border': true,
1252
+ 'wide': true,
1253
+ 'closing_symbol': 'event_end',
1254
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_event.svg'
1255
+ }//}}}
1256
+ }; /*}}}*/
1257
+ this.elements.parallel_branch_compact = { /*{{{*/
1258
+ 'parent': 'parallel_branch',
1259
+ 'illustrator': {//{{{
1260
+ 'endnodes': 'this',
1261
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_compact.svg'
1262
+ }//}}}
1263
+ }; /*}}}*/
1264
+ this.elements.scripts = { /*{{{*/
1265
+ 'description': [self.adaptor.theme_dir + 'rngs/scripts.rng']
1266
+ }; /*}}}*/
1267
+ }