Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Extending the Graphiti Metamodel
Extending the Graphiti Metamodel [message #1110166] Mon, 16 September 2013 09:25 Go to next message
Eclipse User
Hi there,

I would like to know which of these two solutions may be the good one to
extend the Graphiti Metamodel concepts from the package "pictograms".
For example, I want to introduce a new concept "MyCustomContainerShape"
which is a particular "ContainerShape" with new attributes and references.

I think about two solutions :

I - Extending the Graphiti Metamodel

In this solution, I choose to develop an extension of the Graphiti
Metamodel whith the new concept: MyCustomContainerShape
-> ContainerShape -> Shape
(-> for extending).

Then, once the ecore created, I generate the code of my custom factory
with the gen model referencing the graphiti genmodel.

Finally, in my addFeature code, I use both the peCreateService and my
own factory to create either Shape / Container Shape or MyCustomContainer.

II - Creating a new uncoupled Metamodel

In my second solution, I choose to design a new metamodel with my new
concept: MyCustomContainerShape.

Then, in my addFeature code, I create a ContainerShape, a
MyCustomContainerShape, and link the Container Shape to both the
MyCustomContainerShape and the BusinessObject. This gives the following
scheme:


Business Object --- Pictogram Container Shape --- MyCustomContainerShape
(--- is a link) where :

- Business Object is my Business Object serialized in my Business Model
Resource ;
- Pictogram Container Shape is the Graphiti Container Shape serialized
in my Diagrame Resource ;
- MyCustomContainerShape is my new concept serialized in my Diagram
Resource, enhancing the Container Shape with attributes et references.


Is one of these two solutions may be implementable ?

Thanks in advance,

Regards,

--
Nicolas H
Re: Extending the Graphiti Metamodel [message #1110323 is a reply to message #1110166] Mon, 16 September 2013 14:29 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas Graf
Messages: 151
Registered: July 2009
Senior Member
Yes, it is: http://5ise.quanxinquanyi.de/2012/12/13/the-way-we-use-graphiti/
Re: Extending the Graphiti Metamodel [message #1110670 is a reply to message #1110323] Tue, 17 September 2013 02:55 Go to previous message
Eclipse User
Le 16/09/13 20:29, Andreas Graf a écrit :
> Yes, it is:
> http://5ise.quanxinquanyi.de/2012/12/13/the-way-we-use-graphiti/


Hi,

Thanks a lot,

This is exactly what I was looking for and I was hoping that the
metamodel extension solution was better solution than adding link with
an uncoupled metamodel.

Regards,

--
Nicolas H
Previous Topic:Undo a feature
Next Topic:Help Moving Shapes
Goto Forum:
  


Current Time: Thu Jul 24 16:05:23 EDT 2014

Powered by FUDForum. Page generated in 0.11714 seconds