cpee 2.1.91 → 2.1.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (566) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +7 -0
  3. data/cockpit/css/llm.css +1 -1
  4. data/cockpit/css/resources-label.css +1 -1
  5. data/cockpit/css/ui.css +6 -6
  6. data/cockpit/css/wfadaptor.css +103 -189
  7. data/cockpit/edit.html +2 -2
  8. data/cockpit/index.html +3 -2
  9. data/cockpit/js/details.js +11 -1
  10. data/cockpit/js/instance.js +54 -31
  11. data/cockpit/js/wfadaptor.js +604 -140
  12. data/cockpit/llm.html +2 -2
  13. data/cockpit/llm_alternative.html +2 -2
  14. data/cockpit/model.html +1 -1
  15. data/cockpit/only_llm.html +5 -7
  16. data/cockpit/templates/Frames.xml +142 -55
  17. data/cockpit/themes/base.js +226 -130
  18. data/cockpit/themes/control/rngs/call.rng +14 -0
  19. data/cockpit/themes/control/rngs/callmanipulate.rng +18 -1
  20. data/cockpit/themes/control/rngs/choose.rng +4 -1
  21. data/cockpit/themes/control/rngs/manipulate.rng +15 -1
  22. data/cockpit/themes/control/rngs/start.rng +133 -119
  23. data/cockpit/themes/control/rngs/wait_for_signal.rng +8 -0
  24. data/cockpit/themes/control/symbols/alternative.svg +13 -3
  25. data/cockpit/themes/control/symbols/arrow.svg +1 -1
  26. data/cockpit/themes/control/symbols/call.svg +15 -2
  27. data/cockpit/themes/control/symbols/call_sensor.svg +19 -5
  28. data/cockpit/themes/control/symbols/callmanipulate.svg +19 -4
  29. data/cockpit/themes/control/symbols/callmanipulate_sensor.svg +22 -7
  30. data/cockpit/themes/control/symbols/callmanipulate_sensor_signal.svg +32 -0
  31. data/cockpit/themes/control/symbols/callmanipulate_signal.svg +29 -0
  32. data/cockpit/themes/control/symbols/choose.svg +13 -3
  33. data/cockpit/themes/control/symbols/choose_exclusive.svg +13 -3
  34. data/cockpit/themes/{compact/symbols/choose.svg → control/symbols/choose_exclusive_finish.svg} +1 -1
  35. data/cockpit/themes/control/symbols/choose_inclusive.svg +11 -2
  36. data/cockpit/themes/{compact/symbols/choose_inclusive.svg → control/symbols/choose_inclusive_finish.svg} +1 -1
  37. data/cockpit/themes/control/symbols/closed_loop.svg +1 -1
  38. data/cockpit/themes/control/symbols/closed_loop_cancel.svg +2 -2
  39. data/cockpit/themes/control/symbols/closed_loop_control.svg +2 -2
  40. data/cockpit/themes/control/symbols/closed_loop_measuring.svg +2 -2
  41. data/cockpit/themes/control/symbols/complex.svg +1 -1
  42. data/cockpit/themes/control/symbols/critical.svg +3 -2
  43. data/cockpit/themes/control/symbols/delete.svg +2 -2
  44. data/cockpit/themes/control/symbols/end.svg +1 -1
  45. data/cockpit/themes/control/symbols/escape.svg +2 -2
  46. data/cockpit/themes/control/symbols/event_end.svg +1 -1
  47. data/cockpit/themes/control/symbols/loop.svg +13 -3
  48. data/cockpit/themes/control/symbols/loop_end.svg +15 -0
  49. data/cockpit/themes/control/symbols/manipulate.svg +17 -2
  50. data/cockpit/themes/control/symbols/otherwise.svg +3 -3
  51. data/cockpit/themes/control/symbols/parallel.svg +3 -2
  52. data/cockpit/themes/control/symbols/parallel_branch.svg +3 -3
  53. data/cockpit/themes/control/symbols/parallel_branch_event.svg +4 -4
  54. data/cockpit/themes/control/symbols/parallel_branch_normal.svg +3 -3
  55. data/cockpit/themes/control/symbols/parallel_eventbased_exclusive.svg +4 -4
  56. data/cockpit/themes/control/symbols/parallel_eventbased_parallel.svg +3 -3
  57. data/cockpit/themes/control/symbols/scripts.svg +2 -2
  58. data/cockpit/themes/control/symbols/start.svg +1 -1
  59. data/cockpit/themes/control/symbols/start_event.svg +1 -1
  60. data/cockpit/themes/control/symbols/stop.svg +1 -1
  61. data/cockpit/themes/control/symbols/wait_for_signal.svg +21 -0
  62. data/cockpit/themes/control/theme.js +95 -95
  63. data/cockpit/themes/dataflow/rngs/call.rng +14 -0
  64. data/cockpit/themes/dataflow/rngs/callmanipulate.rng +18 -1
  65. data/cockpit/themes/dataflow/rngs/choose.rng +4 -1
  66. data/cockpit/themes/dataflow/rngs/manipulate.rng +15 -1
  67. data/cockpit/themes/dataflow/rngs/start.rng +133 -119
  68. data/cockpit/themes/dataflow/rngs/wait_for_signal.rng +8 -0
  69. data/cockpit/themes/dataflow/symbols/alternative.svg +13 -3
  70. data/cockpit/themes/dataflow/symbols/arrow.svg +1 -1
  71. data/cockpit/themes/dataflow/symbols/call.svg +15 -2
  72. data/cockpit/themes/dataflow/symbols/call_sensor.svg +19 -5
  73. data/cockpit/themes/dataflow/symbols/callmanipulate.svg +19 -4
  74. data/cockpit/themes/dataflow/symbols/callmanipulate_sensor.svg +22 -7
  75. data/cockpit/themes/dataflow/symbols/callmanipulate_sensor_signal.svg +32 -0
  76. data/cockpit/themes/dataflow/symbols/callmanipulate_signal.svg +29 -0
  77. data/cockpit/themes/dataflow/symbols/choose.svg +13 -3
  78. data/cockpit/themes/dataflow/symbols/choose_exclusive.svg +13 -3
  79. data/cockpit/themes/{compact/symbols/choose_exclusive.svg → dataflow/symbols/choose_exclusive_finish.svg} +1 -1
  80. data/cockpit/themes/dataflow/symbols/choose_inclusive.svg +11 -2
  81. data/cockpit/themes/{compact/symbols/parallel.svg → dataflow/symbols/choose_inclusive_finish.svg} +2 -3
  82. data/cockpit/themes/dataflow/symbols/closed_loop.svg +1 -1
  83. data/cockpit/themes/dataflow/symbols/closed_loop_cancel.svg +2 -2
  84. data/cockpit/themes/dataflow/symbols/closed_loop_control.svg +2 -2
  85. data/cockpit/themes/dataflow/symbols/closed_loop_measuring.svg +2 -2
  86. data/cockpit/themes/dataflow/symbols/complex.svg +1 -1
  87. data/cockpit/themes/dataflow/symbols/critical.svg +3 -2
  88. data/cockpit/themes/dataflow/symbols/delete.svg +2 -2
  89. data/cockpit/themes/dataflow/symbols/end.svg +1 -1
  90. data/cockpit/themes/dataflow/symbols/escape.svg +2 -2
  91. data/cockpit/themes/dataflow/symbols/event_end.svg +1 -1
  92. data/cockpit/themes/dataflow/symbols/loop.svg +13 -3
  93. data/cockpit/themes/dataflow/symbols/loop_end.svg +15 -0
  94. data/cockpit/themes/dataflow/symbols/manipulate.svg +17 -2
  95. data/cockpit/themes/dataflow/symbols/otherwise.svg +3 -3
  96. data/cockpit/themes/dataflow/symbols/parallel.svg +3 -2
  97. data/cockpit/themes/dataflow/symbols/parallel_branch.svg +3 -3
  98. data/cockpit/themes/dataflow/symbols/parallel_branch_event.svg +4 -4
  99. data/cockpit/themes/dataflow/symbols/parallel_branch_normal.svg +3 -3
  100. data/cockpit/themes/dataflow/symbols/parallel_eventbased_exclusive.svg +4 -4
  101. data/cockpit/themes/dataflow/symbols/parallel_eventbased_parallel.svg +3 -3
  102. data/cockpit/themes/dataflow/symbols/scripts.svg +2 -2
  103. data/cockpit/themes/dataflow/symbols/start.svg +1 -1
  104. data/cockpit/themes/dataflow/symbols/start_event.svg +1 -1
  105. data/cockpit/themes/dataflow/symbols/stop.svg +1 -1
  106. data/cockpit/themes/dataflow/symbols/wait_for_signal.svg +21 -0
  107. data/cockpit/themes/dataflow/theme.js +9 -6
  108. data/cockpit/themes/default/rngs/call.rng +14 -0
  109. data/cockpit/themes/default/rngs/callmanipulate.rng +18 -1
  110. data/cockpit/themes/default/rngs/choose.rng +4 -1
  111. data/cockpit/themes/default/rngs/manipulate.rng +15 -1
  112. data/cockpit/themes/default/rngs/start.rng +133 -119
  113. data/cockpit/themes/default/rngs/wait_for_signal.rng +8 -0
  114. data/cockpit/themes/default/symbols/alternative.svg +13 -3
  115. data/cockpit/themes/default/symbols/arrow.svg +1 -1
  116. data/cockpit/themes/default/symbols/call.svg +15 -2
  117. data/cockpit/themes/default/symbols/call_sensor.svg +19 -5
  118. data/cockpit/themes/default/symbols/callmanipulate.svg +19 -4
  119. data/cockpit/themes/default/symbols/callmanipulate_sensor.svg +22 -7
  120. data/cockpit/themes/default/symbols/callmanipulate_sensor_signal.svg +32 -0
  121. data/cockpit/themes/default/symbols/callmanipulate_signal.svg +29 -0
  122. data/cockpit/themes/default/symbols/choose.svg +13 -3
  123. data/cockpit/themes/default/symbols/choose_exclusive.svg +13 -3
  124. data/cockpit/themes/{compact/symbols/loop.svg → default/symbols/choose_exclusive_finish.svg} +1 -1
  125. data/cockpit/themes/default/symbols/choose_inclusive.svg +11 -2
  126. data/cockpit/themes/{compact/symbols/parallel_branch_compact.svg → default/symbols/choose_inclusive_finish.svg} +2 -2
  127. data/cockpit/themes/default/symbols/closed_loop.svg +1 -1
  128. data/cockpit/themes/default/symbols/closed_loop_cancel.svg +2 -2
  129. data/cockpit/themes/default/symbols/closed_loop_control.svg +2 -2
  130. data/cockpit/themes/default/symbols/closed_loop_measuring.svg +2 -2
  131. data/cockpit/themes/default/symbols/complex.svg +1 -1
  132. data/cockpit/themes/default/symbols/critical.svg +3 -2
  133. data/cockpit/themes/default/symbols/delete.svg +2 -2
  134. data/cockpit/themes/default/symbols/end.svg +1 -1
  135. data/cockpit/themes/default/symbols/escape.svg +2 -2
  136. data/cockpit/themes/default/symbols/event_end.svg +1 -1
  137. data/cockpit/themes/default/symbols/loop.svg +13 -3
  138. data/cockpit/themes/default/symbols/loop_end.svg +15 -0
  139. data/cockpit/themes/default/symbols/manipulate.svg +17 -2
  140. data/cockpit/themes/default/symbols/otherwise.svg +3 -3
  141. data/cockpit/themes/default/symbols/parallel.svg +3 -2
  142. data/cockpit/themes/default/symbols/parallel_branch.svg +3 -3
  143. data/cockpit/themes/default/symbols/parallel_branch_event.svg +4 -4
  144. data/cockpit/themes/default/symbols/parallel_branch_normal.svg +3 -3
  145. data/cockpit/themes/default/symbols/parallel_eventbased_exclusive.svg +4 -4
  146. data/cockpit/themes/default/symbols/parallel_eventbased_parallel.svg +3 -3
  147. data/cockpit/themes/default/symbols/scripts.svg +2 -2
  148. data/cockpit/themes/default/symbols/start.svg +1 -1
  149. data/cockpit/themes/default/symbols/start_event.svg +1 -1
  150. data/cockpit/themes/default/symbols/stop.svg +1 -1
  151. data/cockpit/themes/default/symbols/wait_for_signal.svg +21 -0
  152. data/cockpit/themes/default/theme.js +7 -1
  153. data/cockpit/themes/extended/rngs/call.rng +14 -0
  154. data/cockpit/themes/extended/rngs/callmanipulate.rng +18 -1
  155. data/cockpit/themes/extended/rngs/choose.rng +4 -1
  156. data/cockpit/themes/extended/rngs/manipulate.rng +15 -1
  157. data/cockpit/themes/extended/rngs/start.rng +133 -119
  158. data/cockpit/themes/extended/rngs/wait_for_signal.rng +8 -0
  159. data/cockpit/themes/extended/symbols/alternative.svg +13 -3
  160. data/cockpit/themes/extended/symbols/arrow.svg +1 -1
  161. data/cockpit/themes/extended/symbols/call.svg +15 -2
  162. data/cockpit/themes/extended/symbols/call_sensor.svg +19 -5
  163. data/cockpit/themes/extended/symbols/callmanipulate.svg +19 -4
  164. data/cockpit/themes/extended/symbols/callmanipulate_sensor.svg +22 -7
  165. data/cockpit/themes/extended/symbols/callmanipulate_sensor_signal.svg +32 -0
  166. data/cockpit/themes/extended/symbols/callmanipulate_signal.svg +29 -0
  167. data/cockpit/themes/extended/symbols/choose.svg +13 -3
  168. data/cockpit/themes/extended/symbols/choose_exclusive.svg +13 -3
  169. data/cockpit/themes/extended/symbols/choose_exclusive_finish.svg +5 -0
  170. data/cockpit/themes/extended/symbols/choose_inclusive.svg +11 -2
  171. data/cockpit/themes/{control/symbols/parallel_branch_compact.svg → extended/symbols/choose_inclusive_finish.svg} +2 -2
  172. data/cockpit/themes/extended/symbols/closed_loop.svg +1 -1
  173. data/cockpit/themes/extended/symbols/closed_loop_cancel.svg +2 -2
  174. data/cockpit/themes/extended/symbols/closed_loop_control.svg +2 -2
  175. data/cockpit/themes/extended/symbols/closed_loop_measuring.svg +2 -2
  176. data/cockpit/themes/extended/symbols/complex.svg +1 -1
  177. data/cockpit/themes/extended/symbols/critical.svg +3 -2
  178. data/cockpit/themes/extended/symbols/delete.svg +2 -2
  179. data/cockpit/themes/extended/symbols/end.svg +1 -1
  180. data/cockpit/themes/extended/symbols/escape.svg +2 -2
  181. data/cockpit/themes/extended/symbols/event_end.svg +1 -1
  182. data/cockpit/themes/extended/symbols/loop.svg +13 -3
  183. data/cockpit/themes/extended/symbols/loop_end.svg +15 -0
  184. data/cockpit/themes/extended/symbols/manipulate.svg +17 -2
  185. data/cockpit/themes/extended/symbols/otherwise.svg +3 -3
  186. data/cockpit/themes/extended/symbols/parallel.svg +3 -2
  187. data/cockpit/themes/extended/symbols/parallel_branch.svg +3 -3
  188. data/cockpit/themes/extended/symbols/parallel_branch_event.svg +4 -4
  189. data/cockpit/themes/extended/symbols/parallel_branch_normal.svg +3 -3
  190. data/cockpit/themes/extended/symbols/parallel_eventbased_exclusive.svg +4 -4
  191. data/cockpit/themes/extended/symbols/parallel_eventbased_parallel.svg +3 -3
  192. data/cockpit/themes/extended/symbols/scripts.svg +2 -2
  193. data/cockpit/themes/extended/symbols/start.svg +1 -1
  194. data/cockpit/themes/extended/symbols/start_event.svg +1 -1
  195. data/cockpit/themes/extended/symbols/stop.svg +1 -1
  196. data/cockpit/themes/extended/symbols/wait_for_signal.svg +21 -0
  197. data/cockpit/themes/extended/theme.js +3 -0
  198. data/cockpit/themes/felix/symbols/alternative.svg +13 -3
  199. data/cockpit/themes/felix/symbols/arrow.svg +1 -1
  200. data/cockpit/themes/felix/symbols/call.svg +15 -2
  201. data/cockpit/themes/felix/symbols/call_sensor.svg +19 -5
  202. data/cockpit/themes/felix/symbols/callmanipulate.svg +19 -4
  203. data/cockpit/themes/felix/symbols/callmanipulate_sensor.svg +22 -7
  204. data/cockpit/themes/felix/symbols/callmanipulate_sensor_signal.svg +32 -0
  205. data/cockpit/themes/felix/symbols/callmanipulate_signal.svg +29 -0
  206. data/cockpit/themes/felix/symbols/choose.svg +13 -3
  207. data/cockpit/themes/felix/symbols/choose_exclusive.svg +13 -3
  208. data/cockpit/themes/felix/symbols/choose_exclusive_finish.svg +5 -0
  209. data/cockpit/themes/felix/symbols/choose_inclusive.svg +11 -2
  210. data/cockpit/themes/felix/symbols/choose_inclusive_finish.svg +4 -0
  211. data/cockpit/themes/felix/symbols/closed_loop.svg +1 -1
  212. data/cockpit/themes/felix/symbols/closed_loop_cancel.svg +2 -2
  213. data/cockpit/themes/felix/symbols/closed_loop_control.svg +2 -2
  214. data/cockpit/themes/felix/symbols/closed_loop_measuring.svg +2 -2
  215. data/cockpit/themes/felix/symbols/complex.svg +1 -1
  216. data/cockpit/themes/felix/symbols/critical.svg +3 -2
  217. data/cockpit/themes/felix/symbols/delete.svg +2 -2
  218. data/cockpit/themes/felix/symbols/end.svg +1 -1
  219. data/cockpit/themes/felix/symbols/escape.svg +2 -2
  220. data/cockpit/themes/felix/symbols/event_end.svg +1 -1
  221. data/cockpit/themes/felix/symbols/loop.svg +13 -3
  222. data/cockpit/themes/felix/symbols/loop_end.svg +15 -0
  223. data/cockpit/themes/felix/symbols/manipulate.svg +17 -2
  224. data/cockpit/themes/felix/symbols/otherwise.svg +3 -3
  225. data/cockpit/themes/felix/symbols/parallel.svg +3 -2
  226. data/cockpit/themes/felix/symbols/parallel_branch.svg +3 -3
  227. data/cockpit/themes/felix/symbols/parallel_branch_event.svg +4 -4
  228. data/cockpit/themes/felix/symbols/parallel_branch_normal.svg +3 -3
  229. data/cockpit/themes/felix/symbols/parallel_eventbased_exclusive.svg +4 -4
  230. data/cockpit/themes/felix/symbols/parallel_eventbased_parallel.svg +3 -3
  231. data/cockpit/themes/felix/symbols/scripts.svg +2 -2
  232. data/cockpit/themes/felix/symbols/start.svg +1 -1
  233. data/cockpit/themes/felix/symbols/start_event.svg +1 -1
  234. data/cockpit/themes/felix/symbols/stop.svg +1 -1
  235. data/cockpit/themes/felix/symbols/wait_for_signal.svg +21 -0
  236. data/cockpit/themes/model/symbols/alternative.svg +13 -3
  237. data/cockpit/themes/model/symbols/arrow.svg +1 -1
  238. data/cockpit/themes/model/symbols/call.svg +15 -2
  239. data/cockpit/themes/model/symbols/call_sensor.svg +19 -5
  240. data/cockpit/themes/model/symbols/callmanipulate.svg +19 -4
  241. data/cockpit/themes/model/symbols/callmanipulate_sensor.svg +22 -7
  242. data/cockpit/themes/model/symbols/callmanipulate_sensor_signal.svg +32 -0
  243. data/cockpit/themes/model/symbols/callmanipulate_signal.svg +29 -0
  244. data/cockpit/themes/model/symbols/choose.svg +13 -3
  245. data/cockpit/themes/model/symbols/choose_exclusive.svg +13 -3
  246. data/cockpit/themes/model/symbols/choose_exclusive_finish.svg +5 -0
  247. data/cockpit/themes/model/symbols/choose_inclusive.svg +11 -2
  248. data/cockpit/themes/model/symbols/choose_inclusive_finish.svg +4 -0
  249. data/cockpit/themes/model/symbols/closed_loop.svg +1 -1
  250. data/cockpit/themes/model/symbols/closed_loop_cancel.svg +2 -2
  251. data/cockpit/themes/model/symbols/closed_loop_control.svg +2 -2
  252. data/cockpit/themes/model/symbols/closed_loop_measuring.svg +2 -2
  253. data/cockpit/themes/model/symbols/complex.svg +1 -1
  254. data/cockpit/themes/model/symbols/critical.svg +3 -2
  255. data/cockpit/themes/model/symbols/delete.svg +2 -2
  256. data/cockpit/themes/model/symbols/end.svg +1 -1
  257. data/cockpit/themes/model/symbols/escape.svg +2 -2
  258. data/cockpit/themes/model/symbols/event_end.svg +1 -1
  259. data/cockpit/themes/model/symbols/loop.svg +13 -3
  260. data/cockpit/themes/model/symbols/loop_end.svg +15 -0
  261. data/cockpit/themes/model/symbols/manipulate.svg +17 -2
  262. data/cockpit/themes/model/symbols/otherwise.svg +3 -3
  263. data/cockpit/themes/model/symbols/parallel.svg +3 -2
  264. data/cockpit/themes/model/symbols/parallel_branch.svg +3 -3
  265. data/cockpit/themes/model/symbols/parallel_branch_event.svg +4 -4
  266. data/cockpit/themes/model/symbols/parallel_branch_normal.svg +3 -3
  267. data/cockpit/themes/model/symbols/parallel_eventbased_exclusive.svg +4 -4
  268. data/cockpit/themes/model/symbols/parallel_eventbased_parallel.svg +3 -3
  269. data/cockpit/themes/model/symbols/scripts.svg +2 -2
  270. data/cockpit/themes/model/symbols/start.svg +1 -1
  271. data/cockpit/themes/model/symbols/start_event.svg +1 -1
  272. data/cockpit/themes/model/symbols/stop.svg +1 -1
  273. data/cockpit/themes/model/symbols/wait_for_signal.svg +21 -0
  274. data/cockpit/themes/model/theme.js +68 -68
  275. data/cockpit/themes/packed/rngs/call.rng +14 -0
  276. data/cockpit/themes/packed/rngs/callmanipulate.rng +18 -1
  277. data/cockpit/themes/packed/rngs/choose.rng +4 -1
  278. data/cockpit/themes/packed/rngs/manipulate.rng +15 -1
  279. data/cockpit/themes/packed/rngs/start.rng +133 -119
  280. data/cockpit/themes/packed/rngs/wait_for_signal.rng +8 -0
  281. data/cockpit/themes/packed/symbols/alternative.svg +13 -3
  282. data/cockpit/themes/packed/symbols/arrow.svg +1 -1
  283. data/cockpit/themes/packed/symbols/call.svg +15 -2
  284. data/cockpit/themes/packed/symbols/call_sensor.svg +19 -5
  285. data/cockpit/themes/packed/symbols/callmanipulate.svg +19 -4
  286. data/cockpit/themes/packed/symbols/callmanipulate_sensor.svg +22 -7
  287. data/cockpit/themes/packed/symbols/callmanipulate_sensor_signal.svg +32 -0
  288. data/cockpit/themes/packed/symbols/callmanipulate_signal.svg +29 -0
  289. data/cockpit/themes/packed/symbols/choose.svg +13 -3
  290. data/cockpit/themes/packed/symbols/choose_exclusive.svg +13 -3
  291. data/cockpit/themes/packed/symbols/choose_exclusive_finish.svg +5 -0
  292. data/cockpit/themes/packed/symbols/choose_inclusive.svg +11 -2
  293. data/cockpit/themes/packed/symbols/choose_inclusive_finish.svg +4 -0
  294. data/cockpit/themes/packed/symbols/closed_loop.svg +1 -1
  295. data/cockpit/themes/packed/symbols/closed_loop_cancel.svg +2 -2
  296. data/cockpit/themes/packed/symbols/closed_loop_control.svg +2 -2
  297. data/cockpit/themes/packed/symbols/closed_loop_measuring.svg +2 -2
  298. data/cockpit/themes/packed/symbols/complex.svg +1 -1
  299. data/cockpit/themes/packed/symbols/critical.svg +3 -2
  300. data/cockpit/themes/packed/symbols/delete.svg +2 -2
  301. data/cockpit/themes/packed/symbols/end.svg +1 -1
  302. data/cockpit/themes/packed/symbols/escape.svg +2 -2
  303. data/cockpit/themes/packed/symbols/event_end.svg +1 -1
  304. data/cockpit/themes/packed/symbols/loop.svg +13 -3
  305. data/cockpit/themes/packed/symbols/loop_end.svg +15 -0
  306. data/cockpit/themes/packed/symbols/manipulate.svg +17 -2
  307. data/cockpit/themes/packed/symbols/otherwise.svg +3 -3
  308. data/cockpit/themes/packed/symbols/parallel.svg +3 -2
  309. data/cockpit/themes/packed/symbols/parallel_branch.svg +3 -3
  310. data/cockpit/themes/packed/symbols/parallel_branch_event.svg +4 -4
  311. data/cockpit/themes/packed/symbols/parallel_branch_normal.svg +3 -3
  312. data/cockpit/themes/packed/symbols/parallel_eventbased_exclusive.svg +4 -4
  313. data/cockpit/themes/packed/symbols/parallel_eventbased_parallel.svg +3 -3
  314. data/cockpit/themes/packed/symbols/scripts.svg +2 -2
  315. data/cockpit/themes/packed/symbols/start.svg +1 -1
  316. data/cockpit/themes/packed/symbols/start_event.svg +1 -1
  317. data/cockpit/themes/packed/symbols/stop.svg +1 -1
  318. data/cockpit/themes/packed/symbols/wait_for_signal.svg +21 -0
  319. data/cockpit/themes/packed/theme.js +11 -7
  320. data/cockpit/themes/preset/rngs/call.rng +14 -0
  321. data/cockpit/themes/preset/rngs/callmanipulate.rng +18 -1
  322. data/cockpit/themes/preset/rngs/choose.rng +4 -1
  323. data/cockpit/themes/preset/rngs/manipulate.rng +15 -1
  324. data/cockpit/themes/preset/rngs/start.rng +133 -119
  325. data/cockpit/themes/preset/rngs/wait_for_signal.rng +8 -0
  326. data/cockpit/themes/preset/symbols/alternative.svg +13 -3
  327. data/cockpit/themes/preset/symbols/arrow.svg +1 -1
  328. data/cockpit/themes/preset/symbols/call.svg +15 -2
  329. data/cockpit/themes/preset/symbols/call_sensor.svg +19 -5
  330. data/cockpit/themes/preset/symbols/callmanipulate.svg +19 -4
  331. data/cockpit/themes/preset/symbols/callmanipulate_sensor.svg +22 -7
  332. data/cockpit/themes/preset/symbols/callmanipulate_sensor_signal.svg +32 -0
  333. data/cockpit/themes/preset/symbols/callmanipulate_signal.svg +29 -0
  334. data/cockpit/themes/preset/symbols/choose.svg +13 -3
  335. data/cockpit/themes/preset/symbols/choose_exclusive.svg +13 -3
  336. data/cockpit/themes/preset/symbols/choose_exclusive_finish.svg +5 -0
  337. data/cockpit/themes/preset/symbols/choose_inclusive.svg +11 -2
  338. data/cockpit/themes/preset/symbols/choose_inclusive_finish.svg +4 -0
  339. data/cockpit/themes/preset/symbols/closed_loop.svg +1 -1
  340. data/cockpit/themes/preset/symbols/closed_loop_cancel.svg +2 -2
  341. data/cockpit/themes/preset/symbols/closed_loop_control.svg +2 -2
  342. data/cockpit/themes/preset/symbols/closed_loop_measuring.svg +2 -2
  343. data/cockpit/themes/preset/symbols/complex.svg +1 -1
  344. data/cockpit/themes/preset/symbols/critical.svg +3 -2
  345. data/cockpit/themes/preset/symbols/delete.svg +2 -2
  346. data/cockpit/themes/preset/symbols/end.svg +1 -1
  347. data/cockpit/themes/preset/symbols/escape.svg +2 -2
  348. data/cockpit/themes/preset/symbols/event_end.svg +1 -1
  349. data/cockpit/themes/preset/symbols/loop.svg +13 -3
  350. data/cockpit/themes/preset/symbols/loop_end.svg +15 -0
  351. data/cockpit/themes/preset/symbols/manipulate.svg +17 -2
  352. data/cockpit/themes/preset/symbols/otherwise.svg +3 -3
  353. data/cockpit/themes/preset/symbols/parallel.svg +3 -2
  354. data/cockpit/themes/preset/symbols/parallel_branch.svg +3 -3
  355. data/cockpit/themes/preset/symbols/parallel_branch_event.svg +4 -4
  356. data/cockpit/themes/preset/symbols/parallel_branch_normal.svg +3 -3
  357. data/cockpit/themes/preset/symbols/parallel_eventbased_exclusive.svg +4 -4
  358. data/cockpit/themes/preset/symbols/parallel_eventbased_parallel.svg +3 -3
  359. data/cockpit/themes/preset/symbols/scripts.svg +2 -2
  360. data/cockpit/themes/preset/symbols/start.svg +1 -1
  361. data/cockpit/themes/preset/symbols/start_event.svg +1 -1
  362. data/cockpit/themes/preset/symbols/stop.svg +1 -1
  363. data/cockpit/themes/preset/symbols/wait_for_signal.svg +21 -0
  364. data/cockpit/themes/preset/theme.js +7 -1
  365. data/cockpit/themes/{compact → presetaltid}/rngs/call.rng +14 -0
  366. data/cockpit/themes/{compact → presetaltid}/rngs/callmanipulate.rng +18 -1
  367. data/cockpit/themes/{compact → presetaltid}/rngs/choose.rng +4 -1
  368. data/cockpit/themes/{compact → presetaltid}/rngs/manipulate.rng +15 -1
  369. data/cockpit/themes/presetaltid/rngs/start.rng +145 -0
  370. data/cockpit/themes/presetaltid/rngs/wait_for_signal.rng +8 -0
  371. data/cockpit/themes/presetaltid/symbols/alternative.svg +15 -0
  372. data/cockpit/themes/presetaltid/symbols/arrow.svg +3 -0
  373. data/cockpit/themes/presetaltid/symbols/call.svg +19 -0
  374. data/cockpit/themes/presetaltid/symbols/call_sensor.svg +23 -0
  375. data/cockpit/themes/presetaltid/symbols/callmanipulate.svg +23 -0
  376. data/cockpit/themes/presetaltid/symbols/callmanipulate_sensor.svg +26 -0
  377. data/cockpit/themes/presetaltid/symbols/callmanipulate_sensor_signal.svg +32 -0
  378. data/cockpit/themes/presetaltid/symbols/callmanipulate_signal.svg +29 -0
  379. data/cockpit/themes/presetaltid/symbols/choose.svg +15 -0
  380. data/cockpit/themes/presetaltid/symbols/choose_exclusive.svg +15 -0
  381. data/cockpit/themes/presetaltid/symbols/choose_exclusive_finish.svg +5 -0
  382. data/cockpit/themes/presetaltid/symbols/choose_inclusive.svg +13 -0
  383. data/cockpit/themes/presetaltid/symbols/choose_inclusive_finish.svg +4 -0
  384. data/cockpit/themes/{compact → presetaltid}/symbols/closed_loop.svg +1 -1
  385. data/cockpit/themes/{compact → presetaltid}/symbols/closed_loop_cancel.svg +2 -2
  386. data/cockpit/themes/{compact → presetaltid}/symbols/closed_loop_control.svg +2 -2
  387. data/cockpit/themes/{compact → presetaltid}/symbols/closed_loop_measuring.svg +2 -2
  388. data/cockpit/themes/{compact → presetaltid}/symbols/complex.svg +1 -1
  389. data/cockpit/themes/presetaltid/symbols/critical.svg +5 -0
  390. data/cockpit/themes/presetaltid/symbols/delete.svg +4 -0
  391. data/cockpit/themes/presetaltid/symbols/end.svg +3 -0
  392. data/cockpit/themes/{compact → presetaltid}/symbols/escape.svg +2 -2
  393. data/cockpit/themes/presetaltid/symbols/event_end.svg +3 -0
  394. data/cockpit/themes/presetaltid/symbols/loop.svg +15 -0
  395. data/cockpit/themes/presetaltid/symbols/loop_end.svg +15 -0
  396. data/cockpit/themes/presetaltid/symbols/manipulate.svg +19 -0
  397. data/cockpit/themes/presetaltid/symbols/otherwise.svg +5 -0
  398. data/cockpit/themes/presetaltid/symbols/parallel.svg +6 -0
  399. data/cockpit/themes/presetaltid/symbols/parallel_branch.svg +5 -0
  400. data/cockpit/themes/{compact → presetaltid}/symbols/parallel_branch_event.svg +4 -4
  401. data/cockpit/themes/presetaltid/symbols/parallel_branch_normal.svg +5 -0
  402. data/cockpit/themes/{compact → presetaltid}/symbols/parallel_eventbased_exclusive.svg +4 -4
  403. data/cockpit/themes/{compact → presetaltid}/symbols/parallel_eventbased_parallel.svg +3 -3
  404. data/cockpit/themes/presetaltid/symbols/scripts.svg +4 -0
  405. data/cockpit/themes/presetaltid/symbols/start.svg +3 -0
  406. data/cockpit/themes/{compact → presetaltid}/symbols/start_event.svg +1 -1
  407. data/cockpit/themes/{compact → presetaltid}/symbols/stop.svg +1 -1
  408. data/cockpit/themes/presetaltid/symbols/wait_for_signal.svg +21 -0
  409. data/cockpit/themes/presetaltid/theme.js +16 -0
  410. data/cockpit/themes/presetid/rngs/alternative.rng +25 -0
  411. data/cockpit/themes/{compact/rngs/start.rng → presetid/rngs/call.rng} +130 -18
  412. data/cockpit/themes/presetid/rngs/callmanipulate.rng +275 -0
  413. data/cockpit/themes/presetid/rngs/choose.rng +17 -0
  414. data/cockpit/themes/presetid/rngs/closed_loop.rng +62 -0
  415. data/cockpit/themes/presetid/rngs/closed_loop_cancel.rng +5 -0
  416. data/cockpit/themes/presetid/rngs/closed_loop_control.rng +31 -0
  417. data/cockpit/themes/presetid/rngs/closed_loop_measuring.rng +12 -0
  418. data/cockpit/themes/presetid/rngs/critical.rng +5 -0
  419. data/cockpit/themes/presetid/rngs/escape.rng +1 -0
  420. data/cockpit/themes/presetid/rngs/group.rng +3 -0
  421. data/cockpit/themes/presetid/rngs/loop.rng +22 -0
  422. data/cockpit/themes/presetid/rngs/manipulate.rng +23 -0
  423. data/cockpit/themes/presetid/rngs/otherwise.rng +22 -0
  424. data/cockpit/themes/presetid/rngs/parallel.rng +27 -0
  425. data/cockpit/themes/presetid/rngs/parallel_branch.rng +2 -0
  426. data/cockpit/themes/presetid/rngs/scripts.rng +23 -0
  427. data/cockpit/themes/presetid/rngs/start.rng +145 -0
  428. data/cockpit/themes/presetid/rngs/stop.rng +5 -0
  429. data/cockpit/themes/presetid/rngs/terminate.rng +1 -0
  430. data/cockpit/themes/presetid/rngs/wait_for_signal.rng +8 -0
  431. data/cockpit/themes/presetid/symbols/alternative.svg +15 -0
  432. data/cockpit/themes/presetid/symbols/arrow.svg +3 -0
  433. data/cockpit/themes/presetid/symbols/call.svg +19 -0
  434. data/cockpit/themes/presetid/symbols/call_sensor.svg +23 -0
  435. data/cockpit/themes/presetid/symbols/callmanipulate.svg +23 -0
  436. data/cockpit/themes/presetid/symbols/callmanipulate_sensor.svg +26 -0
  437. data/cockpit/themes/presetid/symbols/callmanipulate_sensor_signal.svg +32 -0
  438. data/cockpit/themes/presetid/symbols/callmanipulate_signal.svg +29 -0
  439. data/cockpit/themes/presetid/symbols/choose.svg +15 -0
  440. data/cockpit/themes/presetid/symbols/choose_exclusive.svg +15 -0
  441. data/cockpit/themes/presetid/symbols/choose_exclusive_finish.svg +5 -0
  442. data/cockpit/themes/presetid/symbols/choose_inclusive.svg +13 -0
  443. data/cockpit/themes/presetid/symbols/choose_inclusive_finish.svg +4 -0
  444. data/cockpit/themes/presetid/symbols/closed_loop.svg +5 -0
  445. data/cockpit/themes/presetid/symbols/closed_loop_cancel.svg +5 -0
  446. data/cockpit/themes/presetid/symbols/closed_loop_control.svg +5 -0
  447. data/cockpit/themes/presetid/symbols/closed_loop_measuring.svg +6 -0
  448. data/cockpit/themes/presetid/symbols/complex.svg +8 -0
  449. data/cockpit/themes/presetid/symbols/critical.svg +5 -0
  450. data/cockpit/themes/presetid/symbols/delete.svg +4 -0
  451. data/cockpit/themes/presetid/symbols/end.svg +3 -0
  452. data/cockpit/themes/presetid/symbols/escape.svg +5 -0
  453. data/cockpit/themes/presetid/symbols/event_end.svg +3 -0
  454. data/cockpit/themes/presetid/symbols/loop.svg +15 -0
  455. data/cockpit/themes/presetid/symbols/loop_end.svg +15 -0
  456. data/cockpit/themes/presetid/symbols/manipulate.svg +19 -0
  457. data/cockpit/themes/presetid/symbols/otherwise.svg +5 -0
  458. data/cockpit/themes/presetid/symbols/parallel.svg +6 -0
  459. data/cockpit/themes/presetid/symbols/parallel_branch.svg +5 -0
  460. data/cockpit/themes/presetid/symbols/parallel_branch_event.svg +14 -0
  461. data/cockpit/themes/presetid/symbols/parallel_branch_normal.svg +5 -0
  462. data/cockpit/themes/presetid/symbols/parallel_eventbased_exclusive.svg +9 -0
  463. data/cockpit/themes/presetid/symbols/parallel_eventbased_parallel.svg +8 -0
  464. data/cockpit/themes/presetid/symbols/scripts.svg +4 -0
  465. data/cockpit/themes/presetid/symbols/start.svg +3 -0
  466. data/cockpit/themes/presetid/symbols/start_event.svg +5 -0
  467. data/cockpit/themes/presetid/symbols/stop.svg +5 -0
  468. data/cockpit/themes/{compact/symbols/end.svg → presetid/symbols/terminate.svg} +1 -0
  469. data/cockpit/themes/presetid/symbols/wait_for_signal.svg +21 -0
  470. data/cockpit/themes/presetid/theme.js +16 -0
  471. data/cockpit/themes/reduced/rngs/call.rng +14 -0
  472. data/cockpit/themes/reduced/rngs/callmanipulate.rng +18 -1
  473. data/cockpit/themes/reduced/rngs/choose.rng +4 -1
  474. data/cockpit/themes/reduced/rngs/manipulate.rng +15 -1
  475. data/cockpit/themes/reduced/rngs/start.rng +133 -119
  476. data/cockpit/themes/reduced/rngs/wait_for_signal.rng +8 -0
  477. data/cockpit/themes/reduced/symbols/alternative.svg +13 -3
  478. data/cockpit/themes/reduced/symbols/arrow.svg +1 -1
  479. data/cockpit/themes/reduced/symbols/call.svg +15 -2
  480. data/cockpit/themes/reduced/symbols/call_sensor.svg +19 -5
  481. data/cockpit/themes/reduced/symbols/callmanipulate.svg +19 -4
  482. data/cockpit/themes/reduced/symbols/callmanipulate_sensor.svg +22 -7
  483. data/cockpit/themes/reduced/symbols/callmanipulate_sensor_signal.svg +32 -0
  484. data/cockpit/themes/reduced/symbols/callmanipulate_signal.svg +29 -0
  485. data/cockpit/themes/reduced/symbols/choose.svg +13 -3
  486. data/cockpit/themes/reduced/symbols/choose_exclusive.svg +13 -3
  487. data/cockpit/themes/reduced/symbols/choose_exclusive_finish.svg +5 -0
  488. data/cockpit/themes/reduced/symbols/choose_inclusive.svg +11 -2
  489. data/cockpit/themes/reduced/symbols/choose_inclusive_finish.svg +4 -0
  490. data/cockpit/themes/reduced/symbols/closed_loop.svg +1 -1
  491. data/cockpit/themes/reduced/symbols/closed_loop_cancel.svg +2 -2
  492. data/cockpit/themes/reduced/symbols/closed_loop_control.svg +2 -2
  493. data/cockpit/themes/reduced/symbols/closed_loop_measuring.svg +2 -2
  494. data/cockpit/themes/reduced/symbols/complex.svg +1 -1
  495. data/cockpit/themes/reduced/symbols/critical.svg +3 -2
  496. data/cockpit/themes/reduced/symbols/delete.svg +2 -2
  497. data/cockpit/themes/reduced/symbols/end.svg +1 -1
  498. data/cockpit/themes/reduced/symbols/escape.svg +2 -2
  499. data/cockpit/themes/reduced/symbols/event_end.svg +1 -1
  500. data/cockpit/themes/reduced/symbols/loop.svg +13 -3
  501. data/cockpit/themes/reduced/symbols/loop_end.svg +15 -0
  502. data/cockpit/themes/reduced/symbols/manipulate.svg +17 -2
  503. data/cockpit/themes/reduced/symbols/otherwise.svg +3 -3
  504. data/cockpit/themes/reduced/symbols/parallel.svg +3 -2
  505. data/cockpit/themes/reduced/symbols/parallel_branch.svg +3 -3
  506. data/cockpit/themes/reduced/symbols/parallel_branch_event.svg +4 -4
  507. data/cockpit/themes/reduced/symbols/parallel_branch_normal.svg +3 -3
  508. data/cockpit/themes/reduced/symbols/parallel_eventbased_exclusive.svg +4 -4
  509. data/cockpit/themes/reduced/symbols/parallel_eventbased_parallel.svg +3 -3
  510. data/cockpit/themes/reduced/symbols/scripts.svg +2 -2
  511. data/cockpit/themes/reduced/symbols/start.svg +1 -1
  512. data/cockpit/themes/reduced/symbols/start_event.svg +1 -1
  513. data/cockpit/themes/reduced/symbols/stop.svg +1 -1
  514. data/cockpit/themes/reduced/symbols/wait_for_signal.svg +21 -0
  515. data/contrib/logo2a-favicon.png +0 -0
  516. data/contrib/logo2a-favicon.svg +423 -0
  517. data/cpee.gemspec +1 -1
  518. data/server/executionhandlers/ruby/connection.rb +9 -1
  519. data/server/executionhandlers/ruby/dsl_to_dslx.xsl +18 -1
  520. data/server/routing/end.pid +1 -1
  521. data/server/routing/forward-events-00.pid +1 -1
  522. data/server/routing/forward-votes.pid +1 -1
  523. data/server/routing/persist.pid +1 -1
  524. metadata +187 -68
  525. data/cockpit/themes/compact/symbols/alternative.svg +0 -5
  526. data/cockpit/themes/compact/symbols/arrow.svg +0 -3
  527. data/cockpit/themes/compact/symbols/call.svg +0 -6
  528. data/cockpit/themes/compact/symbols/call_sensor.svg +0 -9
  529. data/cockpit/themes/compact/symbols/callmanipulate.svg +0 -8
  530. data/cockpit/themes/compact/symbols/callmanipulate_sensor.svg +0 -11
  531. data/cockpit/themes/compact/symbols/critical.svg +0 -4
  532. data/cockpit/themes/compact/symbols/delete.svg +0 -4
  533. data/cockpit/themes/compact/symbols/event_end.svg +0 -3
  534. data/cockpit/themes/compact/symbols/manipulate.svg +0 -4
  535. data/cockpit/themes/compact/symbols/otherwise.svg +0 -5
  536. data/cockpit/themes/compact/symbols/parallel_branch.svg +0 -5
  537. data/cockpit/themes/compact/symbols/parallel_branch_normal.svg +0 -5
  538. data/cockpit/themes/compact/symbols/scripts.svg +0 -4
  539. data/cockpit/themes/compact/symbols/start.svg +0 -3
  540. data/cockpit/themes/compact/theme.js +0 -13
  541. data/cockpit/themes/dataflow/symbols/parallel_branch_compact.svg +0 -4
  542. data/cockpit/themes/default/symbols/parallel_branch_compact.svg +0 -4
  543. data/cockpit/themes/extended/symbols/parallel_branch_compact.svg +0 -4
  544. data/cockpit/themes/felix/symbols/parallel_branch_compact.svg +0 -4
  545. data/cockpit/themes/model/symbols/parallel_branch_compact.svg +0 -4
  546. data/cockpit/themes/packed/symbols/parallel_branch_compact.svg +0 -4
  547. data/cockpit/themes/preset/symbols/parallel_branch_compact.svg +0 -4
  548. data/cockpit/themes/reduced/symbols/parallel_branch_compact.svg +0 -4
  549. data/server/executionhandlers/ruby/ShiftingTestSimple.xml +0 -100
  550. data/server/server.pid +0 -1
  551. /data/cockpit/themes/{compact → presetaltid}/rngs/alternative.rng +0 -0
  552. /data/cockpit/themes/{compact → presetaltid}/rngs/closed_loop.rng +0 -0
  553. /data/cockpit/themes/{compact → presetaltid}/rngs/closed_loop_cancel.rng +0 -0
  554. /data/cockpit/themes/{compact → presetaltid}/rngs/closed_loop_control.rng +0 -0
  555. /data/cockpit/themes/{compact → presetaltid}/rngs/closed_loop_measuring.rng +0 -0
  556. /data/cockpit/themes/{compact → presetaltid}/rngs/critical.rng +0 -0
  557. /data/cockpit/themes/{compact → presetaltid}/rngs/escape.rng +0 -0
  558. /data/cockpit/themes/{compact → presetaltid}/rngs/group.rng +0 -0
  559. /data/cockpit/themes/{compact → presetaltid}/rngs/loop.rng +0 -0
  560. /data/cockpit/themes/{compact → presetaltid}/rngs/otherwise.rng +0 -0
  561. /data/cockpit/themes/{compact → presetaltid}/rngs/parallel.rng +0 -0
  562. /data/cockpit/themes/{compact → presetaltid}/rngs/parallel_branch.rng +0 -0
  563. /data/cockpit/themes/{compact → presetaltid}/rngs/scripts.rng +0 -0
  564. /data/cockpit/themes/{compact → presetaltid}/rngs/stop.rng +0 -0
  565. /data/cockpit/themes/{compact → presetaltid}/rngs/terminate.rng +0 -0
  566. /data/cockpit/themes/{compact → presetaltid}/symbols/terminate.svg +0 -0
