Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
<ul><li>Authors </li></ul><ul><li>Javier Cano ( [email_address] ) </li></ul><ul><li>Gabriel Merin (gmerin@prodevelop.es) <...
Contents <ul><li>Introduction </li></ul><ul><li>Why to extend GMF </li></ul><ul><li>Extension mechanisms </li></ul><ul><li...
1. Introduction <ul><li>GMF (Graphical Modeling Framework) </li></ul><ul><ul><li>It is a model driven framework to develop...
1. Introduction <ul><li>GMF (Graphical Modeling Framework) </li></ul><ul><ul><li>Java implementation avoided thanks to 4 m...
2. Why to extend GMF <ul><li>GMF provides great graphical editors but: </li></ul><ul><ul><li>The generative process can on...
3. Extension Mechanisms <ul><li>The GMF generative process can be decomposed into the following components: </li></ul>xpan...
3. Extension Mechanisms <ul><li>GMF Xpand templates </li></ul><ul><ul><li>The generative process can be altered by means o...
4. MOSKitt GMF Extensions <ul><li>Due to our needs, the following extensions have been Implemented: </li></ul><ul><ul><li>...
4. MOSKitt GMF Extensions <ul><li>Diagram versioning (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Add a ...
4. MOSKitt GMF Extensions <ul><li>Diagram versioning (II) </li></ul><ul><ul><li>To check the the version of a diagram, we ...
MOSKitt GMF Extensions <ul><li>Change graphical appearance (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>...
MOSKitt GMF Extensions <ul><li>Change graphical appearance (II) </li></ul>
4. MOSKitt GMF Extensions <ul><li>Customizing links anchoring behaviour  (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><u...
4. MOSKitt GMF Extensions <ul><li>Customizing links anchoring behaviour  (II) </li></ul>
4. MOSKitt GMF Extensions <ul><li>Diagram initialization from template (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul>...
4. MOSKitt GMF Extensions <ul><li>Diagram initialization from template (II) </li></ul>Step 1: Create the template model St...
4. MOSKitt GMF Extensions <ul><li>Diagram initialization from template (III) </li></ul><ul><ul><li>Once the plug-in with t...
4. MOSKitt GMF Extensions <ul><li>Views filtering by type (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>D...
4. MOSKitt GMF Extensions <ul><li>Views filtering by type (II) </li></ul>Elements to hide
4. MOSKitt GMF Extensions <ul><li>Views filtering by type (III) </li></ul>
4. MOSKitt GMF Extensions <ul><li>Views filtering by type (IV) </li></ul>
4. MOSKitt GMF Extensions <ul><li>Views per diagram (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Remove ...
4. MOSKitt GMF Extensions <ul><li>Views per diagram (II) </li></ul>
4. MOSKitt GMF Extensions <ul><li>Views per diagram (III) </li></ul>Drag from the MOSKitt navigator to the Activity Diagram
4. MOSKitt GMF Extensions <ul><li>Multi-diagram support (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>All...
4. MOSKitt GMF Extensions <ul><li>Multi-diagram support (II) </li></ul><ul><ul><li>Navigation </li></ul></ul>Diagram Actio...
4. MOSKitt GMF Extensions <ul><li>Multi-diagram support (III) </li></ul><ul><ul><li>Manipulation </li></ul></ul>Navigator ...
4. MOSKitt GMF Extensions <ul><li>Mutating Canvas (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Associate...
4. MOSKitt GMF Extensions <ul><li>Mutating Canvas (II) </li></ul><ul><ul><li>Extend gmfgen models adding the new canvas </...
5. Conclusions <ul><li>We have been able to extend GMF successfully to cover our needs. </li></ul><ul><li>We have used the...
<ul><li>Authors </li></ul><ul><li>Javier Cano ( [email_address] ) </li></ul><ul><li>Gabriel Merin (gmerin@prodevelop.es) <...
Upcoming SlideShare
Loading in …5
×

Extending GMF

3,898 views

Published on

GMF extensions implemented on MOSKitt Project

Published in: Technology, Business
  • Be the first to comment

Extending GMF

  1. 1. <ul><li>Authors </li></ul><ul><li>Javier Cano ( [email_address] ) </li></ul><ul><li>Gabriel Merin (gmerin@prodevelop.es) </li></ul>Extending GMF: New features for your graphical editors
  2. 2. Contents <ul><li>Introduction </li></ul><ul><li>Why to extend GMF </li></ul><ul><li>Extension mechanisms </li></ul><ul><li>MOSKitt GMF Extensions </li></ul><ul><li>Conclusions </li></ul>
  3. 3. 1. Introduction <ul><li>GMF (Graphical Modeling Framework) </li></ul><ul><ul><li>It is a model driven framework to develop graphical editors based on EMF and GEF. </li></ul></ul><ul><ul><li>It provides a generative component and a runtime infrastructure </li></ul></ul><ul><ul><li>GMF is part of the Eclipse Modeling Project. </li></ul></ul>
  4. 4. 1. Introduction <ul><li>GMF (Graphical Modeling Framework) </li></ul><ul><ul><li>Java implementation avoided thanks to 4 models and a generative process: </li></ul></ul>
  5. 5. 2. Why to extend GMF <ul><li>GMF provides great graphical editors but: </li></ul><ul><ul><li>The generative process can only be customized up to a point. </li></ul></ul><ul><ul><li>All editors have a common look & feel which may not fit our needs in all cases. </li></ul></ul><ul><ul><li>Some features are just not available. </li></ul></ul><ul><li>Therefore, generated editors should be considered as a good starting point but not as the final product. </li></ul>
  6. 6. 3. Extension Mechanisms <ul><li>The GMF generative process can be decomposed into the following components: </li></ul>xpand M2T Java Eclipse Plugin Components to modify .gmfgen xpand M2T Java Eclipse Plugin .gmfgen
  7. 7. 3. Extension Mechanisms <ul><li>GMF Xpand templates </li></ul><ul><ul><li>The generative process can be altered by means of modifying the Xpand templates. </li></ul></ul><ul><li>Gmfgen model extension </li></ul><ul><ul><li>Gmfgen models can be extended with new elements. </li></ul></ul><ul><ul><li>These new elements can be taken into account during the generative process. </li></ul></ul>
  8. 8. 4. MOSKitt GMF Extensions <ul><li>Due to our needs, the following extensions have been Implemented: </li></ul><ul><ul><li>Diagram versioning </li></ul></ul><ul><ul><li>Change graphical appearance </li></ul></ul><ul><ul><li>Customizing links anchoring behaviour </li></ul></ul><ul><ul><li>Diagram initialization from template </li></ul></ul><ul><ul><li>Views filtering by type </li></ul></ul><ul><ul><li>Views per diagram </li></ul></ul><ul><ul><li>Multi-diagram </li></ul></ul><ul><ul><li>Mutating canvas </li></ul></ul>
  9. 9. 4. MOSKitt GMF Extensions <ul><li>Diagram versioning (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Add a mechanism to store the diagram's editor version that initially created the diagram (set in the MANIFEST file of the plug-in). </li></ul></ul></ul><ul><ul><ul><li>Provide mechanisms to read this version afterwards (useful for migration purposes). </li></ul></ul></ul><ul><ul><li>Achieved by means of: </li></ul></ul><ul><ul><ul><li>Modifying the Xpand templates. </li></ul></ul></ul><ul><ul><ul><li>Adding an EAnnotation to the diagram to persist the diagram version. </li></ul></ul></ul><ul><ul><ul><li>Using a MOSKitt class to retrieve the diagram's version. </li></ul></ul></ul>
  10. 10. 4. MOSKitt GMF Extensions <ul><li>Diagram versioning (II) </li></ul><ul><ul><li>To check the the version of a diagram, we need to open the diagram file with the ecore editor. </li></ul></ul>Diagram version
  11. 11. MOSKitt GMF Extensions <ul><li>Change graphical appearance (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>GMF only allows changing the appearance (background/outline colour and font style) of figures with no predefined appearance. </li></ul></ul></ul><ul><ul><ul><li>We want to customize the above behaviour for each node (override behaviour & propagate to children). </li></ul></ul></ul><ul><ul><li>Achieved by means of: </li></ul></ul><ul><ul><ul><li>Modifying the Xpand templates. </li></ul></ul></ul><ul><ul><ul><li>Extending the gmfgen model. </li></ul></ul></ul><ul><ul><ul><li>Adding an EAnnotation to the diagram to persist which changes have been made regarding the default style. </li></ul></ul></ul>
  12. 12. MOSKitt GMF Extensions <ul><li>Change graphical appearance (II) </li></ul>
  13. 13. 4. MOSKitt GMF Extensions <ul><li>Customizing links anchoring behaviour (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Avoid the automatic snapping mechanism (very annoying in some cases). </li></ul></ul></ul><ul><ul><ul><li>Change the default anchoring area (the rectangle that wraps the figure) to Polygonal and Ellipsoidal areas. </li></ul></ul></ul><ul><ul><li>Achieved by means of: </li></ul></ul><ul><ul><ul><li>Modifying the EditPart's Java code. </li></ul></ul></ul>
  14. 14. 4. MOSKitt GMF Extensions <ul><li>Customizing links anchoring behaviour (II) </li></ul>
  15. 15. 4. MOSKitt GMF Extensions <ul><li>Diagram initialization from template (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Add to the new diagram wizard the possibility to initialize the model file from other models considered as templates. </li></ul></ul></ul><ul><ul><ul><li>Add the templates models through the extension points mechanism (easy to extend at any moment). </li></ul></ul></ul><ul><ul><li>Achieved by means of: </li></ul></ul><ul><ul><ul><li>Extension point definition plug-in in MOSKitt. </li></ul></ul></ul><ul><ul><ul><li>Modifying the Xpand templates. </li></ul></ul></ul>
  16. 16. 4. MOSKitt GMF Extensions <ul><li>Diagram initialization from template (II) </li></ul>Step 1: Create the template model Step 2: Extend the template extension point with the above model
  17. 17. 4. MOSKitt GMF Extensions <ul><li>Diagram initialization from template (III) </li></ul><ul><ul><li>Once the plug-in with the templates is installed it is ready to use: </li></ul></ul>
  18. 18. 4. MOSKitt GMF Extensions <ul><li>Views filtering by type (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Decide which kind of views, including nodes, links and link labels, should be displayed both in the diagram canvas and within other container views. </li></ul></ul></ul><ul><ul><li>Achieved by means of: </li></ul></ul><ul><ul><ul><li>Modifying the Xpand templates. </li></ul></ul></ul><ul><ul><ul><li>Adding EAnnotations to the diagram file to persist the filtering preferences. </li></ul></ul></ul>
  19. 19. 4. MOSKitt GMF Extensions <ul><li>Views filtering by type (II) </li></ul>Elements to hide
  20. 20. 4. MOSKitt GMF Extensions <ul><li>Views filtering by type (III) </li></ul>
  21. 21. 4. MOSKitt GMF Extensions <ul><li>Views filtering by type (IV) </li></ul>
  22. 22. 4. MOSKitt GMF Extensions <ul><li>Views per diagram (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Remove the automatic view creation behaviour. </li></ul></ul></ul><ul><ul><ul><li>Allow the user to decide exactly which elements have to be shown within a diagram. </li></ul></ul></ul><ul><ul><ul><li>Provide mechanisms for creating/deleting model views and persisting these decisions in the diagram file. </li></ul></ul></ul><ul><ul><li>Achieved by means of: </li></ul></ul><ul><ul><ul><li>Modifying the Xpand templates. </li></ul></ul></ul><ul><ul><ul><li>Adding EAnnotations to the diagram file to persist the model elements that need to be shown. </li></ul></ul></ul><ul><ul><ul><li>Making your navigator extend MOSKitt's navigator classes. </li></ul></ul></ul>Delete from model action. Drag&Drop from the navigator.
  23. 23. 4. MOSKitt GMF Extensions <ul><li>Views per diagram (II) </li></ul>
  24. 24. 4. MOSKitt GMF Extensions <ul><li>Views per diagram (III) </li></ul>Drag from the MOSKitt navigator to the Activity Diagram
  25. 25. 4. MOSKitt GMF Extensions <ul><li>Multi-diagram support (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Allow the creation of more than one diagram within the same diagram resource. </li></ul></ul></ul><ul><ul><ul><li>Provide support for diagram creation, deletion and navigation. </li></ul></ul></ul><ul><ul><ul><li>Allow more than one diagram simultaneously opened from the same digram file. </li></ul></ul></ul><ul><ul><ul><li>Make the process as agile as possible. </li></ul></ul></ul><ul><ul><li>Achieved by means of: </li></ul></ul><ul><ul><ul><li>Modifying the Xpand templates. </li></ul></ul></ul><ul><ul><ul><li>Java Classes for navigator, diagram actions, editor & document providers. </li></ul></ul></ul><ul><ul><ul><li>Making your navigator extend MOSKitt's navigator classes. </li></ul></ul></ul>Share the Edit. domain among other editors. Resource Caching.
  26. 26. 4. MOSKitt GMF Extensions <ul><li>Multi-diagram support (II) </li></ul><ul><ul><li>Navigation </li></ul></ul>Diagram Actions View Actions Navigator Actions
  27. 27. 4. MOSKitt GMF Extensions <ul><li>Multi-diagram support (III) </li></ul><ul><ul><li>Manipulation </li></ul></ul>Navigator Actions Views & Diagram Actions
  28. 28. 4. MOSKitt GMF Extensions <ul><li>Mutating Canvas (I) </li></ul><ul><ul><li>Goal: </li></ul></ul><ul><ul><ul><li>Associate the diagram canvas with more than one element (ex: in uml2 a UseCase diagram can be created within a Package or another UseCase). </li></ul></ul></ul><ul><ul><ul><li>If there is more than one canvas element, top nodes are likely to be stored in different features. A mechanism should be provided to specify this data. </li></ul></ul></ul><ul><ul><li>Achieved by means of: </li></ul></ul><ul><ul><ul><li>Extending gmfgen model file. </li></ul></ul></ul><ul><ul><ul><li>Modifying Xpand templates. </li></ul></ul></ul>
  29. 29. 4. MOSKitt GMF Extensions <ul><li>Mutating Canvas (II) </li></ul><ul><ul><li>Extend gmfgen models adding the new canvas </li></ul></ul><ul><ul><li>Add the new containment features if needed </li></ul></ul><ul><ul><li>Generate the diagram editor code </li></ul></ul>
  30. 30. 5. Conclusions <ul><li>We have been able to extend GMF successfully to cover our needs. </li></ul><ul><li>We have used the mechanism that GMF provides in order to extend it's functionality. </li></ul><ul><li>These extensions have been applied to all MOSKitt diagrams. </li></ul><ul><li>Anyone can take advantage of them using the templates contained within the es.cv.gvcase.mdt.common plug-in. </li></ul>
  31. 31. <ul><li>Authors </li></ul><ul><li>Javier Cano ( [email_address] ) </li></ul><ul><li>Gabriel Merin (gmerin@prodevelop.es) </li></ul>Extending GMF: New features for your graphical editors

×