Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Custom figures creation
Custom figures creation [message #715561] Sun, 14 August 2011 13:39 Go to next message
janpojer is currently offline janpojerFriend
Messages: 40
Registered: July 2011
Member
Hi all,

I am trying to come with a special feature, that once my palette is loaded with specific buttons. I can than create item by selecting one of the buttons and droping it to canvas (regular functionality). However I am trying to find the best way of how to modify the creation code, so i can create several 'figures' under on button. Lets say I have a function and child port element. And now i want to be able to create one function with several ports only after one click in the palette. Is the FunctionEditPart the right place to proceed with the modifications? And should I use the addFixedChild with PortEditPart passed or should I use the ViewProvider...?

Anyone ever done this before?
Thanks in advance for help.
Re: Custom figures creation [message #715686 is a reply to message #715561] Mon, 15 August 2011 07:59 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

are the ports contained in the element you want to create (in the semantic model)? If yes you can simply use the FeatureSeqInitializer in gmfmap. The rest will be done by GMF.

Ralph
Re: Custom figures creation [message #715816 is a reply to message #715686] Mon, 15 August 2011 16:24 Go to previous messageGo to next message
janpojer is currently offline janpojerFriend
Messages: 40
Registered: July 2011
Member
The ports are semantically different elements. In my relationship model (ecore), there is a 0:N relation between Function and ports. The ports are mapped as child nodes of functions in my genmap file. But they are not as the ie. compartments from tutorials at gmf site.

Are FeatureSeqInitializer still good match?

Jan
Re: Custom figures creation [message #715839 is a reply to message #715816] Mon, 15 August 2011 17:48 Go to previous messageGo to next message
janpojer is currently offline janpojerFriend
Messages: 40
Registered: July 2011
Member
I tested it and it does what i need. (Thanks Ralph) With one problem though. I have two kinds of ports, one is supposed to be generated on the west side and one on the east side. When I add those ports in my modelling tool they allign appropriatly, however when i add them using feature sequence initializer ( i added three different ports) they completly misbehave and align around the top left corner of my function, disregarding my west/east side settings.

Any idea, why is that?

Thanks a lot...
Re: Custom figures creation [message #715977 is a reply to message #715839] Tue, 16 August 2011 06:42 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

a second not that nice way from my point of view is to extend the default setup method in the ElementInitializer which can be found in the provider package of your generated pulgin. The method is called something like MetaModelElementName_0000 If you decide for this solution it would make sense to use a custom template but we can discuss this later.

Ralph
Re: Custom figures creation [message #716087 is a reply to message #715977] Tue, 16 August 2011 12:40 Go to previous message
janpojer is currently offline janpojerFriend
Messages: 40
Registered: July 2011
Member
Hi,

yes, thats exactly what i did with the desired result. With the only problem that it disrespect my preset layout settings in form of EAST/WEST side. Any idea why is that?

The complete idea is to load external resource (created by another emf editor) - can for that purpose somehow use Resource manager? and on change of this resource update my palette (with items from external resource) and on clicking items from customized palette launch adjusted initializers.

Do you think that my approach is good?

Thanks a lot for your advice,

Jan
Previous Topic:How to create WrappingLabelEditPart without domain element
Next Topic:Hiding child nodes blocks space
Goto Forum:
  


Current Time: Tue Mar 19 07:41:31 GMT 2024

Powered by FUDForum. Page generated in 0.01851 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top