EnAr-Picture

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.

Author(s)

Name Email
Ivan Mauricio Melo S. im.melo33@uniandes.edu.co

Meta-model(s) section

Upnext we present the Metamodel of the language.

Meta-model EnAr-Picture

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.

EnAr-Picture Metamodel

Examples

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.

Meta-model Example I

the following metamodel ilustrated the earnigns of a person:

 MM1

Meta-model Example II

the following metamodel ilustrated a town with Houses , Habitants and Cars

 MM2

How To: The Graphical Representation

In this section we explain how with our language we can create a graphical representation for each of the metamodels presented above.

MetaModel MM1

Import

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; 
Declaring Nodes

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'’ ;
} 
Declaring References

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; 
}

Resulting Graphical Representation

 Editor MM1


MetaModel MM2

Instruction 1

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; 
 }
} 

Resulting Graphical Representation

 Editor of MM2

Instructions of the language

Downloads

Project Version SVN
EnAr-* 0.3 SVN: http://TODO/svn/trunk/enar/*

picture.txt · Última modificación: 2011/09/13 15:28 por im.melo33
Departamento de Ingeniería de Sistemas y Computación - Facultad de Ingeniería - Universidad de los Andes
CC Attribution-Noncommercial-Share Alike 3.0 Unported
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0