Chapter 6. Define Animation Viewpoint

During the execution of a Marked Graph model, we want to visualize :

As the animation view is close to the graphical concrete syntax, we extend the existing diagram description.

First, we will define in the Language Workbench a graphical representation based on the graphical Marked Graph syntax thanks to the wizard called "Create Animator Project for language", in whichwe will add a layer to describe the graphical animation of a Marked Graph model.

Then we will be to able to visualize the states of mobel being executed in the MarkedGraph Modeling Workbench.

6.1. Create a debug representation (as an extension of the graphical editor viewpoint)

Keep the MarkedGraph Modeling Workbenchrunning and come back to the Language Workbench (first Gemoc Studio).

6.1.1. Run the wizard

Rigth-click on any file of the org.gemoc.sample.markedgraph.xdsml project and select GEMOC Language > Create Animator Project for language.

Launch the Animator wizard

Figure 6.1. Launch the Animator wizard


On the first screen of the wizad, select "Extends an existing diagram description".

Select "Extends an existing diagram description"

Figure 6.2. Select "Extends an existing diagram description"


Select the viewpoint to extend "MarkedGraph diagram".

Select the viewpoint to extend

Figure 6.3. Select the viewpoint to extend


Finally, we can fill in the Project Name in which the newly creating viewpoint file will take place (org.gemoc.sample.markedgraph.animation), the name of the viewpoint file (markedgraph-animation.odesign), the viewpoint name (MarkedGraphAnimationViewpoint) and the diagram name (MarkedGraphAnimation).

Information of the animation viewpoint

Figure 6.4. Information of the animation viewpoint


The last screen allows to choose the name of the layer to be created. Debug is a good name.

Press Finish to create the project. The markedgraph-animation.odesign file is opened.

6.1.2. Open the markedgraph-animation.odesign

Open the markedgraph-animation.odesign file and unfold its content.

Initial makedgraph-animation.odesign file

Figure 6.5. Initial makedgraph-animation.odesign file


6.1.3. Load markedgraph.odesign as a resource.

To be able to complete the definition of the odesign file, we first need to load the existing markedgraph.odesign as a resource :

  • Right click in the markedgraph-animation.odesign editor to select Load Resource…​.
  • Select Browse workspace…​
  • Select markedgraph.odesign in the org.gemoc.sample.markedgraph.design project
  • Click OK
  • Click OK

6.1.4. Add markedgraph.ecore to metamodels

  • Select "Diagram Extension MarkedGraphAnimation" element.
  • In the Properties view, select metamodels.
  • Click on "Add from workspace".
  • Select "markedgraph.ecore" (unfold the project structure)
  • Click OK