cpee 2.1.91 → 2.1.92

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