DOT-GMF INTEROPERABILITY

ATL Logo

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.

Keywords

GMF, Graphviz/Dot.

Overview

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 :

  • Defining Dot Abstract Syntax in MDE technical space (Dot.km3) (Note: Notation metamodel already exists).
  • Defining Dot Concrete Syntax (Dot.tcs)
    • to extract Dot Models in MDE to Models in Grammar technical space.
    • to inject Dot Models in Grammar Space to Dot models in MDE technical space after the execution of auto layout algorithm
  • Defining Transformation of UML Models to Dot Models with ATL (Notation2Dot.atl).
  • Defining Merge Transformation of source and output models (arranged model) with ATL.(MergeDotPositionIntoNotation.atl)
  • Defining execution of all transformation steps with Atl ANT tasks.(build.xml)



Dot Abstract syntax

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.



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



Notation2Dot.atl

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.atl

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.



Build Steps

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.



Sample Dot File which shows before and after structures



Full GMF to Dot transformation scenario

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.

  • At the end of these five steps, a UML Class diagrams in GMF can be auto arranged with using Dot algorithms.
  • With ATL, only defining transformations, an algorithm which is in another technical space can be used in GMF technical space.
  • Limitations: Only class diagrams are supported.With defining meta elements of other diagrams, they can be also arranged



Screenshot-1

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]



Screenshot-2

Related Use Cases

None at the current time.

References

[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/

Download

Complete project

All Project Files in zip file

Demo

Demo

Acknowledgement

The present work was completed as part of "Special Topics in Eclipse Tools for Model Engineering" course in University of Alabama at Birmingham CS693,
General Information