One CreateFeature for many palette entries [message #903410] |
Thu, 23 August 2012 14:10 |
Stefan Wülfrath Messages: 18 Registered: February 2012 |
Junior Member |
|
|
Hi,
how can a CreateFeature detect which PaletteEntry was used to call it?
In my metamodel I have so called "Element"s and "ElementType"s. Each element has an element type. The list of element types is dynamic (depending on included element type libraries).
The graphical representation of an element is always the same. There is only another "type" string in the shape.
My current approach is, that the palette contains a list of all available element types. The user should select the palette entry with the desired element type and create an element of that type.
So, the element's CreateFeature has to set the element's type according to the selected palette entry. How can I achieve this?
Thank you very much for your help!
Best regards,
Stefan
|
|
|
|
|
Re: One CreateFeature for many palette entries [message #903890 is a reply to message #903711] |
Mon, 27 August 2012 07:40 |
Stefan Wülfrath Messages: 18 Registered: February 2012 |
Junior Member |
|
|
Hi Aljoscha and Michael,
thank you very much for your answers!
The approach with the extended constructor is a good suggestion!
I want to use the Graphiti patterns framework to implement the features. Do you have an idea how to implement the mentioned behaviour with Patterns?
An alternative approach could be the registration of several ElementPattern instances using different constructor parameters for the different element types but with the same implementation.
Would this be a good idea?
Thank you very much for your help!
Best regards,
Stefan
[Updated on: Mon, 27 August 2012 07:42] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04040 seconds