Element creation

Use gmfmap to create elements or connectors. Using this file instead of the ecore, gmfgraph and gmftool files is a recommendation of GMF and has nothing to do with PARADIGM-ME.

Domain element creation

Dentro do modelo de domínio apresentado clicar com o botão direito do rato em Paradigm. Right-click Paradigm. Choose “New Child” and press the element to create. Select the newly created element and edit its properties (properties tab). To insert attributes or references execute the same steps, but use as starting point the element instead of Paradigm.

Graphical element creation

Similar to creating a domain element, but in the graphical mode. The type of graphical element depends on what is expected for visualization, if you want a node add a Node, else if you want a connector choose Connection. After this add a Figure Descriptor in Figure Gallery. Add the desired formas as child(s) of Figure descriptor . If you want an image to the element add just a Rectangle with flow layout as child and follow the steps described in Image as graphical representation of an element.

Tool creation

In the tool model part, right-click the group to associate the tool. Select New Child and Creation tool.

Mapping created element

Em mapping pressione botão direito selecione New Child e escolhe o que mais lhe convém. No caso de estar a mapear um elemento será Top Node Reference no caso de um conetor será Link Mapping.

Right-click mapping and select New Child and choose one of the options. In case you are mapping a node choose Top Node Reference, else if you are mapping a connector choose Link Mapping. For Elements:

  • In properties tab of Top Node Reference choose the container to store the nodes of the type you are mapping.
  • Add Node Mapping as child of Top Node Reference.
  • In properties of Node Mapping in Element select the domain element to map, in Diagram Node the graphical representation to use and in Tool the creation tool.

For Connetors:

  • In properties tab of Link Mapping choose the container to store the connetors of the type you are mapping. In source feature select the attribute to use as source and in target feature the attribute to use as destination. In Element select the domain element to map, in Diagram Node the graphical representation to use and in Tool the creation tool.
  • In case you want a label with the type of connector follow the steps in Initialization of a connector's label.

Image as graphical representation of an element

In the “figures” package add a class that extends ImageFigure. In this class a constructor similar to:

public EndFigure() { 
	super(PluginActivator.imageDescriptorFromPlugin(PluginActivator.ID,
		"icons/end.png").createImage(), 0);
 
	fFigureEndNameFigure = new WrappingLabel();
	fFigureEndNameFigure.setText("");
 
	this.add(fFigureEndNameFigure);
}

Change the path to the one where the image to be used can be found.

Script generation >>


Programmer manual

paradigmme/programmer_manual/element_creation.txt · Last modified: 2013/04/04 18:42 by tiago