@@ -14,6 +14,8 @@
14
14
  <http://www.gnu.org/licenses/>.
15
15
  */
16
16
 
17
+ var high;
18
+
17
19
  // TODO: changes in svg-script:
18
20
  // 1) drawing functions
19
21
  // 2) creation of svg-container (Bug: arrows on lines)
@@ -63,9 +65,10 @@ function WfAdaptor(theme_base,doit) { // Controller {{{
63
65
 
64
66
  this.update = function(doit){ doit(self); };
65
67
 
66
- $.getScript(theme_base, function() {
68
+ $.getScript(theme_base, function() { //{{{
67
69
  manifestation = new WFAdaptorManifestation(self);
68
70
  illustrator.compact = manifestation.compact == true ? true : false;
71
+ illustrator.rotated_labels = manifestation.rotated_labels == true ? true : false;
69
72
  illustrator.striped = manifestation.striped == true ? true : false;
70
73
  description.source = manifestation.source;
71
74
  var deferreds = [];
@@ -166,7 +169,7 @@ function WfAdaptor(theme_base,doit) { // Controller {{{
166
169
  manifestation.elements[element].description = [ manifestation.elements[element].description ];
167
170
  }
168
171
  if ($.isArray(manifestation.elements[element].description)) {
169
- _.each(manifestation.elements[element].description,function(val,ind){
172
+ manifestation.elements[element].description.forEach(function(val,ind){
170
173
  deferreds.push(
171
174
  $.ajax({
172
175
  type: "GET",
@@ -189,7 +192,7 @@ function WfAdaptor(theme_base,doit) { // Controller {{{
189
192
  $.when.apply($, deferreds).then(function(x) {
190
193
  doit(self);
191
194
  });
192
- });
195
+ }); //}}}
193
196
  } // }}}
194
197
 
195
198
  // WfIllustrator:
@@ -197,33 +200,44 @@ function WfAdaptor(theme_base,doit) { // Controller {{{
197
200
  function WfIllustrator(wf_adaptor) { // View {{{
198
201
  // Variable {{{
199
202
  // public
203
+ this.endclipshift = 17;
200
204
  this.height = 40;
201
205
  this.width = 40;
202
206
  this.default_width = 40;
203
207
  this.default_height = 40;
204
208
  this.height_shift = this.height * 0.26;
205
209
  this.width_shift = this.width * 0.39;
210
+ this.width_shift_label = 7;
211
+ this.group_extend = 1;
206
212
  this.elements = {}; // the svgs
207
213
  this.svg = {};
208
214
  this.draw = {};
215
+ this.dim = {};
216
+ this.dim.symbols = [];
217
+ this.dim.connections = [];
209
218
  this.compact = true;
219
+ this.rotated_labels = true;
210
220
  this.striped = true;
221
+ this.global_style = {};
211
222
  // private
212
223
  var self = this;
213
224
  var adaptor = null;
214
225
  // }}}
215
- // Generic Functions {{{
226
+ // Internal Functions
216
227
  this.set_label_container = function(con) { // {{{
217
228
  self.svg.label_container = con;
218
229
  } // }}}
219
230
  this.set_svg_container = function(con) { // {{{
220
231
  self.svg.container = con;
221
232
  self.svg.container.append($X('<defs xmlns="http://www.w3.org/2000/svg">' +
222
- ' <marker id="arrow" viewBox="0 0 10 10" refX="33" refY="5" orient="auto" markerUnits="strokeWidth" markerWidth="4.5" makerHeight="4.5">' +
233
+ ' <marker id="arrow" viewBox="0 0 10 10" refX="28.5" refY="5" orient="auto" markerUnits="strokeWidth" markerWidth="14" markerHeight="3.5">' +
223
234
  ' <path d="m 2 2 l 6 3 l -6 3 z"/>' +
224
235
  ' </marker>' +
225
- ' <clipPath id="squareclip">' +
226
- ' <rect x="-1" y="-1" width="32" height="32"/>' +
236
+ ' <clipPath id="startclip">' +
237
+ ' <rect x="-1" y="-1" width="29" height="32"/>' +
238
+ ' </clipPath>' +
239
+ ' <clipPath id="endclip">' +
240
+ ' <rect x="20" y="-1" width="' + self.endclipshift + '" height="35"/>' +
227
241
  ' </clipPath>' +
228
242
  '</defs>'));
229
243
  self.svg.defs = {};
@@ -238,16 +252,28 @@ function WfIllustrator(wf_adaptor) { // View {{{
238
252
  self.svg.defs[element] = sym;
239
253
  }
240
254
  } // }}}
241
- var clear = this.clear = function() { // {{{
242
- $('> :not(defs)', self.svg.container).each(function() {$(this).remove()});
255
+ this.set_svg_direct = function(svg) { // {{{
256
+ self.svg.container.append(svg);
257
+ let bb = svg[0].getBBox();
258
+ self.svg.container.attr('height', bb.y + bb.height + self.height_shift); // small border on the bottom
259
+ self.svg.container.attr('width', bb.x + bb.width + self.width_shift); // small border on the right
243
260
  } // }}}
244
261
  this.set_svg = function(graph) { // {{{
245
- if(graph.max.row < 1) graph.max.row = 1;
246
- if(graph.max.col < 1) graph.max.col = 1;
247
- self.svg.container.attr('height', (graph.max.row) * self.height + self.height_shift);
248
- self.svg.container.attr('width', (graph.max.col+0.55) * self.width );
249
262
  self.svg.container.append(graph.svg);
263
+ let bb = graph.svg[0].getBBox();
264
+ self.svg.container.attr('height', bb.y + bb.height + self.height_shift); // small border on the bottom
265
+ self.svg.container.attr('width', bb.x + bb.width + self.width_shift); // small border on the right
266
+ self.svg.container.attr('data-pos-matrix', JSON.stringify(self.dim.symbols));
267
+ self.svg.container.attr('data-con-list', JSON.stringify(self.dim.connections));
250
268
  } // }}}
269
+ this.set_duration = function(start) { //{{{
270
+ self.svg.container.append(
271
+ $X('<text class="duration" transform="translate(3,' + self.height_shift + ') rotate(90)" xmlns="http://www.w3.org/2000/svg">' +
272
+ Math.trunc(performance.now()-start) + ' ms' +
273
+ '</text>')
274
+ );
275
+ } //}}}
276
+
251
277
  this.get_node_by_svg_id = function(svg_id) { // {{{
252
278
  return $('[element-id = \'' + svg_id + '\'] g.activities', self.svg.container);
253
279
  } // }}}
@@ -260,126 +286,510 @@ function WfIllustrator(wf_adaptor) { // View {{{
260
286
  this.get_labels = function() { // {{{
261
287
  return $('[element-id]', self.svg.label_container);
262
288
  } // }}}
263
- // }}}
289
+
290
+ // External Functions
291
+ var clear = this.clear = function() { // {{{
292
+ $('> :not(defs)', self.svg.container).each(function() {$(this).remove()});
293
+ $('> defs > [belongs-to=element]', self.svg.container).each(function() {$(this).remove()});
294
+ self.dim.symbols = [];
295
+ } // }}}
296
+ var get_symbol = this.get_symbol = function() { // {{{
297
+ } // }}}
298
+ var get_properties = this.get_symbol = function() { // {{{
299
+ } // }}}
300
+
264
301
  // Helper Functions {{{
265
- var get_y = this.draw.get_y = function (row) { // {{{
302
+ var debug_dim = this.dim.debug = function() { //{{{
303
+ line = '\n';
304
+ for (let i=1; i < self.dim.symbols.length; i++) {
305
+ line += $.sprintf('%02d',i) + ': ';
306
+ if (self.dim.symbols[i]) {
307
+ for (let j=1; j < self.dim.symbols[i].length; j++) {
308
+ line += ' [ ';
309
+ if (self.dim.symbols[i] && self.dim.symbols[i][j] && self.dim.symbols[i][j].x) { line += $.sprintf('%3d',self.dim.symbols[i][j].x); } else { line += ' '; }
310
+ line += ', ';
311
+ if (self.dim.symbols[i] && self.dim.symbols[i][j] && self.dim.symbols[i][j].width) { line += $.sprintf('%3d',self.dim.symbols[i][j].width); } else { line += ' '; }
312
+ line += ' ] ';
313
+ }
314
+ }
315
+ line += "\n";
316
+ }
317
+ return line;
318
+ } //}}}
319
+
320
+ var set_x = this.dim.set_x = function(row,col,twidth,sname) { //{{{
321
+ if (!self.dim.symbols[row]) { self.dim.symbols[row] = []; }
322
+ if (!self.dim.symbols[row][col]) { self.dim.symbols[row][col] = {}; }
323
+
324
+ if (self.dim.symbols[row-1] && self.dim.symbols[row-1][col] && self.dim.symbols[row-1][col].x) { // row before
325
+ self.dim.symbols[row][col].x = self.dim.symbols[row-1][col].x;
326
+ } else if (self.dim.symbols[row] && self.dim.symbols[row][col-1] && self.dim.symbols[row][col-1].x) { // column before
327
+ let mx = 0;
328
+ for (let i=row; i<self.dim.symbols.length; i++) {
329
+ if (self.dim.symbols[i][col-1] && mx < self.dim.symbols[i][col-1].x + self.dim.symbols[i][col-1].width) {
330
+ mx = self.dim.symbols[i][col-1].x + self.dim.symbols[i][col-1].width;
331
+ }
332
+ }
333
+ self.dim.symbols[row][col].x = mx;
334
+ } else if (self.dim.symbols[row-1] && self.dim.symbols[row-1][col-1] && self.dim.symbols[row-1][col-1].x) { // diagonal left above
335
+ self.dim.symbols[row][col].x = self.dim.symbols[row-1][col-1].x + self.dim.symbols[row-1][col-1].width;
336
+ } else if (self.dim.symbols.length > row + 1) { // same column below
337
+ let mx = 0;
338
+ for (let i=row; i<self.dim.symbols.length; i++) {
339
+ if (self.dim.symbols[i] && self.dim.symbols[i][col] && mx < self.dim.symbols[i][col].x) {
340
+ mx = self.dim.symbols[i][col].x;
341
+ }
342
+ }
343
+ self.dim.symbols[row][col].x = mx;
344
+ } else { // same column above
345
+ let mx = 0;
346
+ for (let i=row; i>0; i--) {
347
+ if (self.dim.symbols[i] && self.dim.symbols[i][col] && mx < self.dim.symbols[i][col].x) {
348
+ mx = self.dim.symbols[i][col].x;
349
+ }
350
+ }
351
+ self.dim.symbols[row][col].x = mx;
352
+ }
353
+ if (self.dim.symbols[row][col].width) {
354
+ if (twidth > self.dim.symbols[row][col].width) {
355
+ self.dim.symbols[row][col].width = twidth;
356
+ }
357
+ } else {
358
+ self.dim.symbols[row][col].width = twidth;
359
+ }
360
+ self.dim.symbols[row][col].type = sname;
361
+ // console.log('set_x ',row,col,debug_dim());
362
+ } //}}}
363
+ var set_x_cond = this.dim.set_x_cond = function(row,col,tx,twidth,sname,label,subtype) { //{{{
364
+ if (!self.dim.symbols[row]) { self.dim.symbols[row] = []; }
365
+ if (!self.dim.symbols[row][col] || self.dim.symbols[row][col].width < twidth) {
366
+ self.dim.symbols[row][col] = {};
367
+ self.dim.symbols[row][col].x = tx;
368
+ self.dim.symbols[row][col].width = twidth;
369
+ }
370
+ self.dim.symbols[row][col].type = sname;
371
+ self.dim.symbols[row][col].label = label;
372
+ self.dim.symbols[row][col].subtype = subtype;
373
+ // console.log('set_x_cond',row,col,debug_dim());
374
+ } //}}}
375
+
376
+ var get_x = this.dim.get_x = function(row,col,deb='') { //{{{
377
+ if (row<0) { row = 0 };
378
+
379
+ let mlen = 0;
380
+ if (self.dim.symbols[row] && self.dim.symbols[row][col] && self.dim.symbols[row][col].x) { // this column
381
+ mlen = self.dim.symbols[row][col].x;
382
+ } else if (self.dim.symbols[row] && !self.dim.symbols[row][col] && self.dim.symbols.length > row && self.dim.symbols[row+1] && self.dim.symbols[row+1][col] && self.dim.symbols[row+1][col].x ) { // row after
383
+ mlen = self.dim.symbols[row+1][col].x;
384
+ } else if (self.dim.symbols[row-1] && self.dim.symbols[row-1][col] && self.dim.symbols[row-1][col].x) { // row before
385
+ mlen = self.dim.symbols[row-1][col].x;
386
+ } else if (self.dim.symbols[row] && self.dim.symbols[row][col-1] && self.dim.symbols[row][col-1].x) { // column before
387
+ for (let i=row; i<self.dim.symbols.length; i++) {
388
+ if (self.dim.symbols[i][col-1] && mlen < self.dim.symbols[i][col-1].x + self.dim.symbols[i][col-1].width) {
389
+ mlen = self.dim.symbols[i][col-1].x + self.dim.symbols[i][col-1].width;
390
+ }
391
+ }
392
+ } else if (self.dim.symbols[row+1] && self.dim.symbols[row+1][col] && self.dim.symbols[row+1][col].x) { // directly below
393
+ mlen = self.dim.symbols[row+1][col].x;
394
+ } else if (self.dim.symbols[row-1] && self.dim.symbols[row-1][col-1] && self.dim.symbols[row-1][col-1].x) { // diagonal left above
395
+ mlen = self.dim.symbols[row-1][col-1].x + self.dim.symbols[row-1][col-1].width;
396
+ } else { // same column below
397
+ for (let i=row; i<self.dim.symbols.length; i++) {
398
+ if (self.dim.symbols[i] && self.dim.symbols[i][col] && mlen < self.dim.symbols[i][col].x + self.dim.symbols[i][col].width) {
399
+ mlen = self.dim.symbols[i][col].x;
400
+ }
401
+ }
402
+ // found nothing in the rows below
403
+ if (mlen == 0) { // mostly for column 0
404
+ mlen = self.width;
405
+ }
406
+ }
407
+ // console.log(deb,row,col,'--> ' + mlen,debug_dim());
408
+ return mlen;
409
+ } //}}}
410
+ var get_x_plus = this.dim.get_x_plus = function(rowf,rowt,col,deb='') { //{{{
411
+ if (rowf<0) { row = 0 };
412
+
413
+ mlen = 0;
414
+ for (let i=rowf; i<=rowt; i++) {
415
+ if (self.dim.symbols[i] && self.dim.symbols[i][col] && mlen < self.dim.symbols[i][col].x + self.dim.symbols[i][col].width) {
416
+ mlen = self.dim.symbols[i][col].x + self.dim.symbols[i][col].width;
417
+ }
418
+ }
419
+ // console.log(deb,rowf,rowt,col,'--> ' + mlen,debug_dim());
420
+ return mlen;
421
+ } //}}}
422
+ var get_x_width = this.dim.get_x_width = function(maxcol) { //{{{
423
+ let cwidth = 0;
424
+ for (let i=0; i < self.dim.symbols.length; i++) {
425
+ let lwidth = 0;
426
+ for (let j=0; j <= maxcol; j++) {
427
+ if (typeof self.dim.symbols[i] !== 'undefined' && typeof self.dim.symbols[i][j] !== 'undefined') {
428
+ lwidth += self.dim.symbols[i][j].width;
429
+ } else {
430
+ // go up the column and find the next valid value
431
+ let x = i;
432
+ let found = false;
433
+ while (x > 0 && !found) {
434
+ x -= 1;
435
+ if (typeof self.dim.symbols[x] !== 'undefined' && typeof self.dim.symbols[x][j] !== 'undefined') {
436
+ lwidth += self.dim.symbols[x][j].width;
437
+ found = true;
438
+ }
439
+ }
440
+ if (!found) {
441
+ lwidth[i] += self.width;
442
+ }
443
+ }
444
+ }
445
+ if (cwidth < lwidth) { cwidth = lwidth; }
446
+ }
447
+ return cwidth;
448
+ } //}}}
449
+
450
+ var get_y = this.draw.get_y = function(row) { // {{{
266
451
  return { y: row * self.height - self.height, height_shift: self.height_shift};
267
452
  } // }}}
268
453
 
454
+ var get_width = this.draw.get_width = function(g) { //{{{
455
+ let t = g.clone();
456
+ self.svg.container.append(t);
457
+ let bb = t[0].getBBox();
458
+ let w = bb.width - bb.x;
459
+ t.remove();
460
+ return w;
461
+ } //}}}
462
+ var get_height = this.draw.get_height = function(g) { //{{{
463
+ let t = g.clone();
464
+ self.svg.container.append(t);
465
+ let bb = t[0].getBBox();
466
+ let h = bb.height - bb.y;
467
+ t.remove();
468
+ return h;
469
+ } //}}}
470
+ var get_dim = this.draw.get_dim = function(g) { //{{{
471
+ let element = g.clone();
472
+ self.svg.container.append(element);
473
+ let svg = element[0].ownerSVGElement;
474
+
475
+ var r = element[0].getBBox();
476
+
477
+ if (!svg) {
478
+ element[0].remove();
479
+ return { x: 0, y: 0, cx: 0, cy: 0, width: 0, height: 0 };
480
+ }
481
+
482
+ var p = svg.createSVGPoint();
483
+
484
+ var matrix = svg.getScreenCTM().inverse().multiply(element[0].getScreenCTM());
485
+
486
+ p.x = r.x;
487
+ p.y = r.y;
488
+ var a = p.matrixTransform(matrix);
489
+
490
+ p.x = r.x + r.width;
491
+ p.y = r.y;
492
+ var b = p.matrixTransform(matrix);
493
+
494
+ p.x = r.x + r.width;
495
+ p.y = r.y + r.height;
496
+ var c = p.matrixTransform(matrix);
497
+
498
+ p.x = r.x;
499
+ p.y = r.y + r.height;
500
+ var d = p.matrixTransform(matrix);
501
+
502
+ var minX = Math.min(a.x, b.x, c.x, d.x);
503
+ var maxX = Math.max(a.x, b.x, c.x, d.x);
504
+ var minY = Math.min(a.y, b.y, c.y, d.y);
505
+ var maxY = Math.max(a.y, b.y, c.y, d.y);
506
+
507
+ var width = maxX - minX;
508
+ var height = maxY - minY;
509
+
510
+ element.remove();
511
+
512
+ return {
513
+ x: minX,
514
+ y: minY,
515
+ width: width,
516
+ height: height,
517
+ cx: minX + width / 2,
518
+ cy: minY + height / 2
519
+ };
520
+ } //}}}
521
+
522
+ var bind_event = this.draw.bind_event = function(sym,tname,context) { //{{{
523
+ for(event_name in adaptor.elements[tname]) {
524
+ sym.bind(event_name, {'function_call':adaptor.elements[tname][event_name]}, function(e) { e.data.function_call($(this).attr('element-id'),e)});
525
+ if(event_name == 'mousedown') sym.bind('contextmenu', false);
526
+ }
527
+ } //}}}
528
+
269
529
  var draw_stripe = this.draw.draw_stripe = function (row, maxcol) { // {{{
270
530
  if (maxcol < 1) maxcol = 1;
271
- var g = $X('<rect element-row="' + row + '" class="stripe ' + (row % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + String(row*self.height+self.height_shift/2) + '" width="' + (self.width * maxcol + self.width - self.width_shift) + '" height="' + (self.height) + '" xmlns="http://www.w3.org/2000/svg"></rect>');
531
+
532
+ let cwidth = get_x_width(maxcol);
533
+ cwidth = cwidth + 2 * self.width - self.width_shift;
534
+
535
+ var g = $X('<rect element-row="' + row + '" class="stripe ' + (row % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + String(row*self.height+self.height_shift/2) + '" width="' + cwidth + '" height="' + (self.height) + '" xmlns="http://www.w3.org/2000/svg"></rect>');
272
536
  self.svg.container.prepend(g);
273
537
  return g;
274
538
  } // }}}
275
-
276
- var draw_symbol = this.draw.draw_symbol = function (sname, id, title, row, col, group, addition) { // {{{
539
+ var draw_symbol = this.draw.draw_symbol = function(sname, id, title, parent_row, max_row, row, col, group, addition, info, style) { // {{{
277
540
  if(self.elements[sname] == undefined || self.elements[sname].svg == undefined) sname = 'unknown';
278
541
  let center_x = (self.width - self.default_width) / 2;
279
542
  let center_y = (self.height - self.default_height) / 2;
280
- if (addition) {
281
- var g = $X('<g class="element" element-row="' + (row-1) + '" element-type="' + sname + '" element-id="' + id + '" xmlns="http://www.w3.org/2000/svg">' +
282
- '<g transform="translate(' + String(col*self.width+center_x-self.width_shift) + ',' + String(row*self.height+center_y-(self.height-self.height_shift)) + ')"></g>' +
283
- '</g>');
284
- } else {
285
- var g = $X('<g class="element" element-row="' + (row-1) + '" element-type="' + sname + '" element-id="' + id + '" xmlns="http://www.w3.org/2000/svg">' +
286
- '<g transform="translate(' + String(col*self.width+center_x-self.width_shift) + ',' + String(row*self.height+center_y-(self.height-self.height_shift)) + ')">' +
287
- '<text class="super" transform="translate(' + (self.default_width-10) + ',8.4)">' +
288
- '<tspan class="active">0</tspan>' +
289
- '<tspan class="colon">,</tspan>' +
290
- '<tspan class="vote">0</tspan>' +
291
- '</text>' +
292
- '</g>' +
293
- '</g>');
543
+
544
+ let dstart = get_x(parent_row,col,'symbol ' + sname);
545
+
546
+ let sstart = dstart + center_x - self.width_shift;
547
+ let stop = row * self.height + center_y - (self.height-self.height_shift);
548
+
549
+ var g = $X('<g class="element" element-row="' + (row-1) + '" element-type="' + sname + '" element-id="' + id + '" xmlns="http://www.w3.org/2000/svg">' +
550
+ '<g transform="translate(' + String(sstart) + ',' + String(stop) + ')"></g>' +
551
+ '</g>');
552
+
553
+ // add the element-endpoint and other stuff to each symbol (from theme info function)
554
+ for (const key in info) {
555
+ g.attr(key, info[key]);
294
556
  }
557
+
295
558
  var sym = self.svg.defs[sname].clone();
559
+ var subtype = undefined;
560
+
561
+ if (g.attr('element-endpoint')) {
562
+ let tsym = self.get_symbol(g.attr('element-endpoint'));
563
+ if (tsym) {
564
+ let found = false;
565
+ $('.part-end',sym).remove();
566
+ if ($('.part-end',tsym).length > 0) {
567
+ sym.prepend($('.part-end',tsym).clone());
568
+ found = true;
569
+ }
570
+ if ($('.part-middle',tsym).length > 0) {
571
+ $('.part-middle',sym).remove();
572
+ sym.prepend($('.part-middle',tsym).clone());
573
+ found = true;
574
+ }
575
+ if ($('.part-start',tsym).length > 0) {
576
+ $('.part-start',sym).remove();
577
+ sym.prepend($('.part-start',tsym).clone());
578
+ found = true;
579
+ }
580
+ if ($('.part-normal',tsym).length > 0) {
581
+ $('.part-normal',sym).remove();
582
+ sym.prepend($('.part-normal',tsym).clone());
583
+ found = true;
584
+ }
585
+ if (!found) {
586
+ $('.part-normal',sym).remove();
587
+ let ts = $X('<g class="part-normal" xmlns="http://www.w3.org/2000/svg"></g>');
588
+ ts.append($(tsym.documentElement.children).clone());
589
+ sym.prepend(ts);
590
+ }
591
+ }
592
+ let tprop = self.get_properties(g.attr('element-endpoint'));
593
+ if (tprop) {
594
+ subtype = tprop.subtype;
595
+ }
596
+ }
597
+
296
598
  var tit = $X('<title xmlns="http://www.w3.org/2000/svg"></title>');
297
599
  tit.text(title);
298
600
  sym.prepend(tit);
601
+ let lab = $('.label',sym);
602
+ if (lab.length > 0 && self.compact) {
603
+ let l_maxlen = 40; // max label size
604
+ let l_split = 18; // desired split position
605
+ let l_dev = 10; // if one split line is bigger than l_split + l_dev, split was not successfull and we have to display a more truncated string
606
+ let l_trunc = 18; // trucation size
607
+
608
+ let sta = $('.part-start',sym);
609
+ let mid = $('.part-middle',sym);
610
+ let end = $('.part-end',sym);
611
+ let xtr = $('.part-extra',sym);
612
+ let nor = $('.part-normal',sym);
613
+ if (title && title != '') {
614
+ if (title.length < l_split) {
615
+ lab.text(title);
616
+ } else {
617
+ if (title.length > l_maxlen) { title = title.substr(0,l_maxlen) + '\u2026'; }
618
+ if (title.includes(' ')) {
619
+ let len = title.length;
620
+ let pos = -2;
621
+ let seps = []
622
+ while (pos != -1) {
623
+ pos = title.indexOf(' ',pos+1);
624
+ if (pos > -1) seps.push(pos);
625
+ }
626
+ let closest = title.length;
627
+ let it = 0;
628
+ seps.forEach((ele) => {
629
+ let min = Math.abs(title.length/2 - ele);
630
+ if (min < closest) { closest = min; it = ele; }
631
+ });
632
+ let l1 = title.substr(0,it);
633
+ let l2 = title.substr(it+1);
634
+ if (l1.length > l_split+l_dev) {
635
+ title = title.substr(0,l_trunc) + '\u2026';
636
+ lab.text(title);
637
+ } else {
638
+ if (l2.length > l_split) { l2 = l2.substr(0,l_trunc) + '\u2026'; }
639
+ let a1 = $X('<tspan x="0" dy="-8" xmlns="http://www.w3.org/2000/svg"></tspan>');
640
+ a1.text(l1);
641
+ let a2 = $X('<tspan x="0" dy="12" xmlns="http://www.w3.org/2000/svg"></tspan>');
642
+ a2.text(l2);
643
+ lab.append(a1);
644
+ lab.append(a2);
645
+ }
646
+ } else {
647
+ if (title.length > l_split) { title = title.substr(0,l_trunc) + '\u2026'; }
648
+ lab.text(title);
649
+ }
650
+ }
651
+ let width = this.get_width(lab);
652
+ if (mid.length > 0) {
653
+ if (end.length > 0) {
654
+ let pos = get_dim(mid);
655
+ mid.attr('clip-path','url(#ele-' + id + ')');
656
+ let clip = $X('<clipPath belongs-to="element" id="ele-' + id + '" xmlns="http://www.w3.org/2000/svg">' +
657
+ '<rect x="0" y="-1" width="' + width + '" height="' + (pos.y + pos.height + 4) + '"></rect>' +
658
+ '</clipPath>');
659
+ $('defs',self.svg.container).append(clip);
660
+
661
+ end.attr('transform','translate(' + (pos.x + width - self.endclipshift - 4) + ',0)');
662
+ if (xtr.length > 0) {
663
+ xtr.attr('transform','translate(' + (pos.x + width - self.endclipshift - 4) + ',0)');
664
+ }
665
+ set_x_cond(row,col,dstart,pos.x + width - self.endclipshift - 4 + this.get_width(end) + 2 * self.width_shift_label,sname,title,subtype);
666
+ } else {
667
+ let tdim = 0;
668
+ if (self.rotated_labels && self.elements[sname].rotatelabels != false) {
669
+ lab.addClass('rotate');
670
+ tdim = self.width;
671
+ } else {
672
+ tdim = self.width + width + self.width_shift_label;
673
+ }
674
+ set_x_cond(row,col,dstart,tdim,sname,title,subtype);
675
+ }
676
+ } else {
677
+ set_x_cond(row,col,dstart,self.width,sname,title,subtype);
678
+ }
679
+ if (nor.length > 0) { nor.remove(); }
680
+ } else {
681
+ set_x_cond(row,col,dstart,self.width,sname,title,subtype);
682
+ if (sta.length > 0) { sta.remove(); }
683
+ if (mid.length > 0) { mid.remove(); }
684
+ if (end.length > 0) { end.remove(); }
685
+ }
686
+ } else {
687
+ $('.part-start',sym).remove();
688
+ $('.part-middle',sym).remove();
689
+ $('.part-end',sym).remove();
690
+ set_x_cond(row,col,dstart,self.width,sname,title,subtype);
691
+ }
692
+
299
693
  sym.attr('class','activities');
694
+ let sty = { ...self.global_style, ...style };
695
+ for (const s in sty) {
696
+ $('.colorstyle', sym).each((_,ele) => {
697
+ $(ele).css(s,sty[s]);
698
+ });
699
+ }
700
+
300
701
  $(g[0].childNodes[0]).append(sym);
702
+ if (!addition) {
703
+ // TODO change to better respresent exec
704
+ $(g[0].childNodes[0]).append(
705
+ $X('<text class="super" transform="translate(20,-2)" xmlns="http://www.w3.org/2000/svg">' +
706
+ '<tspan class="exec">▶</tspan>' +
707
+ '<tspan class="active">0</tspan>' +
708
+ '<tspan class="colon">,</tspan>' +
709
+ '<tspan class="vote">0</tspan>' +
710
+ '</text>')
711
+ );
712
+ }
301
713
 
302
714
  // Binding events for symbol
303
715
  bind_event(g,sname,true);
304
716
 
305
- if(group) {group.append(g);}
717
+ if (group) {group.append(g);}
306
718
  else {self.svg.container.children('g:first').append(g);}
719
+
307
720
  return g;
308
721
  } // }}}
309
- var bind_event = this.draw.bind_event = function(sym,tname,context) { //{{{
310
- for(event_name in adaptor.elements[tname]) {
311
- sym.bind(event_name, {'function_call':adaptor.elements[tname][event_name]}, function(e) { e.data.function_call($(this).attr('element-id'),e)});
312
- if(event_name == 'mousedown') sym.bind('contextmenu', false);
313
- }
314
- } //}}}
315
722
  var draw_border = this.draw.draw_border = function(id, p1, p2, group) { // {{{
316
- group.prepend($X('<rect element-id="' + id + '" x="' + (p1.col-0.50)*self.width + '" ' +
317
- 'y="' + (p1.row-0.80)*self.height + '" ' +
318
- 'width="' + ((p2.col+1.00)-p1.col)*self.width + '" ' +
319
- 'height="' + ((p2.row+1.00)-p1.row)*self.height +'" ' +
320
- 'class="block" rx="15" ry="15" xmlns="http://www.w3.org/2000/svg"/>'));
723
+ let bstart = get_x(p1.row,p1.col,'border from');
724
+ let bend = get_x_plus(p1.row,p2.row,p2.col,'border to');
725
+ group.prepend($X('<rect element-id="' + id + '" x="' + (bstart - 1.1 * self.width_shift - self.group_extend) + '" ' +
726
+ 'y="' + ((p1.row-1)*self.height+self.height_shift/2-self.group_extend) + '" ' +
727
+ 'width="' + (bend-bstart+2*self.group_extend) + '" ' +
728
+ 'height="' + (((p2.row+1)-p1.row)*self.height+2*self.group_extend) + '" ' +
729
+ 'class="block" rx="12" ry="12" xmlns="http://www.w3.org/2000/svg"/>'));
321
730
  } // }}}
322
731
  var draw_tile = this.draw.draw_tile = function(id, p1, p2, group) { // {{{
323
- group.prepend($X('<rect element-id="' + id + '" x="' + ((p1.col-1)*self.width + 1.3 * self.width_shift) + '" ' +
324
- 'y="' + ((p1.row-1)*self.height+self.height_shift/2) + '" ' +
325
- 'width="' + ((p2.col+1)-p1.col)*self.width + '" ' +
326
- 'height="' + ((p2.row+1)-p1.row)*self.height +'" ' +
327
- 'class="tile" rx="15" ry="15" xmlns="http://www.w3.org/2000/svg"/>'));
732
+ let bstart = get_x(p1.row,p1.col,'tile from');
733
+ let bend = get_x_plus(p1.row,p2.row,p2.col,'tile to');
734
+ group.prepend($X('<rect element-id="' + id + '" x="' + (bstart - 1.1 * self.width_shift - self.group_extend) + '" ' +
735
+ 'y="' + ((p1.row-1)*self.height+self.height_shift/2-self.group_extend) + '" ' +
736
+ 'width="' + (bend-bstart+2*self.group_extend) + '" ' +
737
+ 'height="' + (((p2.row+1)-p1.row)*self.height+2*self.group_extend) + '" ' +
738
+ 'class="tile" rx="12" ry="12" xmlns="http://www.w3.org/2000/svg"/>'));
328
739
  } // }}}
329
- var draw_connection = this.draw.draw_connection = function(group, start, end, max_line, num_lines, arrow) { // {{{
740
+ var draw_connection = this.draw.draw_connection = function(group, start, end, context_row, arrow) { // {{{
741
+ let sr = Math.min(start.row,end.row);
742
+ let cstart = get_x(sr,start.col,'conn from');
743
+ let cend = get_x(sr,end.col,'conn to');
744
+ self.dim.connections.push({from: {row: start.row, col: start.col}, to: {row: end.row, col: end.col}});
745
+
330
746
  if(((end['row']-start['row']) == 0) && ((end['col']-start['col']) == 0)) return;
331
747
  var line;
332
748
  if (arrow)
333
- line = $X('<path xmlns="http://www.w3.org/2000/svg" class="ourline" marker-end="url(#arrow)"/>');
749
+ line = $X('<path xmlns="http://www.w3.org/2000/svg" class="edge" marker-end="url(#arrow)"/>');
334
750
  else
335
- line = $X('<path xmlns="http://www.w3.org/2000/svg" class="ourline"/>');
751
+ line = $X('<path xmlns="http://www.w3.org/2000/svg" class="edge"/>');
336
752
  if (end['row']-start['row'] == 0 || end['col']-start['col'] == 0) { // straight line
337
- line.attr("d", "M " + String(start['col']*self.width) + "," + String(start['row']*self.height-15) +" "+
338
- String(end['col']*self.width) + "," + String(end['row']*self.height-15)
753
+ line.attr("d", "M " + String(cstart) + "," + String(start['row']*self.height-15) +" "+
754
+ String(cend) + "," + String(end['row']*self.height-15)
339
755
  );
340
756
  } else if (end['row']-start['row'] > 0) { // downwards
341
757
  if (end['col']-start['col'] > 0) {// left - right
342
758
  if (self.compact) {
343
- line.attr("d", "M " + String(start['col']*self.width) + "," + String(start['row']*self.height-15) +" "+
344
- String(start['col']*self.width+14) + "," + String((end['row']-1)*self.height) +" "+ // first turn of hotizontal-line going away from node
345
- String(end['col']*self.width) + "," + String((end['row']-1)*self.height) +" "+
346
- String(end['col']*self.width) + "," + String(end['row']*self.height-15)
759
+ line.attr("d", "M " + String(cstart) + "," + String(start['row']*self.height-15) +" "+
760
+ String(cstart+14) + "," + String((end['row']-1)*self.height) +" "+ // first turn of horizontal-line going away from node
761
+ String(cend) + "," + String((end['row']-1)*self.height) +" "+
762
+ String(cend) + "," + String(end['row']*self.height-15)
347
763
  );
348
764
  } else {
349
- line.attr("d", "M " + String(start['col']*self.width) + "," + String(start['row']*self.height-15) +" "+
350
- String(end['col']*self.width) + "," + String(start['row']*self.height-15) +" "+
351
- String(end['col']*self.width) + "," + String(end['row']*self.height-15)
765
+ line.attr("d", "M " + String(cstart) + "," + String(start['row']*self.height-15) +" "+
766
+ String(cend) + "," + String(start['row']*self.height-15) +" "+
767
+ String(cend) + "," + String(end['row']*self.height-15)
352
768
  );
353
769
  }
354
770
  } else { // right - left
355
- line.attr("d", "M " + String(start['col']*self.width) + "," + String(start['row']*self.height-15) +" "+
356
- String(start['col']*self.width) + "," + String(end['row']*self.height-35) +" "+
357
- String(end['col']*self.width+14) + "," + String(end['row']*self.height-35) +" "+ // last turn of horizontal-line going into the node
358
- String(end['col']*self.width) + "," + String(end['row']*self.height-15)
771
+ line.attr("d", "M " + String(cstart) + "," + String(start['row']*self.height-15) +" "+
772
+ String(cstart) + "," + String(end['row']*self.height-32) +" "+
773
+ String(cend+14) + "," + String(end['row']*self.height-32) +" "+ // last turn of horizontal-line going into the node
774
+ String(cend) + "," + String(end['row']*self.height-15)
359
775
  );
360
776
  }
361
777
  } else if(end['row']-start['row'] < 0) { // upwards
362
- if(num_lines > 1) {// ??? no idea
363
- line.attr("d", "M " + String(start['col']*self.width) + "," + String(start['row']*self.height-15) +" "+
364
- String(start['col']*self.width) + "," + String((max_line-1)*self.height+5) +" "+
365
- String(end['col']*self.width+20) + "," + String((max_line-1)*self.height+5) +" "+
366
- String(end['col']*self.width+20) + "," + String(end['row']*self.height+25)+" "+
367
- String(end['col']*self.width) + "," + String(end['row']*self.height-15)
368
- );
369
- } else {
370
- line.attr("d", "M " + String(start['col']*self.width) + "," + String(start['row']*self.height-15) +" "+
371
- String(end['col']*self.width+15) + "," + String(start['row']*self.height-15) +" "+
372
- String(end['col']*self.width+15) + "," + String(end['row']*self.height+15)+" "+
373
- String(end['col']*self.width) + "," + String(end['row']*self.height-15)
374
- );
375
- }
778
+ line.attr("d", "M " + String(cstart) + "," + String(start['row']*self.height-15) +" "+
779
+ String(cstart) + "," + String((self.dim.symbols.length-1)*self.height+4) +" "+
780
+ String(cend+15) + "," + String((self.dim.symbols.length-1)*self.height+4) +" "+
781
+ String(cend+15) + "," + String(end['row']*self.height+15)+" "+
782
+ String(cend) + "," + String(end['row']*self.height-15)
783
+ );
376
784
  }
377
785
  self.svg.container.append(line);
378
786
  } // }}}
379
787
  // }}}
788
+
380
789
  // Initialize {{{
381
- adaptor = wf_adaptor;
790
+ adaptor = wf_adaptor;
382
791
  // }}}
792
+
383
793
  } // }}}
384
794
 
385
795
  // WfDescription:
@@ -404,11 +814,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
404
814
  illustrator.draw.draw_stripe(i,graph.max.col);
405
815
  }
406
816
  }
407
- if (illustrator.compact == false) {
408
- adaptor.draw_labels(graph.max,labels,{ 'height': illustrator.height, 'height_shift': illustrator.height_shift },illustrator.striped == true ? true : false);
409
- } else {
410
- adaptor.draw_labels(graph.max,[],{ 'height': illustrator.height, 'height_shift': illustrator.height_shift },false);
411
- }
817
+ adaptor.draw_labels(graph.max,labels,{ 'height': illustrator.height, 'stripe_height': illustrator.default_height, 'height_shift': illustrator.height_shift },illustrator.striped == true ? true : false);
412
818
  } //}}}
413
819
 
414
820
  // Generic Functions {{{
@@ -424,11 +830,12 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
424
830
  }
425
831
  id_counter = {};
426
832
  labels = [];
833
+ let start = performance.now();
427
834
  illustrator.clear();
428
- var graph = parse(description.children('description').get(0), {'row':0,'col':0,dim:{},final:false,wide:false});
835
+ var graph = parse(description.children('description').get(0), {'row':0,'col':0,final:false,wide:false});
429
836
  illustrator.set_svg(graph);
430
- // set labels
431
837
  self.set_labels(graph);
838
+ illustrator.set_duration(start);
432
839
  } // }}}
433
840
  var gd = this.get_description = function() { // public {{{
434
841
  var serxml = $(description.get(0).documentElement).clone(true);
@@ -476,21 +883,24 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
476
883
  var refresh = this.refresh = function(doit) {
477
884
  id_counter = {};
478
885
  labels = [];
886
+ let start = performance.now();
479
887
  illustrator.clear();
480
- var graph = parse(description.children('description').get(0), {'row':0,'col':0,dim:{}});
888
+ var graph = parse(description.children('description').get(0), {'row':0,'col':0});
481
889
  illustrator.set_svg(graph);
482
- // set labels
483
890
  self.set_labels(graph);
891
+ illustrator.set_duration(start);
484
892
  doit(self);
485
893
  }
486
894
  var update = this.update = function(svgid) { // {{{
487
895
  id_counter = {};
488
896
  if(update_illustrator){
897
+ let start = performance.now();
489
898
  labels = [];
490
899
  illustrator.clear();
491
- var graph = parse(description.children('description').get(0), {'row':0,'col':0,dim:{}});
900
+ var graph = parse(description.children('description').get(0), {'row':0,'col':0});
492
901
  illustrator.set_svg(graph);
493
902
  self.set_labels(graph);
903
+ illustrator.set_duration(start);
494
904
  }
495
905
 
496
906
  var newn = $('*[new=true]',description);
@@ -567,15 +977,13 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
567
977
  // }}}
568
978
  // Helper Functions {{{
569
979
  var parse = function(root, parent_pos) { // private {{{
570
- var pos = $.extend(true, {}, parent_pos);
980
+ var pos = JSON.parse(JSON.stringify(parent_pos));
571
981
  var max = {'row': 0,'col': 0};
572
982
  var prev = [parent_pos]; // connects parent with child(s), depending on the expansion
573
983
  var endnodes = [];
574
984
  var sname = sym_name(root.tagName,root);
575
985
  var root_expansion = illustrator.elements[root.tagName].expansion(root);
576
- var block = {'max':{}}; // e.g. {'max':{'row':0,'col':0}, 'endpoints':[]};
577
-
578
- var group = $X('<g class="group" xmlns="http://www.w3.org/2000/svg"/>');
986
+ var block = { 'max': {'row': pos.row, 'col': pos.col}, 'endnodes': [], 'svg': $X('<g class="group" xmlns="http://www.w3.org/2000/svg"/>') };
579
987
 
580
988
  if(root_expansion == 'horizontal') pos.row++;
581
989
  if(illustrator.elements[root.tagName].col_shift(root) == true && root_expansion != 'horizontal') pos.col++;
@@ -585,12 +993,13 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
585
993
  $(root).attr('svg-id','description');
586
994
  $(root).attr('svg-type','description');
587
995
  $(root).attr('svg-subtype','description');
588
- group.attr('element-id','group-description');
996
+ block.svg.attr('element-id','group-description');
589
997
  if (illustrator.elements[sname].label) {
590
998
  // javascript object spread syntax is my new weird crush - the JS designers must be serious people
591
999
  labels.push({...{row: pos.row, element_id: 'start', tname: 'start', label: illustrator.elements[sname].label(root)},...illustrator.draw.get_y(pos.row)});
592
1000
  }
593
- illustrator.draw.draw_symbol(sname, 'description', 'START', pos.row, pos.col, group);
1001
+ illustrator.global_style = (illustrator.elements[sname].style && root) ? illustrator.elements[sname].style(root) : {};
1002
+ illustrator.draw.draw_symbol(sname, 'description', 'START', pos.row, pos.row, pos.row, pos.col, block.svg, false, {}, {})
594
1003
  } // }}}
595
1004
 
596
1005
  $(root).children().filter(function(){ return this.localName[0] != '_'; }).each(function() {
@@ -599,13 +1008,19 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
599
1008
  var sname = sym_name(tname,context);
600
1009
  pos.final = illustrator.elements[sname].final ? true : false;
601
1010
  pos.wide = illustrator.elements[sname].wide ? true : false;
1011
+ pos.noindent = illustrator.elements[sname].noindent ? true : false;
602
1012
 
603
1013
  // Calculate next position {{{
604
- if(root_expansion == 'vertical') pos.row++;
1014
+ if(root_expansion == 'vertical') { pos.row++; }
605
1015
  if(root_expansion == 'horizontal') {
606
- pos.col++;
1016
+ // for noindent themes do not indent the first column
1017
+ if (!pos.noindent || (pos.noindent && endnodes.length > 1)) {
1018
+ illustrator.dim.set_x(pos.row,pos.col,illustrator.width,sname);
1019
+ pos.col++;
1020
+ }
607
1021
  if (!illustrator.compact) {
608
1022
  if (block.max.row) {
1023
+ illustrator.dim.set_x(pos.row,pos.col,illustrator.width,sname);
609
1024
  pos.row = block.max.row + 1;
610
1025
  }
611
1026
  }
@@ -614,8 +1029,22 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
614
1029
  if(illustrator.elements[tname] != undefined && illustrator.elements[tname].type == 'complex') {
615
1030
  if(illustrator.elements[tname] != undefined && !illustrator.elements[tname].svg) pos.row--;
616
1031
  // TODO: Remaining problem is the order inside the svg. Thats why the connection is above the icon
617
- block = parse(context, $.extend(true, {}, pos));
618
- group.append(block.svg);
1032
+
1033
+ illustrator.dim.set_x(pos.row,pos.col,illustrator.width,sname);
1034
+ // but fuuuuu, we calculate the gateways only later, so we couldnt even have them bigger for now
1035
+
1036
+ // console.log('----> down', tname, parent_pos.row, pos.row, parent_pos.col, pos.col, illustrator.dim.debug());
1037
+
1038
+ let tblock = parse(context, JSON.parse(JSON.stringify(pos)));
1039
+
1040
+ // merge block and tblock, enforce the max, as the second branch could have fewer nodes than the first
1041
+ block.max.row = Math.max(block.max.row,tblock.max.row);
1042
+ block.max.col = Math.max(block.max.col,tblock.max.col);
1043
+ block.endnodes = tblock.endnodes;
1044
+
1045
+ // console.log('<---- up', tname, parent_pos.row, block.max.row, parent_pos.col, block.max.col, illustrator.dim.debug());
1046
+
1047
+ block.svg.append(tblock.svg);
619
1048
  block.svg.attr('id', 'group-' + $(context).attr('svg-id'));
620
1049
  if(illustrator.elements[sname].endnodes == 'aggregate') endnodes = []; // resets endpoints e.g. potential preceding primitive
621
1050
  } else {
@@ -623,19 +1052,17 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
623
1052
  block.max.row = pos.row;
624
1053
  block.max.col = pos.col;
625
1054
  block.endnodes = [pos];
626
- block.svg = group;
627
1055
  }
628
1056
  }
629
1057
  // }}}
630
1058
 
631
1059
  var g;
632
1060
  set_details(tname,sname,pos,context);
633
-
634
- var origpos = $.extend(true, {}, pos);
635
- [g, endnodes] = draw_position(tname,origpos,prev,block,group,endnodes,context);
1061
+ var origpos = JSON.parse(JSON.stringify(pos));
1062
+ [g, endnodes] = draw_position(tname,parent_pos,origpos,prev,block,endnodes,context);
636
1063
 
637
1064
  // Prepare next iteration {{{
638
- if(root_expansion == 'vertical') { prev = $.extend(true, {}, endnodes); pos.row = block.max.row;} // covers e.g. input's for alternative, parallel_branch, ... everything with horizontal expansion
1065
+ if(root_expansion == 'vertical') { prev = JSON.parse(JSON.stringify(endnodes)); pos.row = block.max.row;} // covers e.g. input's for alternative, parallel_branch, ... everything with horizontal expansion
639
1066
  if(root_expansion == 'horizontal') pos.col = block.max.col;
640
1067
  if(max.row < block.max.row) max.row = block.max.row;
641
1068
  if(max.col < block.max.col) max.col = block.max.col;
@@ -653,13 +1080,14 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
653
1080
  max.col++;
654
1081
  block.max.col = pos.col;
655
1082
  }
656
- draw_position(ctname,pos,block.endnodes,block,group,[],context,{svg: g, pos: origpos});
1083
+ draw_position(ctname,parent_pos,pos,block.endnodes,block,[],context,{svg: g, pos: origpos});
657
1084
  pos.col--;
1085
+ set_details(ctname,csname,pos,context,true);
658
1086
  } else {
659
- [undefined, endnodes] = draw_position(ctname,pos,prev,block,group,[],context,{svg: g, pos: origpos});
1087
+ set_details(ctname,csname,pos,context,true);
1088
+ [undefined, endnodes] = draw_position(ctname,parent_pos,pos,prev,block,[],context,{svg: g, pos: origpos});
660
1089
  }
661
- set_details(ctname,csname,pos,context,true);
662
- prev = $.extend(true, {}, endnodes);
1090
+ prev = JSON.parse(JSON.stringify(endnodes));
663
1091
  }
664
1092
  });
665
1093
 
@@ -672,10 +1100,10 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
672
1100
  if(root.tagName == 'description' && illustrator.elements[root.tagName].closing_symbol) {
673
1101
  pos.row++;
674
1102
  max.row = pos.row;
675
- draw_position(illustrator.elements['start'].closing_symbol,pos,prev,block,group,[],this,{svg: group, pos: pos});
1103
+ draw_position(illustrator.elements['start'].closing_symbol,parent_pos,pos,prev,block,[],this,{svg: block.svg, pos: pos});
676
1104
  }
677
1105
 
678
- return {'endnodes': endnodes, 'max':max, 'svg':group};
1106
+ return {'endnodes': endnodes, 'max':max, 'svg': block.svg};
679
1107
  } // }}}
680
1108
  var sym_name = function(tname,context) { //{{{
681
1109
  var sname;
@@ -697,39 +1125,51 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
697
1125
  }
698
1126
  if (illustrator.elements[sname].label) {
699
1127
  var lab = illustrator.elements[sname].label(context);
700
- if (lab && lab[0] && lab[0].value && lab[0].column == 'Label' && lab[0].value != '') {
701
- $(context).attr('svg-label', lab[0].value);
1128
+ if (lab) {
1129
+ for (let i=0; i<lab.length; i++) {
1130
+ if (lab[i] && lab[i].value && lab[i].column == 'Label' && lab[i].value != '') {
1131
+ $(context).attr('svg-label', lab[0].value);
1132
+ if (illustrator.compact) {
1133
+ lab.splice(i,1);
1134
+ }
1135
+ }
1136
+ }
1137
+ labels.push({...{row: pos.row, element_id: $(context).attr('svg-id'), tname: tname, label: lab},...illustrator.draw.get_y(pos.row)});
702
1138
  }
703
- labels.push({...{row: pos.row, element_id: $(context).attr('svg-id'), tname: tname, label: lab},...illustrator.draw.get_y(pos.row)});
704
1139
  }
705
1140
  } //}}}
706
- var draw_position = function(tname,pos,prev,block,group,endnodes,context,second) { // private {{{
1141
+ var draw_position = function(tname,parent_pos,pos,prev,block,endnodes,context,second) { // private {{{
707
1142
  var sname = sym_name(tname,context);
1143
+ // console.log('----- pos ' + sname, parent_pos.row, block.max.row, parent_pos.col, block.max.col, block, illustrator.dim.debug());
1144
+
708
1145
  // Draw Symbol {{{
1146
+ let style = {};
1147
+ if (illustrator.elements[sname].style && context) {
1148
+ style = illustrator.elements[sname].style(context);
1149
+ }
709
1150
  if (second) {
710
- illustrator.draw.draw_symbol(sname, $(context).attr('svg-id'), $(context).attr('svg-label'), pos.row, pos.col, second.svg, true).addClass(illustrator.elements[sname] ? illustrator.elements[sname].type : 'primitive unknown');
1151
+ // wide is only for the special case of variable parallel, only event_end has it, all others should reference the first row
1152
+ illustrator.draw.draw_symbol(sname, $(context).attr('svg-id'), $(context).attr('svg-label'), illustrator.elements[sname].wide == true ? parent_pos.row+1 : parent_pos.row, block.max.row, pos.row, pos.col, second.svg, true, {}, style).addClass(illustrator.elements[sname] ? illustrator.elements[sname].type : 'primitive unknown');
711
1153
  } else {
712
1154
  $(context).attr('svg-type',tname);
713
1155
  $(context).attr('svg-subtype',sname);
714
1156
  if((illustrator.elements[sname] && illustrator.elements[sname].svg) || sname == 'unknown') {
715
- var g = illustrator.draw.draw_symbol(sname, $(context).attr('svg-id'), $(context).attr('svg-label'), pos.row, pos.col, block.svg).addClass(illustrator.elements[sname] ? illustrator.elements[sname].type : 'primitive unknown');
716
- if (illustrator.elements[sname].info) {
717
- var info = illustrator.elements[sname].info(context);
718
- _.each(info,function(val,key) {
719
- g.attr(key, val);
720
- });
1157
+ let info = {};
1158
+ if (illustrator.elements[sname].info && context) {
1159
+ info = illustrator.elements[sname].info(context);
721
1160
  }
1161
+ var g = illustrator.draw.draw_symbol(sname, $(context).attr('svg-id'), $(context).attr('svg-label'), parent_pos.row, block.max.row, pos.row, pos.col, block.svg, false, info, style).addClass(illustrator.elements[sname] ? illustrator.elements[sname].type : 'primitive unknown');
722
1162
  } else { console.log("no icon "+ sname);}
723
- if(illustrator.elements[sname] && illustrator.elements[sname].border) {
724
- var wide = (illustrator.elements[sname].wide == true && block.max.col == pos.col) ? pos.col + 1 : block.max.col;
1163
+ if (illustrator.elements[sname] && illustrator.elements[sname].border) {
1164
+ let wide = (illustrator.elements[sname].wide == true && block.max.col == pos.col) ? pos.col + 1 : block.max.col;
725
1165
  if (illustrator.elements[sname].closing_symbol) {
726
1166
  illustrator.draw.draw_border($(context).attr('svg-id'), pos, { col: wide, row: block.max.row + 1 }, block.svg);
727
1167
  } else {
728
1168
  illustrator.draw.draw_border($(context).attr('svg-id'), pos, { col: wide, row: block.max.row }, block.svg);
729
1169
  }
730
1170
  }
731
- if(illustrator.elements[sname] && illustrator.elements[sname].type == 'complex') {
732
- var wide = (illustrator.elements[sname].wide == true && block.max.col == pos.col) ? pos.col + 1 : block.max.col;
1171
+ if (illustrator.elements[sname] && illustrator.elements[sname].type == 'complex') {
1172
+ let wide = (illustrator.elements[sname].wide == true && block.max.col == pos.col) ? pos.col + 1 : block.max.col;
733
1173
  if (illustrator.elements[sname].closing_symbol) {
734
1174
  illustrator.draw.draw_tile($(context).attr('svg-id'), pos, { col: wide, row: block.max.row + 1 }, block.svg);
735
1175
  } else {
@@ -738,48 +1178,72 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
738
1178
  }
739
1179
  }
740
1180
  // }}}
1181
+
741
1182
  // Calculate Connection {{{
1183
+ let connection_case = 0;
742
1184
  if(illustrator.elements[sname] != undefined && illustrator.elements[sname].closeblock == true) { // Close Block if element e.g. loop
743
1185
  if (second) {
744
1186
  if (second.pos.row+1 < pos.row) { // when no content, dont paint the up arrow
745
- illustrator.draw.draw_connection(group, pos, second.pos, block.max.row+1, 1, true);
1187
+ connection_case = 1;
1188
+ // console.log('++ case 1',prev[node].row,pos.row,illustrator.dim.debug());
1189
+ illustrator.draw.draw_connection(block.svg, pos, second.pos, 0, true);
746
1190
  }
747
1191
  } else {
748
- for(node in block.endnodes) {
749
- if (!block.endnodes[node].final) {
750
- illustrator.draw.draw_connection(group, block.endnodes[node], pos, block.max.row+1, block.endnodes.length, true);
1192
+ for (let node=0; node < block.endnodes.length; node++) {
1193
+ if (block.endnodes[node] && !block.endnodes[node].final) {
1194
+ connection_case = 2;
1195
+ // console.log('++ case 2',prev[node].row,pos.row,illustrator.dim.debug());
1196
+ illustrator.draw.draw_connection(block.svg, block.endnodes[node], pos, 0, true);
751
1197
  }
752
1198
  }
753
1199
  }
754
1200
  }
755
1201
  if(illustrator.elements[sname] != undefined && illustrator.elements[sname].endnodes != 'this') {
756
1202
  for(i in block.endnodes) { endnodes.push(block.endnodes[i]); } // collects all endpoints from different childs e.g. alternatives from choose
757
- } else { endnodes = [$.extend(true, {}, pos)]; } // sets this element as only endpoint (aggregate)
1203
+ } else { endnodes = [JSON.parse(JSON.stringify(pos))]; } // sets this element as only endpoint (aggregate)
758
1204
  if(prev[0].row == 0 || prev[0].col == 0) { // this enforces the connection from description to the first element
759
- illustrator.draw.draw_connection(group, { row: 1, col: 1 }, pos, null, null, true);
1205
+ connection_case = 3;
1206
+ illustrator.draw.draw_connection(block.svg, { row: 1, col: 1 }, pos, 0, true);
760
1207
  } else {
761
1208
  if (illustrator.elements[sname].noarrow == undefined || illustrator.elements[sname].noarrow == false) {
762
- for (node in prev) {
763
- if (!prev[node].final) {
1209
+ for (let node=0; node < prev.length; node++) {
1210
+ if (prev[node] && !prev[node].final) {
764
1211
  if (prev[node].wide) {
765
- var pn = $.extend(true, {}, prev[node]);
1212
+ var pn = JSON.parse(JSON.stringify(prev[node]));
766
1213
  if (pos.col > prev[node].col) {
767
1214
  pn.col = pos.col;
768
1215
  }
769
- illustrator.draw.draw_connection(group, pn, pos, null, null, true);
1216
+ connection_case = 4;
1217
+ // console.log('++ case 4',prev[node].row,pos.row,illustrator.dim.debug());
1218
+ illustrator.draw.draw_connection(block.svg, pn, pos, 0, true);
770
1219
  } else {
771
- illustrator.draw.draw_connection(group, prev[node], pos, null, null, true);
1220
+ connection_case = 5;
1221
+ if (prev.length == 1) {
1222
+ // console.log('++ case 5a',parent_pos.row, '---', prev[node].row,pos.row,illustrator.dim.debug());
1223
+ illustrator.draw.draw_connection(block.svg, prev[node], pos, 0, true);
1224
+ } else {
1225
+ // console.log('++ case 5b',prev[node].row,pos.row,illustrator.dim.debug());
1226
+ illustrator.draw.draw_connection(block.svg, prev[node], pos, 0, true);
1227
+ }
772
1228
  }
773
1229
  }
774
1230
  }
775
1231
  } else {
776
- for(node in prev) {
777
- if (!prev[node].final)
778
- illustrator.draw.draw_connection(group, prev[node], pos, null, null, false);
1232
+ for (let node=0; node < prev.length; node++) {
1233
+ if (prev[node] && !prev[node].final) {
1234
+ connection_case = 6;
1235
+ // console.log('++ case 6',prev[node].row,pos.row,illustrator.dim.debug());
1236
+ illustrator.draw.draw_connection(block.svg, prev[node], pos, prev[node].row, false);
1237
+ }
779
1238
  }
780
1239
  }
781
1240
  }
782
1241
  // }}}
1242
+
1243
+ ///////// show graph step by step
1244
+ // illustrator.set_svg_direct(block.svg);
1245
+ // debugger;
1246
+
783
1247
  return [g, endnodes];
784
1248
  } // }}}
785
1249
  // }}}