EnAr-Picture is the domain specific language we design to describe in an independent and simple way the graphical concepts of any metamodel representation such as nodes, relations and buttons.
Name | |
---|---|
Ivan Mauricio Melo S. | im.melo33@uniandes.edu.co |
Upnext we present the Metamodel of the language.
The following Metamodel presents the concepts of EnAr-Picture such as Nodes, relations and buttons. Other important feature of the language is that allows importing a metamodel to link the concept with the graphical representation. The Metamodel presented has 23 classes and different extension points to model every characteristic of an editor.
To explain the characteristics of this language we will use the following metamodels as examples to illustrate how we want to paint the graphical representation of them.
In this section we explain how with our language we can create a graphical representation for each of the metamodels presented above.
The following code of EnAr-Picture declares our graphical representation, set a name for it, and imports the metamodel it will represent.
Example code:
GraphicalDescription PictureExampleMM2 { Import MM2;
The next fragment of code describes the way how the concepts of the metamodel MM2 will be painted in the editor. In addition for each node we define the name of the button, description of the button, property that will appear on the node label, and descriptions of the relations (attsLinks).
Example code:
PictureFigure person {
class <- MM2.Person; label <- MM2.Person.personName; toolName <- person; toolDescription <-'a person who '; imagePath <- '/data/personFigure.png' ; attsLinks <- { salary } ; } PictureFigure salary{ class <- MM2.Salary; label <- MM2. Salary.concept; toolName <- Salary; toolDescription <- 'the salary of a Person'; imagePath <- '/data/star.png' ; }
In general there are a few ways to represent the relations between two concepts, with a line with some characteristics, painting the concepts side by side or painting a concept inside the other. Out language allows the three ways by using NodeLine, ExternalNode, InternalNode which extend the general relation (AttLink). Each of those relations have different characteristics that help customize the way is painted. In the next section of code we describe the relation between the concepts of our metamodel.
Example code:
NodeLine salary { referenceName <- salary; label <- 'salary'; style <- solid; }
Upnext a second example of an Enar-Picture script for metamodel MM2.
Example code:
import MM2;
GraphicalDescription DescriptionFromMM2{ Color pink { red= XX; green = YY; blue = ZZ; }
The Folowing code defined a Regular Picture with a Rectangle as form
RegularPicture house{ class <- MM2.House; label <- MM2.House.name; figure <- Rectangle; attsLinks <- { houseToPerson}; toolName <- "House"; toolDescription <- "A House from the Town"; }
The Folowing code defined a Regular Picture with a Circle as graphical representation of an habitant:
RegularPicture habitant { class <- MM2.Habitant; color <- pink; figure <- Ellipse; attsLinks <- { habitantToCar}; toolName <- "Habitant"; toolDescription <- "An Habitant from the Town"; } PictureFigure car{ class <- MM2.Car; imagePath <- "/data/car.png"; toolName <- "Car"; toolDescription <- "A Car from a Person"; }
Defines the graphical representation of a relatiion as a line with some characteristics:
NodeLine houseToPerson { referenceName <- MM2.House.housePeople; label <- "housePeople"; style <- solid; } NodeLine habitantToCar { referenceName <- MM2.Habitant.cars; label <- "Cars"; style <- solid; } }
Project | Version | SVN |
---|---|---|
EnAr-* | 0.3 | SVN: http://TODO/svn/trunk/enar/* |