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.
1. EuGENia: GMF for mortals Dimitris Kolovos, Louis Rose, Richard Paige {dkolovos, louis, paige}@cs.york.ac.uk @dskolovos, @louismrose, @richpaige Department of Computer Science University of York
38. Polishing your Editor Add EOL scripts next to your metamodel to customize the produced GMF models ECore2GMF.eol <- .gmfgraph, .gmftool, .gmfmap FixGMFGen.eol <- .gmfgen EuGENia picks them up and runs them after the built-in transformations www.eclipse.org/gmt/epsilon/doc/articles/eugenia-polishing
39. Polishing Example // Set Shortcut’s label font to italic varshortcutLabel = GmfGraph!Label.all. selectOne(lbl | lbl.name = "ShortcutLabelFigure"); shortcutLabel.font = createItalicFont(); operationcreateItalicFont() { var font = new GmfGraph!BasicFont; font.style = GmfGraph!FontStyle#ITALIC; return font; }
40. More features Custom Java figures Internal/external/composite labels Affixed nodes Phantom nodes Combined diagram/model file Model/diagram extension Copyright text (in separate copyright.txt file)
41. Good stuff Easy High level Hides GMF details Change resilient Can target different editor frameworks in the future Further customization with EOL www.eclipse.org/gmt/epsilon/doc/articles/eugenia-polishing
42. Not so good stuff Not 1:1 GMF mapping By construction Polishing compensates for this Pollutes metamodel Trade-off for usability
43. Implementation Notes 2 Model-to-Model Transformations 1235 Lines of Code Transformations in EOL Epsilon Object Language (≈ JavaScript + OCL) www.eclipse.org/gmt/epsilon/doc/eol Try EOL in your browserwww.eclipse.org/gmt/epsilon/live
44. Community Well-received contribution Forum activity http://www.eclipse.org/gmt/epsilon/forum Requests for enhancements #265145, #265285, #265609, #268085, #285912 … Comments in Epsilon’s blog http://epsilonblog.wordpress.com
45. Resources Download www.eclipse.org/gmt/epsilon Tutorial (+ list of annotations) www.eclipse.org/gmt/epsilon/doc/eugenia Examples www.eclipse.org/gmt/epsilon/examples Screencasts www.eclipse.org/gmt/epsilon/cinema Follow Epsilon on Twitter @epsilonews
Editor's Notes
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.