Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Node provisionning
Node provisionning [message #218813] Fri, 13 February 2009 11:18 Go to next message
Eclipse UserFriend
Hello,

I need to find a way to provision my diagram with data : ie create Nodes
by importing a file or a database. Then be able to use those nodes in my
diagram (as if I had created them from the palette).

I Managed to import some nodes with that code :

http://pastebin.com/m74acf879

This works, I got my nodes on my diagram.

Then I have to modify some properties of my newly created nodes to math
the file I import :

http://pastebin.com/m216568ce

But it only modifies the values of one node :

If I import a file with two nodes, it will modify the first created node
on the diagram with the values of the first node in the file, but then
it will modify the same node with the second value in the file...

It seems that it doesn't iterate over the elements.

What did I miss ?

Thanks.
Re: Node provisionning [message #218830 is a reply to message #218813] Fri, 13 February 2009 11:47 Go to previous message
Eclipse UserFriend
Le 13/02/2009 17:18, Rodolphe Beck a écrit :
> Hello,
>
> I need to find a way to provision my diagram with data : ie create Nodes
> by importing a file or a database. Then be able to use those nodes in my
> diagram (as if I had created them from the palette).
>
> I Managed to import some nodes with that code :
>
> http://pastebin.com/m74acf879
>
> This works, I got my nodes on my diagram.
>
> Then I have to modify some properties of my newly created nodes to math
> the file I import :
>
> http://pastebin.com/m216568ce
>
> But it only modifies the values of one node :
>
> If I import a file with two nodes, it will modify the first created node
> on the diagram with the values of the first node in the file, but then
> it will modify the same node with the second value in the file...
>
> It seems that it doesn't iterate over the elements.
>
> What did I miss ?
>
> Thanks.
Ok, I used the other method :
http://wiki.eclipse.org/index.php/GMF_Tips#Create_New_Elemen ts_Using_RecordingCommand_and_CanonicalEditPolicies

It works perfectly now :)
Previous Topic:Changing the Canvas layout
Next Topic:How I can add graphical elements to my file
Goto Forum:
  


Current Time: Thu Jul 10 09:15:45 EDT 2025

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

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

Back to the top