overview.rst 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. .. _overview:
  2. Overview
  3. ========
  4. This section presents an overview of AToMPM's user interface: how to create an account, and the different parts of the user interface (toolbars, canvas, and console).
  5. First Usage
  6. -----------
  7. When first opening the user interface at http://localhost:8124/atompm (or a remote AToMPM server), the user is presented with a login screen.
  8. .. image:: img/first_login_screen.png
  9. :scale: 50
  10. :align: center
  11. Click the *create one now* link, which will allow you to create a new account with a user name and password. Fill out the form and click *Create new account*.
  12. .. image:: img/create_new_account.png
  13. :scale: 80
  14. :align: center
  15. AToMPM will initialize the account (by creating a user folder under the `users/` folder) and switch to the main user interface view. When you revisit the AToMPM webpage or create a new AToMPM instance, the tool will remember your username and password and automatically log you in. You can log out by clicking the *logout* link at the top right of the user interface.
  16. The AToMPM User Interface
  17. -------------------------
  18. When logged in, the AToMPM user interface is initialized with four button toolbars: *MainMenu*, *CompileMenu*, *TransformationController*, and *TransformationEditor*. They allow a langugage developer and a language user to perform most activities and are heavily used in the next sections of the documentation.
  19. .. image:: img/user_interface.png
  20. :scale: 50
  21. :align: center
  22. The user interface of AToMPM consists of three areas, which are explained in more details in the next sections. First is the *toolbar area* (also termed the *dock*), which contains the button and formalism toolbars. Second is the *canvas area* which displays the elements of the current model. Finally, there is the *console*, which may also appear in a separate window.
  23. Toolbars
  24. ^^^^^^^^
  25. There are two types of toolbars that can be loaded: button toolbars consist of a number of buttons that each perform a certain action, while formalism toolbars allow to instantiate language elements. A new toolbar can be loaded using the **(re)load a toolbar** button of the *MainMenu* toolbar. Toolbar models that can be loaded either have the *.buttons.model* extension (for button toolbars) or the *.metamodel* extension (for formalism toolbars).
  26. Button Toolbars
  27. """""""""""""""
  28. All button toolbar models can be found under the */Toolbars/* user folder. A button toolbar consists of a number of buttons that, when clicked, execute a particular action. Four button toolbars are loaded by default, explained below.
  29. .. image:: img/main_toolbar.png
  30. :align: center
  31. #. Launch a new AToMPM user interface in a new tab.
  32. #. (Re-)open a button or formalism toolbar.
  33. #. Close an opened toolbar. If this is a formalism toolbar, the model elements conforming to that formalism are removed from the model.
  34. #. Create a new formalism under the */Formalisms/* user folder with the given name.
  35. #. Open a model.
  36. #. Insert the elements of a model into the currently opened model.
  37. #. Save current model.
  38. #. Save current model as...
  39. #. Undo the last performed action.
  40. #. Redo the last undone action.
  41. #. Copy the selected elements on canvas.
  42. #. Paste the copied elements on the canvas (copy/paste also works across AToMPM tabs).
  43. #. Verify whether the constraints of the current model are satisfied.
  44. #. Show or hide entities of a particular formalism (but do not remove them from the model).
  45. #. Display information about AToMPM, such as the current version, website, and documentation.
  46. Most of these actions are intuitive. Others are explained in more detail in the next sections.
  47. .. image:: img/compilation_toolbar.png
  48. :align: center
  49. #. Compile the current model (conforming to the *ConcreteSyntax* formalism) to a formalism toolbar.
  50. #. Compile the current model (conforming to the *SimpleClassDiagram* formalism) to a metamodel.
  51. #. Compile a metamodel to a pattern metamodel (and associated formalism toolbar(s)), used in model transformation rules.
  52. More information on these buttons can be found in :ref:`creating-a-modelling-language` and :ref:`modelling-a-model-transformation`.
  53. .. image:: img/transformation_controller.png
  54. :align: center
  55. #. Load a transformation.
  56. #. Run the currently loaded transformation until the end.
  57. #. Execute one step of the currently loaded transformation.
  58. #. Pause the running transformation.
  59. #. Stop the running transformation.
  60. #. Enable debugging, which opens a debug window when the transformation is executed that shows the transformation schedule and highlights the currently executing step.
  61. More information on these buttons can be found in :ref:`executing-a-model-transformation`.
  62. .. image:: img/transformation_editor.png
  63. :align: center
  64. #. Open a rule model.
  65. #. Open a transformation model.
  66. #. Open a formalism toolbar of a pattern metamodel.
  67. #. Create a new transformation model, and open it in a new tab.
  68. #. Create a new rule model, and open it in a new tab.
  69. More information on these buttons can be found in :ref:`modelling-a-model-transformation`.
  70. .. _formalism-toolbars:
  71. Formalism Toolbars
  72. """"""""""""""""""
  73. Loading a formalism toolbar allows you to create elements on the canvas conforming to that formalism. Multiple formalism toolbars can be loaded, which allows a model to contain elements conforming to multiple formalisms.
  74. As an example, we show the formalism toolbar of the *TrafficLight* language, which is used throughout the readme as an example.
  75. .. image:: img/trafficlight_toolbar.png
  76. :align: center
  77. Each button of a formalism toolbar corresponds to an icon in the concrete syntax definition of the formalism. Links are not shown. Clicking a button will select that particular type to be instantiated. Right-clicking on the canvas instantiates the icon on the canvas. More information on how to use a formalism toolbar to model can be found in :ref:`using-a-modelling-language`.
  78. Canvas
  79. ^^^^^^
  80. Below is a list of various states the Canvas can be in along with lists of actions available in each state and their corresponding shortcut(s).
  81. When in the **DEFAULT** state,
  82. .. rst-class:: table-with-borders
  83. +---------------------------------+-----------------------------------------------------------------------------+
  84. | Action | Shortcut(s) |
  85. +=================================+=============================================================================+
  86. | Choose an entity type to create | Left-click on desired type from a loaded formalism toolbar. |
  87. +---------------------------------+-----------------------------------------------------------------------------+
  88. | Create an entity | Right-click anywhere on the canvas. |
  89. +---------------------------------+-----------------------------------------------------------------------------+
  90. | Select an entity | Left-click any entity. This will also select the entity's contents, if |
  91. | | any. To select a container without selecting its contents, SHIFT-Left-click |
  92. | | it. Enters the **SOMETHING SELECTED** state. |
  93. +---------------------------------+-----------------------------------------------------------------------------+
  94. | Select one or more entity | Left-press anywhere on Canvas, drag selection box around desired |
  95. | | entity or entities and release. Enters the **SOMETHING SELECTED** state. |
  96. +---------------------------------+-----------------------------------------------------------------------------+
  97. | Connect entities | Right-press an entity (enters the **DRAWING EDGE** state), drag to-be edge |
  98. | | to target entity and release. |
  99. +---------------------------------+-----------------------------------------------------------------------------+
  100. | Edit icon text | SHIFT-Middle-click any text from any icon on the Canvas (this |
  101. | | will display a very simple text editor). |
  102. +---------------------------------+-----------------------------------------------------------------------------+
  103. | Edit entity | Middle-click or SHIFT-Left-click any entity on the Canvas (this will |
  104. | | display the attribute editor). |
  105. +---------------------------------+-----------------------------------------------------------------------------+
  106. The attribute editor is shown in the image below. In the editor, TAB changes focus to the next text entry. The ENTER key will accept the changes and close the editor window in most cases. However, pressing ENTER in a multi-line text area will produce a newline within the text.
  107. .. image:: img/attrib_editor.png
  108. :class: inline-image
  109. :align: center
  110. When in the **SOMETHING SELECTED** state (*i.e.*, when one or more entity is selected).
  111. .. image:: img/something_selected.png
  112. :class: inline-image
  113. :align: center
  114. .. rst-class:: table-with-borders
  115. +--------------------------------------+-----------------------------------------------------------------------------+
  116. | Action | Shortcut(s) |
  117. +======================================+=============================================================================+
  118. | Unselect selection | Right-/Left-/Middle-click anywhere on the Canvas, or click ESC. Enters the |
  119. | | **DEFAULT** state. |
  120. +--------------------------------------+-----------------------------------------------------------------------------+
  121. | Move selection | Left-press selection, drag preview overlay to desired position and |
  122. | | release. Enters the **DEFAULT** state. |
  123. +--------------------------------------+-----------------------------------------------------------------------------+
  124. | Delete selection | Press DELETE. Enters the **DEFAULT** state. |
  125. +--------------------------------------+-----------------------------------------------------------------------------+
  126. | Edit first entity in selection | Press INSERT, or click COMMAND (this will display the attribute editor). |
  127. +--------------------------------------+-----------------------------------------------------------------------------+
  128. | Change the geometry of the selection | Press CTRL. Enters the **GEOMETRY EDITING** state. |
  129. +--------------------------------------+-----------------------------------------------------------------------------+
  130. | Edit the selected edge | Press SHIFT. Enters the **EDGE EDITING** state. |
  131. +--------------------------------------+-----------------------------------------------------------------------------+
  132. | Snap selection to nearest grid point | Press TAB. Enters the **DEFAULT** state. |
  133. +--------------------------------------+-----------------------------------------------------------------------------+
  134. When in the **DRAGGING SELECTION** state (*i.e.*, when left-dragging one or more selected entity),
  135. .. image:: img/dragging_selection.png
  136. :class: inline-image
  137. :align: center
  138. .. rst-class:: table-with-borders
  139. +--------------------------------------+-----------------------------------------------------------------------------+
  140. | Action | Shortcut(s) |
  141. +======================================+=============================================================================+
  142. | Insert selection into container | Left-release on top of the target entity. Enters the **DEFAULT** state. |
  143. +--------------------------------------+-----------------------------------------------------------------------------+
  144. | Remove selection from container | Left-release outside of current container. Containment relationships can |
  145. | | also be deleted manually if visible. Enters the **DEFAULT** state. |
  146. +--------------------------------------+-----------------------------------------------------------------------------+
  147. | Confirm motion | Left-release on the Canvas. Enters the **DEFAULT** state. |
  148. +--------------------------------------+-----------------------------------------------------------------------------+
  149. | Cancel motion | Click ESC. Enters the **DEFAULT** state. |
  150. +--------------------------------------+-----------------------------------------------------------------------------+
  151. When in the **DRAWING EDGE** state (*i.e.*, when dragging to-be edge from source to target entities),
  152. .. image:: img/drawing_edge.png
  153. :class: inline-image
  154. :align: center
  155. .. rst-class:: table-with-borders
  156. +---------------------------------------+-----------------------------------------------------------------------------+
  157. | Action | Shortcut(s) |
  158. +=======================================+=============================================================================+
  159. | Make current line horizontal/vertical | Click TAB. |
  160. +---------------------------------------+-----------------------------------------------------------------------------+
  161. | Create control point | Left-click anywhere, or click CTRL. |
  162. +---------------------------------------+-----------------------------------------------------------------------------+
  163. | Delete last control point | Middle-click anywhere, or click ALT. |
  164. +---------------------------------------+-----------------------------------------------------------------------------+
  165. | Cancel current edge | Left-release anywhere on the Canvas. Enters the **DEFAULT** state. |
  166. +---------------------------------------+-----------------------------------------------------------------------------+
  167. When in the **EDGE EDITING** state,
  168. .. image:: img/edge_editing.png
  169. :class: inline-image
  170. :align: center
  171. .. rst-class:: table-with-borders
  172. +---------------------------------------+-----------------------------------------------------------------------------+
  173. | Action | Shortcut(s) |
  174. +=======================================+=============================================================================+
  175. | Move control point | Left-press any control point, drag it to desired position and release. |
  176. | | |
  177. | | If editing a control point attached to an icon, movement is restricted to |
  178. | | within that icon's bounding box. If free movement is desired, |
  179. | | hold CTRL while moving the control point. |
  180. +---------------------------------------+-----------------------------------------------------------------------------+
  181. | Vertically/Horizontally align control | Left-click any control point and click TAB. |
  182. | point to previous control point | |
  183. +---------------------------------------+-----------------------------------------------------------------------------+
  184. | Clone control point | Right-click any control point. |
  185. +---------------------------------------+-----------------------------------------------------------------------------+
  186. | Delete control point | Middle-click any control point (extremities and the central control |
  187. | | point cannot be removed). |
  188. +---------------------------------------+-----------------------------------------------------------------------------+
  189. | Finish editing | Right-/Left-/Middle-click anywhere on the Canvas, or click ESC. Enters the |
  190. | | **DEFAULT** state. |
  191. +---------------------------------------+-----------------------------------------------------------------------------+
  192. When in the **GEOMETRY EDITING** state,
  193. .. image:: img/geometry_editing.png
  194. :class: inline-image
  195. :align: center
  196. .. rst-class:: table-with-borders
  197. +---------------------------------------+-----------------------------------------------------------------------------+
  198. | Action | Shortcut(s) |
  199. +=======================================+=============================================================================+
  200. | Scale | Mouse-wheel up/down on scale icon until preview overlay reaches desired |
  201. | | shape. |
  202. +---------------------------------------+-----------------------------------------------------------------------------+
  203. | Scale vertically only | Mouse-wheel up/down on vertical scale icon until preview overlay reaches |
  204. | | desired shape. |
  205. +---------------------------------------+-----------------------------------------------------------------------------+
  206. | Scale horizontally only | Mouse-wheel up/down on horizontal scale icon until preview overlay reaches |
  207. | | desired shape. |
  208. +---------------------------------------+-----------------------------------------------------------------------------+
  209. | Rotate | Mouse-wheel up/down on rotation icon until preview overlay reaches desired |
  210. | | shape. |
  211. +---------------------------------------+-----------------------------------------------------------------------------+
  212. | Cancel changes | Right-/Left-/Middle-click anywhere on the Canvas, or click ESC. Enters the |
  213. | | **DEFAULT** state. |
  214. +---------------------------------------+-----------------------------------------------------------------------------+
  215. | Confirm changes | Left-click confirmation icon. Enters the **DEFAULT** state. |
  216. +---------------------------------------+-----------------------------------------------------------------------------+
  217. Console
  218. ^^^^^^^
  219. The developer console (press F12 in Chrome/Firefox) contains many useful debugging messages. Especially when :ref:`executing-a-model-transformation`, the console contains useful information on which rules were executed and whether they failed or succeeded.
  220. .. image:: img/console.png
  221. :align: center
  222. Collaboration
  223. ^^^^^^^^^^^^^
  224. AToMPM supports two modes of real-time distributed collaboration, namely, *screenshare* and *modelshare*. In the former, all collaborating developers share the same concrete and abstract syntax. This implies that if one developer moves an entity or cycles to another concrete syntax representation, the change will be replicated for all collaborators. In contrast, in the latter mode, only abstract syntax is shared. This means that all collaborators can have distinct concrete syntax representations and distinct layouts (provided layout and abstract syntax are not intricately related), and are only affected by others' abstract syntax changes (e.g., modifying abstract attribute values).
  225. .. _userprefs:
  226. Tweaking Default Settings
  227. ^^^^^^^^^^^^^^^^^^^^^^^^^
  228. Several parameters can be tweaked for a more personalized user experience. Their meaning, range of possible values and defaults are detailed below:
  229. +---------------------------------------+-----------------------------------------------------------------------------+-----------------------------+---------+
  230. | Preference Key | Meaning | Type | Default |
  231. +=======================================+=============================================================================+=============================+=========+
  232. | *autosave-delay* | The number of seconds between current model backups, | integer | 15 |
  233. | | or -1 to disable time-intervalled backups. | | |
  234. +---------------------------------------+-----------------------------------------------------------------------------+-----------------------------+---------+
  235. | *autosave-mode* | When set to \textit{overwrite}, automatic saving overwrites the | ENUM(overwrite, backup) | backup |
  236. | | current model on disk (i.e., has the same effect as if you'd clicked | | |
  237. | | the save button from the MainMenu toolbar). When set to *backup*, | | |
  238. | | automatic saving saves the current model into a temporary file and | | |
  239. | | does \emph{not} overwrite the current model on disk. | | |
  240. +---------------------------------------+-----------------------------------------------------------------------------+-----------------------------+---------+
  241. | *confirm-exit* | When set to \textit{true}, exiting or logging out while the current model | boolean | true |
  242. | | contains unsaved changes pops up a warning. | | |
  243. +---------------------------------------+-----------------------------------------------------------------------------+-----------------------------+---------+
  244. | *default-mt-dcl* |The default programming language for all code in model transformation rules. | ENUM(JAVASCRIPT, PYTHON) | PYTHON |
  245. +---------------------------------------+-----------------------------------------------------------------------------+-----------------------------+---------+
  246. | *autoloaded-toolbars* | Toolbars to load when starting a new AToMPM client. | list of toolbar paths | [] |
  247. +---------------------------------------+-----------------------------------------------------------------------------+-----------------------------+---------+
  248. | *autoloaded-model* | Model to load when starting a new AToMPM client. | model path | '' |
  249. +---------------------------------------+-----------------------------------------------------------------------------+-----------------------------+---------+