Eugenia

25,406 views
26,396 views

Published on

EuGENia is a tool that automatically generates the .gmfgraph, .gmftool and .gmfmap models needed to implement a GMF editor from a single annotated Ecore metamodel. EuGENia provides high-level annotations that shield you from the complexity of GMF and lowers the entrance barrier for creating your first GMF editor. While EuGENia is very useful for getting started with GMF, it doesn't stop there and can be used all the way to the final polished version of your editor.

Published in: Technology, Education
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
25,406
On SlideShare
0
From Embeds
0
Number of Embeds
21,159
Actions
Shares
0
Downloads
3
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide
  • Filesystem contains drives, Drives contain folders and files, Folders contain folders and files. Shortcuts are special types of files that point at another file and Sync show synchronization relationships between files/folders.
  • EMF can generate a Java implementation of our metamodel that supports serialization + de-serialization to XMI, and a basic tree-based model editor
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • The tooling model specifies the tools (captions, icons and categorization) in the editor palette.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • The graph model specifies the figures and lines involved in the editor – without specifying which concepts of the metamodel these figures represent.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • You can’t really blame the wizard as it has very little information at its disposal.
  • Since the wizard cannot produce anything useful, we need to hand-craft the mapping model. The mapping model is responsible for establishing mappings between the tools of the tool model, the figures of the graph model and the concepts of the metamodel.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • The graph model specifies the figures and lines involved in the editor – without specifying which concepts of the metamodel these figures represent.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • Eugenia

    1. 1. EuGENia: GMF for mortals<br />Dimitris Kolovos, Louis Rose, Richard Paige<br />{dkolovos, louis, paige}@cs.york.ac.uk<br />@dskolovos, @louismrose, @richpaige<br />Department of Computer Science<br />University of York<br />
    2. 2. Aim: Implement a graphical <br />editor for a DSL<br />
    3. 3. Technologies: Eclipse, EMF, GMF<br />
    4. 4. Our Metamodel (in EMF/Ecore)<br />
    5. 5. How EMF Works<br />
    6. 6. How GMF Works<br />Meta<br />Model<br />
    7. 7. How GMF Works<br />Meta<br />Model<br />
    8. 8. The GMF Tooling Model<br />
    9. 9. How GMF Works<br />Meta<br />Model<br />
    10. 10. The GMF Graph Model<br />
    11. 11. How GMF Works<br />Meta<br />Model<br />
    12. 12. Mapping Model Wizard<br />
    13. 13. The GMF Mapping Model<br />
    14. 14. How GMF Works<br />Meta<br />Model<br />
    15. 15. The Generator Model<br />
    16. 16. How GMF Works<br />Meta<br />Model<br />
    17. 17.
    18. 18. Powerful<br />
    19. 19. Configurable<br />
    20. 20. Labour intensive<br />
    21. 21. Hard to master<br />
    22. 22. Error prone<br />
    23. 23. Replace it<br />Make it easier<br />
    24. 24. EuGENia<br />
    25. 25. How EuGENia Works<br />
    26. 26. Our Metamodel<br />
    27. 27. Our Metamodel (in Emfatic)<br />
    28. 28. Our annotated metamodel<br />
    29. 29. A closer look…<br />
    30. 30. Filesystem<br />@gmf.diagram<br />class Filesystem {<br />val Drive[*] drives;<br />val Sync[*] syncs;<br />}<br />
    31. 31. File<br />@gmf.node(label=“name”)<br />class File {<br />attr String name;<br />}<br />
    32. 32. Shortcut<br />@gmf.node(label=“name”)<br />class Shortcut extends File {<br />attr String name;<br />@gmf.link(target.decoration=&quot;arrow&quot;, <br /> style=&quot;dash&quot;)<br />ref File target;<br />}<br />
    33. 33. Folder<br />@gmf.node(label=“name”)<br />class Folder extends File {<br />attr String name;<br />@gmf.compartment<br />val File[*] contents;<br />}<br />
    34. 34. Drive<br />@gmf.node(label=“name”)<br />class Drive extends Folder {<br />attr String name;<br />@gmf.compartment<br />val File[*] contents;<br />}<br />
    35. 35. Sync<br />@gmf.link(label=&quot;lastSync&quot;, source=&quot;source&quot;,<br /> target=&quot;target&quot;, style=&quot;dot&quot;, width=&quot;2&quot;)<br />class Sync {<br />ref File source;<br />ref File target;<br />attr String lastSync;<br />}<br />
    36. 36. How EuGENia Works<br />
    37. 37. Customize it!<br />
    38. 38. Polishing your Editor<br />Add EOL scripts next to your metamodel to customize the produced GMF models<br />ECore2GMF.eol &lt;- .gmfgraph, .gmftool, .gmfmap<br />FixGMFGen.eol &lt;- .gmfgen<br />EuGENia picks them up and runs them after the built-in transformations<br />www.eclipse.org/gmt/epsilon/doc/articles/eugenia-polishing<br />
    39. 39. Polishing Example<br />// Set Shortcut’s label font to italic<br />varshortcutLabel = GmfGraph!Label.all.<br />selectOne(lbl | lbl.name = &quot;ShortcutLabelFigure&quot;);<br />shortcutLabel.font = createItalicFont();<br />operationcreateItalicFont() {<br />var font = new GmfGraph!BasicFont;<br />font.style = GmfGraph!FontStyle#ITALIC;<br />return font;<br />}<br />
    40. 40. More features<br />Custom Java figures<br />Internal/external/composite labels<br />Affixed nodes<br />Phantom nodes<br />Combined diagram/model file<br />Model/diagram extension<br />Copyright text (in separate copyright.txt file)<br />
    41. 41. Good stuff<br />Easy<br />High level<br />Hides GMF details<br />Change resilient<br />Can target different editor frameworks in the future<br />Further customization with EOL<br />www.eclipse.org/gmt/epsilon/doc/articles/eugenia-polishing<br />
    42. 42. Not so good stuff<br />Not 1:1 GMF mapping<br />By construction<br />Polishing compensates for this<br />Pollutes metamodel<br />Trade-off for usability<br />
    43. 43. Implementation Notes<br />2 Model-to-Model Transformations<br />1235 Lines of Code<br />Transformations in EOL<br />Epsilon Object Language (≈ JavaScript + OCL) www.eclipse.org/gmt/epsilon/doc/eol<br />Try EOL in your browserwww.eclipse.org/gmt/epsilon/live<br />
    44. 44. Community<br />Well-received contribution<br />Forum activity<br />http://www.eclipse.org/gmt/epsilon/forum<br />Requests for enhancements<br />#265145, #265285, #265609, #268085, #285912 … <br />Comments in Epsilon’s blog<br />http://epsilonblog.wordpress.com<br />
    45. 45. Resources<br />Download<br />www.eclipse.org/gmt/epsilon<br />Tutorial (+ list of annotations)<br />www.eclipse.org/gmt/epsilon/doc/eugenia<br />Examples<br />www.eclipse.org/gmt/epsilon/examples<br />Screencasts<br />www.eclipse.org/gmt/epsilon/cinema<br />Follow Epsilon on Twitter @epsilonews<br />

    ×