Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » To create nodes and links from code: it' possible to have a final answer about it?(Many questions about this have no answer: why?)
To create nodes and links from code: it' possible to have a final answer about it? [message #504116] Thu, 17 December 2009 10:57 Go to next message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi all,

I have posted several question in this forum, but I have got no answer; many others have posted questions about creation of semantic and graphical object from code, and there is any answer that not definitely solve the problem:

- which is the right (or best) way to do this?
- should I have to use Commands?
- should I have to use Service?
- if I have to use Commands, which kind of it I have to execute?
- why Service doesn't create semantic objects?
- ... and so on....

So, please, there is anyone who could help?

Regards,

Giovanni.
Re: To create nodes and links from code: it' possible to have a final answer about it? [message #504556 is a reply to message #504116] Mon, 21 December 2009 14:00 Go to previous messageGo to next message
Adam Neal is currently offline Adam NealFriend
Messages: 40
Registered: July 2009
Member
You seem to be asking fundemental GMF questions. It may be useful to read
some of the documentation about GMF.

But a short answer would be to:
Use Request/Commands framework (specifically the
CreateViewAndElementRequest if you want both a semantic and notational
element)
Look at IElementTypes (e.g. The element type of the conatiner that will
create the element you want :
elmType.getEditCommand(yourCreateViewAndElementRequest).exec ute(...)

Hope that sets you on track...
Good Luck

"giovanni" <g.desossi@theorematica.it> wrote in message
news:hgd2r4$m83$1@build.eclipse.org...
> Hi all,
>
> I have posted several question in this forum, but I have got no answer;
> many others have posted questions about creation of semantic and graphical
> object from code, and there is any answer that not definitely solve the
> problem:
>
> - which is the right (or best) way to do this?
> - should I have to use Commands?
> - should I have to use Service?
> - if I have to use Commands, which kind of it I have to execute?
> - why Service doesn't create semantic objects?
> - ... and so on....
>
> So, please, there is anyone who could help?
>
> Regards,
>
> Giovanni.
Re: To create nodes and links from code: it' possible to have a final answer about it? [message #504582 is a reply to message #504556] Mon, 21 December 2009 15:44 Go to previous messageGo to next message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi Adam,

thank you for your answer. I'm asking about fundamentals of GMF because instructions I read from official documentation are often simply ....er, not so clear Smile.

Thank you again, regards

Giovanni.
Re: To create nodes and links from code: it' possible to have a final answer about it? [message #505395 is a reply to message #504582] Wed, 30 December 2009 11:38 Go to previous messageGo to next message
Indigo Mising name is currently offline Indigo Mising nameFriend
Messages: 14
Registered: August 2009
Junior Member
Giovanni, I've also been frustrated about the best way to create nodes and links.

Adam, your answer is very helpful, and I agree, these are fundemental questions. I think what would be really great is a high-level overview that describes the classes in the command/request framework and their intended use. By browsing the tutorials and forums, there are lots of examples that use different approaches and and classes, such as:

DeferredCreateConnectionViewAndElementCommand
ViewAndElementDescriptor
CreateElementRequestAdapter
CreateViewAndElementRequest
CreateViewRequest
RecordingCommand
etc...

For a rookie (like me) , this stuff is very confusing (to put it mildly).

I have not be able to find anywhere (including the GMF documentation) that gives a good overview of theses classes and their use. If there is such a place, please direct me.

If you are reading this post and you have this kind of knowledge, I think it would help a lot of people and cure a lot of headaches Razz .

Finally, I tried to bypass the entire request/command framework and have GMF do the 'hard work', with some success - if you're interested, take a look at the post entitled "An easier way to create diagram elements?"

Thanks!
Re: To create nodes and links from code: it' possible to have a final answer about it? [message #505400 is a reply to message #505395] Wed, 30 December 2009 12:00 Go to previous message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi Indigo,

thanks for your solidarity Razz

I solved my last problems using the request/command pattern, but I agree with your opinion "I think what would be really great is a high-level overview that describes the classes in the command/request framework and their intended use."

Unfortunately, this is open-source code and I think the meaning is "If you need something....do it yourself!"

Happy new year, see you

Regards,

Giovanni.
Previous Topic:How can I compile and run the GMF files?
Next Topic:Change z-order of figures
Goto Forum:
  


Current Time: Wed Apr 14 14:07:23 GMT 2021

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

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

Back to the top