This work presents transformation of Graphical Modeling Framework(GMF) models to Graphviz/Dot models, and vice versa, is implemented in order to use Graphviz/dot auto-layout algorithm in GMF technical space.
|
The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for developing graphical editors based on EMF and GEF [1]. Graphviz/dot[2] draws directed graphs as hierarchies. It runs as a command line program, web visualization service, or with a compatible graphical interface. Its features include well-tuned layout algorithms for placing nodes and edge splines, edge labels, "record" shapes with "ports" for drawing data structures; cluster layouts; and an underlying file language for stream-oriented graph tools[3]. In this project, transformation of GMF models to Dot models, and vice versa, is implemented in order to use Graphviz/dot auto-layout algorithm in GMF technical space. Project has several steps :
Every Dot model conforms to above abstract syntax. The abstract syntax is specified in KM3. The following figure is an excerpt of the Dot concrete syntax.
Concrete syntax of DOT has been implemented in TCS. A grammar is automatically derived from both the KM3 metamodel and the TCS model to parse Dot files into Dot models. Following transformation shows how to map GMF meta-elements to Dot meta-elements
Node type 2001 corresponds to Class Node in notation metamodel. Association Edge is an Edge in notation metamodel which has type 4005. This edge meta-element maps to Dot Edge element.
MergeDotPositionIntoNotation Transformation is a merging activity which combine dot and notation model in refining mode to generate result notation model. Imperative statements are implemented to copy elements. During the copy, generated position values assign into corresponding node elements of notation. Helper is used to query position information from dot model. Execution of loading, transformation and saving steps are coded in ant files with ATL ant tasks.
Following figure shows a sample dot file. Before the execution of auto-arrange algorithm dot file includes only node and edge definitions without position attributes. All the position data are inserted after the execution of layout algorithm.
GMF model is tranformed using Notation2Dot.atl. Generated Dot model is extracted and manipulated in DOT technical space. Graphviz Dot.exe program is executed to arrange model. Manipulated model inject in to MDE technical space. Auto-Arranged model and existing model are merged using MergeDotPositionIntoNotation.atl and finally GMF model is generated.
All these steps are included as an Eclipse plugin in to Class Diagram Editor. As shown in Screenshot-1 Graphviz AutoLayout sub-menu can be used to auto arrange Class Diagrams in editor. Following picture shows after the execution of layout algorithm within Topcased Environment[4]
|
|
None at the current time. |
| [1] | http://www.eclipse.org/gmf/ |
| [2] | http://www.graphviz.org/ |
| [3] | Emden Gansner and Eleftherios Koutsofios and Stephen North, "Drawing graphs with dot", 2006 |
| [4] | http://www.topcased.org/ |
Complete project |
All Project Files in zip file |
Demo |
Demo |
| The present work was completed as part of "Special Topics in Eclipse Tools for Model Engineering" course in University of Alabama at Birmingham CS693, |