main_window.xml 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339
  1. <class name="MainWindow">
  2. <relationships>
  3. <inheritance class="tk.Toplevel" priority="1"/>
  4. <inheritance class="SCCDWidget" priority="0"/>
  5. <association name="parent" class="A"/>
  6. <association name="generic_toolbars" class="Toolbar"/>
  7. <association name="model_toolbars" class="Toolbar"/>
  8. <association name="subwindow" class="Window"/>
  9. <association name="canvas" class="Canvas"/>
  10. <association name="error_log" class="Errorlog"/>
  11. <association name="progress_bar" class="ProgressBar"/>
  12. </relationships>
  13. <constructor>
  14. <super class="tk.Toplevel"/>
  15. <super class="SCCDWidget"/>
  16. <parameter name="open_model"/>
  17. <parameter name="limited_mode"/>
  18. <body>
  19. self.toolbar_frame = tk.Frame(self)
  20. self.progressbar_frame = tk.Frame(self)
  21. self.modelling_frame = tk.Frame(self)
  22. self.canvas_frame = tk.Frame(self.modelling_frame)
  23. self.error_log_frame = tk.Frame(self.modelling_frame)
  24. self.toolbar_frame.pack(fill=tk.X)
  25. self.modelling_frame.pack(fill=tk.BOTH, expand=tk.TRUE)
  26. self.canvas_frame.pack(fill=tk.BOTH, expand=tk.TRUE, side=tk.LEFT)
  27. self.error_log_frame.pack(fill=tk.Y, expand=tk.FALSE, side=tk.RIGHT, anchor=tk.E)
  28. self.progressbar_frame.pack(fill=tk.X)
  29. self.model_loaded = False
  30. self.preload_model = open_model
  31. self.limited_mode = limited_mode
  32. global current_mapper
  33. current_mapper = None
  34. global current_rendered_model
  35. current_rendered_model = None
  36. global current_metamodel
  37. current_metamodel = None
  38. global current_model
  39. current_model = None
  40. </body>
  41. </constructor>
  42. <destructor>
  43. <body>
  44. self.destroy()
  45. </body>
  46. </destructor>
  47. <scxml initial="init">
  48. <parallel id="init">
  49. <state id="init" initial="init">
  50. <state id="init" initial="determine_initial">
  51. <state id="determine_initial">
  52. <transition cond="self.limited_mode" target="../progressbar"/>
  53. <transition cond="not self.limited_mode" target="../generic_toolbar"/>
  54. </state>
  55. <state id="generic_toolbar">
  56. <onentry>
  57. <raise event="create_instance" scope="cd">
  58. <parameter expr="'generic_toolbars'"/>
  59. <parameter expr="'GenericToolbar'"/>
  60. <parameter expr="self.toolbar_frame"/>
  61. </raise>
  62. </onentry>
  63. <transition event="instance_created" target="../pack_generic">
  64. <parameter name="association_name"/>
  65. <raise event="start_instance" scope="cd">
  66. <parameter expr="association_name"/>
  67. </raise>
  68. </transition>
  69. </state>
  70. <state id="pack_generic">
  71. <transition event="tk_widget" target="../progressbar">
  72. <parameter name="tk_elem"/>
  73. <script>
  74. tk_elem.pack(anchor=tk.NW)
  75. </script>
  76. </transition>
  77. </state>
  78. <state id="progressbar">
  79. <onentry>
  80. <raise event="create_instance" scope="cd">
  81. <parameter expr="'progress_bar'"/>
  82. <parameter expr="'ProgressBar'"/>
  83. <parameter expr="{'parent': self.progressbar_frame}"/>
  84. </raise>
  85. </onentry>
  86. <transition event="instance_created" target="../pack_progressbar">
  87. <parameter name="association_name"/>
  88. <raise event="start_instance" scope="cd">
  89. <parameter expr="association_name"/>
  90. </raise>
  91. </transition>
  92. </state>
  93. <state id="pack_progressbar">
  94. <transition event="tk_widget" target="../error_log">
  95. <parameter name="tk_elem"/>
  96. <script>
  97. tk_elem.pack(side=tk.BOTTOM, fill=tk.X, expand=tk.TRUE)
  98. print("Pack progress")
  99. </script>
  100. </transition>
  101. </state>
  102. <state id="error_log">
  103. <onentry>
  104. <raise event="create_instance" scope="cd">
  105. <parameter expr="'error_log'"/>
  106. <parameter expr="'Errorlog'"/>
  107. <parameter expr="{'parent': self.error_log_frame}"/>
  108. </raise>
  109. </onentry>
  110. <transition event="instance_created" target="../../running">
  111. <parameter name="association_name"/>
  112. <raise event="start_instance" scope="cd">
  113. <parameter expr="association_name"/>
  114. </raise>
  115. <script>
  116. print("Packed errorlog")
  117. </script>
  118. </transition>
  119. </state>
  120. </state>
  121. <state id="running" initial="idle">
  122. <state id="idle">
  123. <onentry>
  124. <raise event="update_status" scope="narrow" target="'progress_bar'">
  125. <parameter expr="0"/>
  126. <parameter expr="'Ready for action!'"/>
  127. </raise>
  128. </onentry>
  129. <transition event="create_new_model" target="../create_new_model"/>
  130. <transition event="open_model" target="../open_model"/>
  131. <transition event="rerender_model" target="../rerender_model"/>
  132. <transition event="minimal_rerender_model" target="../rerender_model/request_render"/>
  133. <transition event="new_rendered" cond="current_mapper is not None" target="../new_rendered"/>
  134. <transition event="verify" target="../verify_model"/>
  135. <transition event="conf_bottom" target="../conf_bottom"/>
  136. <transition event="custom_MM" target="../custom_MM"/>
  137. <transition event="upload_MVC" target="../upload_MVC"/>
  138. <transition event="add_object_diagrams" target="../add_object_diagrams"/>
  139. <transition event="activity" target="../execute_activity"/>
  140. <transition event="create_activity" target="../create_activity"/>
  141. <transition event="enact_process" target="../enact_process"/>
  142. <transition event="modify_defined_attrs" target="../modify_defined_attrs">
  143. <parameter name="as_element"/>
  144. <parameter name="cs_element"/>
  145. <script>
  146. self.as_element = as_element
  147. self.cs_element = cs_element
  148. </script>
  149. </transition>
  150. <transition event="change_metamodel" target="../change_metamodel">
  151. <parameter name="new_metamodel"/>
  152. <script>
  153. global current_metamodel
  154. current_metamodel = new_metamodel
  155. </script>
  156. </transition>
  157. <transition event="change_mapper" target="../change_mapper">
  158. <parameter name="new_mapper"/>
  159. <script>
  160. global current_mapper
  161. if new_mapper == "(none)":
  162. current_mapper = None
  163. else:
  164. current_mapper = new_mapper
  165. </script>
  166. </transition>
  167. <transition event="change_rendered" target="../change_rendered">
  168. <parameter name="new_rendered"/>
  169. <script>
  170. global current_rendered_model
  171. current_rendered_model = new_rendered
  172. </script>
  173. </transition>
  174. <transition event="select_for_creation" target=".">
  175. <parameter name="element_name"/>
  176. <raise event="select_for_creation" scope="narrow" target="'canvas'">
  177. <parameter expr="element_name"/>
  178. </raise>
  179. </transition>
  180. <transition cond="self.preload_model is not None" target="../open_model/search_metamodels">
  181. <script>
  182. global current_model
  183. current_model = self.preload_model
  184. self.preload_model = None
  185. self.locations = {}
  186. </script>
  187. </transition>
  188. </state>
  189. <state id="modify_defined_attrs" initial="create_window">
  190. <state id="create_window">
  191. <onentry>
  192. <raise event="create_instance" scope="cd">
  193. <parameter expr="'subwindow'"/>
  194. <parameter expr="'AttributeEditor'"/>
  195. <parameter expr="self.as_element"/>
  196. </raise>
  197. </onentry>
  198. <transition event="instance_created" target="../wait_for_finished">
  199. <parameter name="assoc_name"/>
  200. <raise event="start_instance" scope="cd">
  201. <parameter expr="assoc_name"/>
  202. </raise>
  203. <script>
  204. self.current_window = assoc_name
  205. </script>
  206. </transition>
  207. </state>
  208. <state id="wait_for_finished">
  209. <transition event="close_window" cond="current_rendered_model is not None" target="../mark_dirty">
  210. <raise event="delete_instance" scope="cd">
  211. <parameter expr="self.current_window"/>
  212. </raise>
  213. </transition>
  214. <transition event="close_window" cond="current_rendered_model is None" target="../../rerender_model/request_render">
  215. <raise event="delete_instance" scope="cd">
  216. <parameter expr="self.current_window"/>
  217. </raise>
  218. </transition>
  219. </state>
  220. <state id="mark_dirty">
  221. <onentry>
  222. <raise event="mv_request" scope="broad">
  223. <parameter expr="'attr_assign'"/>
  224. <parameter expr="[current_rendered_model, self.cs_element, 'dirty', True]"/>
  225. </raise>
  226. </onentry>
  227. <transition event="mv_response" target="../../rerender_model/request_render"/>
  228. </state>
  229. </state>
  230. <state id="execute_activity" initial="open_window">
  231. <state id="open_window">
  232. <onentry>
  233. <raise event="create_instance" scope="cd">
  234. <parameter expr="'subwindow'"/>
  235. <parameter expr="'ActivityExecutor'"/>
  236. </raise>
  237. </onentry>
  238. <transition event="instance_created" target="../waiting">
  239. <parameter name="assoc_name"/>
  240. <raise event="start_instance" scope="cd">
  241. <parameter expr="assoc_name"/>
  242. </raise>
  243. <script>
  244. self.activity_executor = assoc_name
  245. </script>
  246. </transition>
  247. </state>
  248. <state id="waiting">
  249. <transition event="window_close" target="../../idle">
  250. <raise event="delete_instance" scope="cd">
  251. <parameter expr="self.activity_executor"/>
  252. </raise>
  253. </transition>
  254. </state>
  255. </state>
  256. <state id="create_activity" initial="open_window">
  257. <state id="open_window">
  258. <onentry>
  259. <raise event="create_instance" scope="cd">
  260. <parameter expr="'subwindow'"/>
  261. <parameter expr="'ActivityCreator'"/>
  262. </raise>
  263. </onentry>
  264. <transition event="instance_created" target="../waiting">
  265. <parameter name="assoc_name"/>
  266. <raise event="start_instance" scope="cd">
  267. <parameter expr="assoc_name"/>
  268. </raise>
  269. <script>
  270. self.activity_creator = assoc_name
  271. </script>
  272. </transition>
  273. </state>
  274. <state id="waiting">
  275. <transition event="close_window" target="../../idle">
  276. <raise event="delete_instance" scope="cd">
  277. <parameter expr="self.activity_creator"/>
  278. </raise>
  279. </transition>
  280. </state>
  281. </state>
  282. <state id="enact_process" initial="open_window">
  283. <state id="open_window">
  284. <onentry>
  285. <raise event="create_instance" scope="cd">
  286. <parameter expr="'subwindow'"/>
  287. <parameter expr="'ProcessEnactor'"/>
  288. </raise>
  289. </onentry>
  290. <transition event="instance_created" target="../waiting">
  291. <parameter name="assoc_name"/>
  292. <raise event="start_instance" scope="cd">
  293. <parameter expr="assoc_name"/>
  294. </raise>
  295. <script>
  296. self.process_enactor = assoc_name
  297. </script>
  298. </transition>
  299. </state>
  300. <state id="waiting">
  301. <transition event="window_close" target="../../idle">
  302. <raise event="delete_instance" scope="cd">
  303. <parameter expr="self.process_enactor"/>
  304. </raise>
  305. </transition>
  306. </state>
  307. </state>
  308. <state id="add_object_diagrams" initial="init">
  309. <state id="init">
  310. <onentry>
  311. <script>
  312. self.subprocess = subprocess.Popen([sys.executable, "add_render_OD.py", current_metamodel])
  313. </script>
  314. <raise event="update_status" scope="narrow" target="'progress_bar'">
  315. <parameter expr="10"/>
  316. <parameter expr="'Adding transformation...'"/>
  317. </raise>
  318. </onentry>
  319. <transition cond="self.subprocess.poll() is not None" target="../../open_model/search_CS_mappers">
  320. <script>
  321. global current_mapper
  322. current_mapper = 'models/render_OD/' + current_metamodel
  323. </script>
  324. </transition>
  325. </state>
  326. </state>
  327. <state id="upload_MVC" initial="load_code">
  328. <state id="load_code">
  329. <onentry>
  330. <raise event="create_instance" scope="cd">
  331. <parameter expr="'subwindow'"/>
  332. <parameter expr="'FileBrowser'"/>
  333. <parameter expr="'Select model code.'"/>
  334. </raise>
  335. <script>
  336. self.filename = None
  337. </script>
  338. </onentry>
  339. <transition event="instance_created" target="../waiting">
  340. <parameter name="result"/>
  341. <raise event="start_instance" scope="cd">
  342. <parameter expr="result"/>
  343. </raise>
  344. </transition>
  345. </state>
  346. <state id="waiting">
  347. <transition event="browse_result" target=".">
  348. <parameter name="result"/>
  349. <script>
  350. self.filename = result
  351. </script>
  352. </transition>
  353. <transition event="close_window" target="../got_filename">
  354. <raise event="delete_instance" scope="cd">
  355. <parameter expr="'subwindow'"/>
  356. </raise>
  357. </transition>
  358. </state>
  359. <state id="got_filename">
  360. <transition cond="self.filename is not None" target="../overwriting_model">
  361. <raise event="mv_request" scope="broad">
  362. <parameter expr="'model_overwrite'"/>
  363. <parameter expr="[current_model, open(self.filename, 'r').read()]"/>
  364. </raise>
  365. <raise event="update_status" scope="narrow" target="'progress_bar'">
  366. <parameter expr="10"/>
  367. <parameter expr="'Uploading model...'"/>
  368. </raise>
  369. </transition>
  370. <transition cond="self.filename is None" target="../../idle"/>
  371. </state>
  372. <state id="overwriting_model">
  373. <transition event="mv_response" target="../../rerender_model">
  374. <raise event="update_status" scope="narrow" target="'progress_bar'">
  375. <parameter expr="50"/>
  376. <parameter expr="'Rerendering model...'"/>
  377. </raise>
  378. </transition>
  379. </state>
  380. </state>
  381. <state id="change_metamodel">
  382. <onentry>
  383. <raise event="update_status" scope="narrow" target="'progress_bar'">
  384. <parameter expr="20"/>
  385. <parameter expr="'Storing model context...'"/>
  386. </raise>
  387. <raise event="mv_request" scope="broad">
  388. <parameter expr="'alter_context'"/>
  389. <parameter expr="[current_model, current_metamodel]"/>
  390. </raise>
  391. </onentry>
  392. <transition target="../open_model/search_CS_mappers"/>
  393. </state>
  394. <state id="conf_bottom" initial="check_if_exists">
  395. <state id="check_if_exists">
  396. <transition cond="'formalisms/Bottom' in self.allowed_metamodels" target="../../idle"/>
  397. <transition cond="'formalisms/Bottom' not in self.allowed_metamodels" target="../add_bottom"/>
  398. </state>
  399. <state id="add_bottom">
  400. <onentry>
  401. <raise event="mv_request" scope="broad">
  402. <parameter expr="'conformance_add'"/>
  403. <parameter expr="[current_model, 'formalisms/Bottom']"/>
  404. </raise>
  405. <raise event="update_status" scope="narrow" target="'progress_bar'">
  406. <parameter expr="10"/>
  407. <parameter expr="'Storing model context...'"/>
  408. </raise>
  409. <script>
  410. global current_metamodel
  411. current_metamodel = 'formalisms/Bottom'
  412. </script>
  413. </onentry>
  414. <transition event="mv_response" target="../../open_model/search_metamodels"/>
  415. </state>
  416. </state>
  417. <state id="custom_MM" initial="query">
  418. <state id="query">
  419. <onentry>
  420. <raise event="create_instance" scope="cd">
  421. <parameter expr="'subwindow'"/>
  422. <parameter expr="'Browser'"/>
  423. <parameter expr="'Select metamodel to use.'"/>
  424. <parameter expr="['formalisms/SimpleClassDiagrams']"/>
  425. </raise>
  426. <raise event="update_status" scope="narrow" target="'progress_bar'">
  427. <parameter expr="0"/>
  428. <parameter expr="'Browsing for metamodel...'"/>
  429. </raise>
  430. </onentry>
  431. <transition event="instance_created" target="../wait_for_metamodel">
  432. <parameter name="association_name"/>
  433. <raise event="start_instance" scope="cd">
  434. <parameter expr="association_name"/>
  435. </raise>
  436. <script>
  437. self.subwindow = association_name
  438. </script>
  439. </transition>
  440. </state>
  441. <state id="wait_for_metamodel" initial="wait_for_result">
  442. <onentry>
  443. <raise event="update_status" scope="narrow" target="'progress_bar'">
  444. <parameter expr="10"/>
  445. <parameter expr="'Browsing for model... OK'"/>
  446. </raise>
  447. </onentry>
  448. <state id="wait_for_result">
  449. <transition event="browse_result" cond="result not in self.allowed_metamodels" target="../got_result">
  450. <parameter name="result"/>
  451. <script>
  452. global current_metamodel
  453. current_metamodel = result
  454. </script>
  455. <raise event="mv_request" scope="broad">
  456. <parameter expr="'alter_context'"/>
  457. <parameter expr="[current_model, current_metamodel]"/>
  458. </raise>
  459. </transition>
  460. <transition event="close_window" target="../../../idle">
  461. <raise event="delete_instance" scope="cd">
  462. <parameter expr="self.subwindow"/>
  463. </raise>
  464. </transition>
  465. </state>
  466. <state id="got_result">
  467. <transition event="close_window" target="../mv_processing">
  468. <raise event="delete_instance" scope="cd">
  469. <parameter expr="self.subwindow"/>
  470. </raise>
  471. <raise event="mv_request" scope="broad">
  472. <parameter expr="'conformance_add'"/>
  473. <parameter expr="[current_model, current_metamodel]"/>
  474. </raise>
  475. </transition>
  476. </state>
  477. <state id="mv_processing">
  478. <transition event="mv_response" target="../../../open_model/search_metamodels"/>
  479. </state>
  480. </state>
  481. </state>
  482. <state id="change_mapper">
  483. <transition target="../open_model/search_CS_mappers"/>
  484. </state>
  485. <state id="change_rendered">
  486. <transition target="../rerender_model"/>
  487. </state>
  488. <state id="verify_model" initial="request">
  489. <state id="request">
  490. <onentry>
  491. <raise event="mv_request" scope="broad">
  492. <parameter expr="'verify'"/>
  493. <parameter expr="[current_model, current_metamodel]"/>
  494. </raise>
  495. </onentry>
  496. <transition event="mv_progress" target=".">
  497. <parameter name="result"/>
  498. <raise event="update_status" scope="narrow" target="'progress_bar'">
  499. <parameter expr="result * 100"/>
  500. <parameter expr="'Verifying...'"/>
  501. </raise>
  502. </transition>
  503. <transition event="mv_response" target="../show_result">
  504. <parameter name="result"/>
  505. <raise event="create_instance" scope="cd">
  506. <parameter expr="'subwindow'"/>
  507. <parameter expr="'Popup'"/>
  508. <parameter expr="result"/>
  509. </raise>
  510. </transition>
  511. </state>
  512. <state id="show_result">
  513. <transition event="instance_created" target="../wait_for_close">
  514. <parameter name="assoc_name"/>
  515. <raise event="start_instance" scope="cd">
  516. <parameter expr="assoc_name"/>
  517. </raise>
  518. </transition>
  519. </state>
  520. <state id="wait_for_close">
  521. <transition event="close_window" target="../../idle">
  522. <raise event="delete_instance" scope="cd">
  523. <parameter expr="'subwindow'"/>
  524. </raise>
  525. </transition>
  526. </state>
  527. </state>
  528. <state id="open_model" initial="query_model">
  529. <state id="query_model">
  530. <onentry>
  531. <raise event="create_instance" scope="cd">
  532. <parameter expr="'subwindow'"/>
  533. <parameter expr="'Browser'"/>
  534. <parameter expr="'Select model to open'"/>
  535. <parameter expr="[]"/>
  536. </raise>
  537. <raise event="update_status" scope="narrow" target="'progress_bar'">
  538. <parameter expr="0"/>
  539. <parameter expr="'Browsing for model...'"/>
  540. </raise>
  541. </onentry>
  542. <transition event="instance_created" target="../wait_for_model">
  543. <parameter name="association_name"/>
  544. <raise event="start_instance" scope="cd">
  545. <parameter expr="association_name"/>
  546. </raise>
  547. <script>
  548. self.subwindow = association_name
  549. </script>
  550. </transition>
  551. </state>
  552. <state id="wait_for_model">
  553. <transition event="close_window" target="../../idle">
  554. <raise event="delete_instance" scope="cd">
  555. <parameter expr="self.subwindow"/>
  556. </raise>
  557. <raise event="update_status" scope="narrow" target="'progress_bar'">
  558. <parameter expr="10"/>
  559. <parameter expr="'Browsing for model... OK'"/>
  560. </raise>
  561. </transition>
  562. <transition event="browse_result" target="../got_model">
  563. <parameter name="result"/>
  564. <script>
  565. global current_model
  566. current_model = result
  567. self.locations = {}
  568. </script>
  569. </transition>
  570. </state>
  571. <state id="got_model">
  572. <transition event="close_window" target="../search_metamodels">
  573. <raise event="delete_instance" scope="cd">
  574. <parameter expr="self.subwindow"/>
  575. </raise>
  576. </transition>
  577. </state>
  578. <state id="search_metamodels">
  579. <onentry>
  580. <raise event="mv_request" scope="broad">
  581. <parameter expr="'model_types'"/>
  582. <parameter expr="[current_model]"/>
  583. </raise>
  584. <raise event="update_status" scope="narrow" target="'progress_bar'">
  585. <parameter expr="10"/>
  586. <parameter expr="'Querying existing metamodels...'"/>
  587. </raise>
  588. </onentry>
  589. <transition event="mv_response" target="../search_CS_mappers">
  590. <parameter name="result"/>
  591. <script>
  592. global current_metamodel
  593. if len(result) > 0:
  594. current_metamodel = next(iter(result))[0]
  595. else:
  596. current_metamodel = 'formalisms/Bottom'
  597. self.allowed_metamodels = set([i[0] for i in result])
  598. </script>
  599. <raise event="mv_request" scope="broad">
  600. <parameter expr="'alter_context'"/>
  601. <parameter expr="[current_model, current_metamodel]"/>
  602. </raise>
  603. <raise event="update_status" scope="narrow" target="'progress_bar'">
  604. <parameter expr="20"/>
  605. <parameter expr="'Querying existing metamodels... OK'"/>
  606. </raise>
  607. </transition>
  608. </state>
  609. <state id="search_CS_mappers">
  610. <onentry>
  611. <raise event="mv_request" scope="broad">
  612. <parameter expr="'transformation_between'"/>
  613. <parameter expr="[{'abstract': current_metamodel, 'rendered': 'formalisms/MM_render/graphical'}, {'rendered': 'formalisms/MM_render/graphical'}]"/>
  614. </raise>
  615. <raise event="update_status" scope="narrow" target="'progress_bar'">
  616. <parameter expr="25"/>
  617. <parameter expr="'Querying available Concrete Syntax mappers...'"/>
  618. </raise>
  619. </onentry>
  620. <transition event="mv_response" target="../check_CS_mapper">
  621. <parameter name="result"/>
  622. <script>
  623. result.add("(none)")
  624. self.allowed_mappers = list(result)
  625. global current_mapper
  626. if current_mapper is None:
  627. current_mapper = None
  628. elif current_mapper not in result:
  629. current_mapper = next(iter(result))
  630. if current_mapper == "(none)":
  631. current_mapper = None
  632. </script>
  633. <raise event="update_status" scope="narrow" target="'progress_bar'">
  634. <parameter expr="30"/>
  635. <parameter expr="'Querying available Concrete Syntax mappers... OK'"/>
  636. </raise>
  637. </transition>
  638. <transition event="mv_exception" target="../check_CS_mapper">
  639. <script>
  640. self.allowed_mappers = ["(none)"]
  641. global current_mapper
  642. current_mapper = None
  643. </script>
  644. <raise event="update_status" scope="narrow" target="'progress_bar'">
  645. <parameter expr="30"/>
  646. <parameter expr="'Querying available Concrete Syntax mappers... OK'"/>
  647. </raise>
  648. </transition>
  649. </state>
  650. <state id="check_CS_mapper">
  651. <transition cond="current_mapper is None" target="../../rerender_model">
  652. <script>
  653. global current_rendered_model
  654. current_rendered_model = None
  655. self.allowed_rendered = []
  656. </script>
  657. <raise event="clear_canvas" scope="narrow" target="'canvas'"/>
  658. <raise event="update_status" scope="narrow" target="'progress_bar'">
  659. <parameter expr="35"/>
  660. <parameter expr="'Rendering model with internal renderer...'"/>
  661. </raise>
  662. </transition>
  663. <transition cond="current_mapper is not None" target="../search_CS_rendered"/>
  664. </state>
  665. <state id="search_CS_rendered">
  666. <onentry>
  667. <raise event="mv_request" scope="broad">
  668. <parameter expr="'model_rendered'"/>
  669. <parameter expr="[current_model, current_mapper]"/>
  670. </raise>
  671. <raise event="update_status" scope="narrow" target="'progress_bar'">
  672. <parameter expr="35"/>
  673. <parameter expr="'Rendering model with custom renderer...'"/>
  674. </raise>
  675. </onentry>
  676. <transition event="mv_response" target="../store_metamodel">
  677. <parameter name="result"/>
  678. <script>
  679. self.allowed_rendered = list(result)
  680. #self.allowed_rendered.append("(none)")
  681. global current_rendered_model
  682. if (len(result) > 0):
  683. if current_rendered_model not in result:
  684. current_rendered_model = next(iter(result))
  685. else:
  686. current_rendered_model = "rendered/%s" % str(uuid.uuid4())
  687. self.allowed_rendered.append(current_rendered_model)
  688. if current_rendered_model == "(none)":
  689. current_rendered_model = None
  690. </script>
  691. </transition>
  692. </state>
  693. <state id="store_metamodel">
  694. <onentry>
  695. <raise event="mv_request" scope="broad">
  696. <parameter expr="'alter_context'"/>
  697. <parameter expr="[current_model, current_metamodel]"/>
  698. </raise>
  699. <raise event="update_status" scope="narrow" target="'progress_bar'">
  700. <parameter expr="45"/>
  701. <parameter expr="'Storing model context...'"/>
  702. </raise>
  703. </onentry>
  704. <transition target="../../rerender_model"/>
  705. </state>
  706. </state>
  707. <state id="new_rendered">
  708. <onentry>
  709. <script>
  710. global current_rendered_model
  711. current_rendered_model = "rendered/%s" % str(uuid.uuid4())
  712. self.allowed_rendered.append(current_rendered_model)
  713. </script>
  714. </onentry>
  715. <transition target="../rerender_model"/>
  716. </state>
  717. <state id="create_new_model" initial="query_metamodel">
  718. <state id="query_metamodel">
  719. <onentry>
  720. <raise event="create_instance" scope="cd">
  721. <parameter expr="'subwindow'"/>
  722. <parameter expr="'Browser'"/>
  723. <parameter expr="'Select metamodel to instantiate'"/>
  724. <parameter expr="['formalisms/SimpleClassDiagrams']"/>
  725. </raise>
  726. <raise event="update_status" scope="narrow" target="'progress_bar'">
  727. <parameter expr="5"/>
  728. <parameter expr="'Browsing for metamodel...'"/>
  729. </raise>
  730. </onentry>
  731. <transition event="instance_created" target="../wait_for_metamodel">
  732. <parameter name="association_name"/>
  733. <raise event="start_instance" scope="cd">
  734. <parameter expr="association_name"/>
  735. </raise>
  736. <script>
  737. self.subwindow = association_name
  738. </script>
  739. </transition>
  740. </state>
  741. <state id="wait_for_metamodel">
  742. <transition event="close_window" target="../../idle">
  743. <raise event="delete_instance" scope="cd">
  744. <parameter expr="self.subwindow"/>
  745. </raise>
  746. </transition>
  747. <transition event="browse_result" target="../got_mm">
  748. <parameter name="result"/>
  749. <script>
  750. global current_metamodel
  751. current_metamodel = result
  752. </script>
  753. </transition>
  754. </state>
  755. <state id="got_mm">
  756. <transition event="close_window" target="../prompt_model_name">
  757. <raise event="delete_instance" scope="cd">
  758. <parameter expr="self.subwindow"/>
  759. </raise>
  760. </transition>
  761. </state>
  762. <state id="prompt_model_name">
  763. <onentry>
  764. <raise event="create_instance" scope="cd">
  765. <parameter expr="'subwindow'"/>
  766. <parameter expr="'PromptWindow'"/>
  767. <parameter expr="{'Model name': ''}"/>
  768. <parameter expr="{}"/>
  769. </raise>
  770. <raise event="update_status" scope="narrow" target="'progress_bar'">
  771. <parameter expr="15"/>
  772. <parameter expr="'Prompt model name...'"/>
  773. </raise>
  774. </onentry>
  775. <transition event="instance_created" target="../waiting_for_model_name">
  776. <parameter name="association_name"/>
  777. <raise event="start_instance" scope="cd">
  778. <parameter expr="association_name"/>
  779. </raise>
  780. <script>
  781. global current_model
  782. self.subwindow = association_name
  783. current_model = ""
  784. self.locations = {}
  785. </script>
  786. </transition>
  787. </state>
  788. <state id="waiting_for_model_name">
  789. <transition event="prompt_results" target=".">
  790. <parameter name="results"/>
  791. <script>
  792. global current_model
  793. current_model = results["Model name"]
  794. self.locations = {}
  795. </script>
  796. </transition>
  797. <transition event="close_window" cond="current_model != ''" target="../creating_model">
  798. <raise event="delete_instance" scope="cd">
  799. <parameter expr="self.subwindow"/>
  800. </raise>
  801. <raise event="mv_request" scope="broad">
  802. <parameter expr="'alter_context'"/>
  803. <parameter expr="[current_model, current_metamodel]"/>
  804. </raise>
  805. </transition>
  806. <transition event="close_window" cond="current_model == ''" target="../../idle">
  807. <raise event="delete_instance" scope="cd">
  808. <parameter expr="self.subwindow"/>
  809. </raise>
  810. </transition>
  811. </state>
  812. <state id="creating_model">
  813. <onentry>
  814. <raise event="mv_request" scope="broad">
  815. <parameter expr="'model_add'"/>
  816. <parameter expr="[current_model, current_metamodel, '']"/>
  817. </raise>
  818. <raise event="update_status" scope="narrow" target="'progress_bar'">
  819. <parameter expr="25"/>
  820. <parameter expr="'Creating empty model...'"/>
  821. </raise>
  822. </onentry>
  823. <transition event="mv_response" target="../../open_model/search_metamodels">
  824. <raise event="update_status" scope="narrow" target="'progress_bar'">
  825. <parameter expr="50"/>
  826. <parameter expr="'Creating empty model... OK'"/>
  827. </raise>
  828. </transition>
  829. </state>
  830. </state>
  831. <state id="rerender_model" initial="initial_render">
  832. <onentry>
  833. <raise event="update_status" scope="narrow" target="'progress_bar'">
  834. <parameter expr="50"/>
  835. <parameter expr="'Rendering model...'"/>
  836. </raise>
  837. </onentry>
  838. <state id="initial_render">
  839. <transition cond="self.model_loaded" target="../recreate_toolbars"/>
  840. <transition cond="not self.model_loaded" target="../canvas">
  841. <script>
  842. self.model_loaded = True
  843. </script>
  844. </transition>
  845. </state>
  846. <state id="recreate_toolbars" initial="waiting">
  847. <onentry>
  848. <raise event="close" scope="narrow" target="'model_toolbars'"/>
  849. <script>
  850. self.nr_toolbars = 3
  851. </script>
  852. </onentry>
  853. <state id="waiting">
  854. <transition event="close_window" target=".">
  855. <script>
  856. self.nr_toolbars -= 1
  857. </script>
  858. </transition>
  859. <transition cond="self.nr_toolbars == 0" target="../close_all"/>
  860. </state>
  861. <state id="close_all">
  862. <transition target="../../model_toolbars">
  863. <raise event="delete_instance" scope="cd">
  864. <parameter expr="'model_toolbars'"/>
  865. </raise>
  866. </transition>
  867. </state>
  868. </state>
  869. <state id="canvas">
  870. <onentry>
  871. <raise event="create_instance" scope="cd">
  872. <parameter expr="'canvas'"/>
  873. <parameter expr="'Canvas'"/>
  874. <parameter expr="self.canvas_frame"/>
  875. </raise>
  876. </onentry>
  877. <transition event="instance_created" target="../pack_canvas">
  878. <parameter name="association_name"/>
  879. <raise event="start_instance" scope="cd">
  880. <parameter expr="association_name"/>
  881. </raise>
  882. </transition>
  883. </state>
  884. <state id="pack_canvas">
  885. <transition event="tk_widget" target="../model_toolbars">
  886. <parameter name="tk_elem"/>
  887. <script>
  888. tk_elem.pack(fill=tk.BOTH, expand=tk.TRUE)
  889. </script>
  890. </transition>
  891. </state>
  892. <state id="model_toolbars" initial="mm_toolbar">
  893. <state id="mm_toolbar">
  894. <onentry>
  895. <raise event="create_instance" scope="cd">
  896. <parameter expr="'model_toolbars'"/>
  897. <parameter expr="'MetamodellingToolbar'"/>
  898. <parameter expr="self.toolbar_frame"/>
  899. <parameter expr="current_metamodel"/>
  900. <parameter expr="self.allowed_metamodels"/>
  901. </raise>
  902. </onentry>
  903. <transition event="instance_created" target="../pack_mm_toolbar">
  904. <parameter name="association_name"/>
  905. <raise event="start_instance" scope="cd">
  906. <parameter expr="association_name"/>
  907. </raise>
  908. </transition>
  909. </state>
  910. <state id="pack_mm_toolbar">
  911. <transition event="tk_widget" target="../cs_toolbar">
  912. <parameter name="tk_elem"/>
  913. <script>
  914. tk_elem.pack(anchor=tk.W)
  915. </script>
  916. </transition>
  917. </state>
  918. <state id="cs_toolbar">
  919. <onentry>
  920. <raise event="create_instance" scope="cd">
  921. <parameter expr="'model_toolbars'"/>
  922. <parameter expr="'ConcreteSyntaxToolbar'"/>
  923. <parameter expr="self.toolbar_frame"/>
  924. <parameter expr="self.allowed_mappers"/>
  925. <parameter expr="self.allowed_rendered"/>
  926. </raise>
  927. </onentry>
  928. <transition event="instance_created" target="../pack_cs_toolbar">
  929. <parameter name="association_name"/>
  930. <raise event="start_instance" scope="cd">
  931. <parameter expr="association_name"/>
  932. </raise>
  933. </transition>
  934. </state>
  935. <state id="pack_cs_toolbar">
  936. <transition event="tk_widget" target="../fetch_types">
  937. <parameter name="tk_elem"/>
  938. <script>
  939. tk_elem.pack(anchor=tk.W)
  940. </script>
  941. </transition>
  942. </state>
  943. <state id="fetch_types">
  944. <onentry>
  945. <raise event="mv_request" scope="broad">
  946. <parameter expr="'types'"/>
  947. <parameter expr="[current_model]"/>
  948. </raise>
  949. </onentry>
  950. <transition event="mv_response" target="../dsl_toolbar">
  951. <parameter name="result"/>
  952. <raise event="create_instance" scope="cd">
  953. <parameter expr="'model_toolbars'"/>
  954. <parameter expr="'DSLToolbar'"/>
  955. <parameter expr="self.toolbar_frame"/>
  956. <parameter expr="result"/>
  957. </raise>
  958. </transition>
  959. </state>
  960. <state id="dsl_toolbar">
  961. <transition event="instance_created" target="../pack_dsl_toolbar">
  962. <parameter name="association_name"/>
  963. <raise event="start_instance" scope="cd">
  964. <parameter expr="association_name"/>
  965. </raise>
  966. </transition>
  967. </state>
  968. <state id="pack_dsl_toolbar">
  969. <transition event="tk_widget" target="../../request_render">
  970. <parameter name="tk_elem"/>
  971. <script>
  972. tk_elem.pack(anchor=tk.W)
  973. </script>
  974. </transition>
  975. </state>
  976. </state>
  977. <state id="request_render">
  978. <onentry>
  979. <raise event="update_status" scope="narrow" target="'progress_bar'">
  980. <parameter expr="50"/>
  981. <parameter expr="'Perceptualizing model...'"/>
  982. </raise>
  983. <raise event="mv_request" scope="broad">
  984. <parameter expr="'model_render' if current_rendered_model else 'element_list_nice'"/>
  985. <parameter expr="[current_model, current_mapper, current_rendered_model] if current_rendered_model else [current_model]"/>
  986. </raise>
  987. </onentry>
  988. <transition event="mv_response" cond="current_rendered_model" target="../render_model">
  989. <parameter name="result"/>
  990. <script>
  991. self.rendered = result
  992. </script>
  993. </transition>
  994. <transition event="mv_response" cond="not current_rendered_model" target="../render_model">
  995. <parameter name="result"/>
  996. <script>
  997. self.rendered = []
  998. group_counter = 0
  999. groups = {}
  1000. edges = []
  1001. defined_attributes = {}
  1002. names = {}
  1003. if current_metamodel == "formalisms/SimpleClassDiagrams":
  1004. for elem in result:
  1005. if elem["__type"] == "AttributeLink":
  1006. defined_attributes.setdefault(elem["__source"], []).append((elem["name"], elem["__target"], True if elem["optional"] == True else False))
  1007. if "name" in elem:
  1008. names[elem["__id"]] = elem["name"]
  1009. for elem in list(result):
  1010. is_edge = False
  1011. attrs = {}
  1012. for key, value in elem.items():
  1013. if key == "__id":
  1014. element_id = value
  1015. elif key == "__source":
  1016. element_source = value
  1017. is_edge = True
  1018. elif key == "__target":
  1019. element_target = value
  1020. is_edge = True
  1021. elif key == "__type":
  1022. element_type = value
  1023. else:
  1024. attrs[key] = value
  1025. max_text = 0
  1026. if is_edge:
  1027. edge_edge = len([x for x in result if (x["__id"] == element_source or x["__id"] == element_target) and "__source" in x]) > 0
  1028. else:
  1029. edge_edge = False
  1030. if is_edge:
  1031. if not (elem["__type"] == "AttributeLink" and current_metamodel == "formalisms/SimpleClassDiagrams"):
  1032. cs_elem_id = str(uuid.uuid4())
  1033. edges.append({"id": cs_elem_id, "type": "ConnectingLine", "offsetSourceX": 0 if edge_edge else 100, "offsetSourceY": 0 if edge_edge else 30, "offsetTargetX": 100, "offsetTargetY": 30, "lineWidth": 3, "lineColour": "black", "arrow": True, "__asid": element_id, "layer": 0, "__source": element_source, "__target": element_target})
  1034. groups[element_id] = cs_elem_id
  1035. else:
  1036. # Add the group
  1037. x, y = self.locations.get(element_id, (30 + (group_counter * 250) % 1000, 30 + ((group_counter / 4) * 250)))
  1038. self.rendered.append({"id": str(group_counter), "type": "Group", "x": x, "y": y, "__asid": element_id})
  1039. self.locations[element_id] = (x, y)
  1040. group_id = str(group_counter)
  1041. groups[element_id] = group_id
  1042. group_counter += 1
  1043. # Add the text elements
  1044. # First the header
  1045. cs_elem_id = str(uuid.uuid4())
  1046. self.rendered.append({"id": cs_elem_id, "type": "Text", "x": 10, "y": 10, "text": "%s : %s" % (element_id, element_type), "lineWidth": 1, "lineColour": "black", "layer": 2})
  1047. self.rendered.append({"id": str(uuid.uuid4()), "type": "contains", "__source": group_id, "__target": cs_elem_id})
  1048. max_text = max(len("%s : %s" % (element_id, element_type)), max_text)
  1049. # Then the attributes
  1050. text_counter = 1
  1051. for name, attr_type, optional in defined_attributes.get(elem["__id"], []):
  1052. cs_elem_id = str(uuid.uuid4())
  1053. text = "%s : %s" % (name, names.get(attr_type, "(%s)" % attr_type))
  1054. if optional:
  1055. text = text.replace(" : ", " ?: ")
  1056. self.rendered.append({"id": cs_elem_id, "type": "Text", "x": 10, "y": 25 + text_counter * 11, "text": text, "lineWidth": 3, "lineColour": "black", "layer": 2})
  1057. max_text = max(len(text), max_text)
  1058. self.rendered.append({"id": str(uuid.uuid4()), "type": "contains", "__source": group_id, "__target": cs_elem_id})
  1059. text_counter += 1
  1060. if text_counter > 1:
  1061. text_counter += 1
  1062. for key, value in attrs.items():
  1063. cs_elem_id = str(uuid.uuid4())
  1064. if isinstance(value, dict):
  1065. if value["AL"] == "":
  1066. text = "(%s)" % key
  1067. else:
  1068. text = "%s = ^%s" % (key, value['AL'])
  1069. else:
  1070. text = ("%s = %s" % (key, value)) if value is not None else ("(%s)" % key)
  1071. self.rendered.append({"id": cs_elem_id, "type": "Text", "x": 10, "y": 25 + text_counter * 11, "text": text, "lineWidth": 3, "lineColour": "black", "layer": 2})
  1072. max_text = max(len(text), max_text)
  1073. self.rendered.append({"id": str(uuid.uuid4()), "type": "contains", "__source": group_id, "__target": cs_elem_id})
  1074. text_counter += 1
  1075. # Add the rectangle
  1076. cs_elem_id = str(uuid.uuid4())
  1077. self.rendered.append({"id": cs_elem_id, "type": "Rectangle", "x": 0, "y": 0, "width": max_text * 8, "height": 35 + text_counter * 11, "lineWidth": 1, "lineColour": "black", "fillColour": "white", "layer": 1})
  1078. self.rendered.append({"id": str(uuid.uuid4()), "type": "contains", "__source": group_id, "__target": cs_elem_id})
  1079. # Add the line
  1080. cs_elem_id = str(uuid.uuid4())
  1081. self.rendered.append({"id": cs_elem_id, "type": "Line", "x": 0, "y": 20, "targetX": max_text * 8, "targetY": 20, "lineWidth": 1, "lineColour": "black", "layer": 0, "arrow": False})
  1082. self.rendered.append({"id": str(uuid.uuid4()), "type": "contains", "__source": group_id, "__target": cs_elem_id})
  1083. for edge in edges:
  1084. edge["__source"] = groups[edge["__source"]]
  1085. edge["__target"] = groups[edge["__target"]]
  1086. self.rendered.append(edge)
  1087. </script>
  1088. </transition>
  1089. <transition event="mv_exception" target="../../../close"/>
  1090. </state>
  1091. <state id="render_model" initial="allocate_groups">
  1092. <onentry>
  1093. <raise event="update_status" scope="narrow" target="'progress_bar'">
  1094. <parameter expr="80"/>
  1095. <parameter expr="'Perceptualizing model... OK'"/>
  1096. </raise>
  1097. <raise event="clear_canvas" scope="narrow" target="'canvas'"/>
  1098. <script>
  1099. self.groups = [i for i in self.rendered if i["type"] == "Group"]
  1100. self.contains = [i for i in self.rendered if i["type"] == "contains"]
  1101. self.rendered = [i for i in self.rendered if i["type"] not in ["Group", "contains"]]
  1102. self.rendered.reverse()
  1103. </script>
  1104. <raise event="mv_request" scope="broad">
  1105. <parameter expr="'alter_context'"/>
  1106. <parameter expr="[current_rendered_model, 'formalisms/MM_render/graphical']"/>
  1107. </raise>
  1108. </onentry>
  1109. <state id="allocate_groups">
  1110. <transition cond="len(self.groups) > 0" target="../allocating_group">
  1111. <raise event="define_group" scope="narrow" target="'canvas'">
  1112. <parameter expr="self.groups.pop()"/>
  1113. </raise>
  1114. </transition>
  1115. <transition cond="len(self.groups) == 0" target="../allocate_contains"/>
  1116. </state>
  1117. <state id="allocating_group">
  1118. <transition event="group_ready" target="../allocate_groups"/>
  1119. </state>
  1120. <state id="allocate_contains">
  1121. <transition cond="len(self.contains) > 0" target=".">
  1122. <raise event="define_contains" scope="narrow" target="'canvas'">
  1123. <parameter expr="self.contains.pop()"/>
  1124. </raise>
  1125. </transition>
  1126. <transition cond="len(self.contains) == 0" target="../render_elements"/>
  1127. </state>
  1128. <state id="render_elements">
  1129. <transition cond="len(self.rendered) > 0" target=".">
  1130. <raise event="draw_canvas" scope="narrow" target="'canvas'">
  1131. <parameter expr="self.rendered.pop()"/>
  1132. </raise>
  1133. </transition>
  1134. <transition cond="len(self.rendered) == 0" target="../../../idle"/>
  1135. </state>
  1136. </state>
  1137. </state>
  1138. <transition event="window-close" cond="ID == id(self)" target="../close">
  1139. <parameter name="ID"/>
  1140. </transition>
  1141. </state>
  1142. <state id="close">
  1143. <onentry>
  1144. <raise event="close_window" scope="narrow" target="'parent'"/>
  1145. </onentry>
  1146. </state>
  1147. </state>
  1148. <state id="key_status">
  1149. <onentry>
  1150. <script>
  1151. global control_pressed
  1152. control_pressed = False
  1153. </script>
  1154. </onentry>
  1155. <state id="listening">
  1156. <transition event="control" target=".">
  1157. <script>
  1158. global control_pressed
  1159. control_pressed = True
  1160. </script>
  1161. </transition>
  1162. <transition event="control-release" target=".">
  1163. <script>
  1164. global control_pressed
  1165. control_pressed = False
  1166. </script>
  1167. </transition>
  1168. </state>
  1169. </state>
  1170. <state id="mover">
  1171. <state id="move">
  1172. <transition event="move" target=".">
  1173. <parameter name="asid"/>
  1174. <parameter name="location"/>
  1175. <script>
  1176. self.locations[asid] = location
  1177. </script>
  1178. </transition>
  1179. </state>
  1180. </state>
  1181. </parallel>
  1182. </scxml>
  1183. </class>