Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » 2 GMF Diagrams based on the same model at runtime
2 GMF Diagrams based on the same model at runtime [message #199466] Wed, 30 July 2008 02:42 Go to next message
Eclipse UserFriend
Originally posted by: s.gil.gmx.com

Hi all,


I am currently working on a project in which I need to work in 2 or more GMF
diagrams which uses the same model (ecore).

The problem is that the second GMF diagram needs to define its elements
based on the result of the FIRST GMF diagram.

BUT even thought, both of them are running on the same eclipse, I cannot
access the elements created BY the first diagram on the second one.

(Both diagrams use the SAME ecore, and generated classes at runtime.).



Does anyone know how can I do that?


I think it is because both diagrams DO NOT persist the results on the same
"model" file (the result of a GMF diagram, is a diagram file which persists
the graphical things, and a "model file").

Is there a way to make 2 GMF diagrams persist its results on the same
"model" file?

Or is there a way to "import" the "model" results of 1 GMF diagram, into the
"model file" in the second diagram?



Any help appreciated.

Thanks in advance
Re: 2 GMF Diagrams based on the same model at runtime [message #199564 is a reply to message #199466] Wed, 30 July 2008 14:41 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Santiago,

Try calling "Initialize <2-nd>_diagram diagram file" popup menu action on
the .model file created by first diagram. As a result you should be able
to choose elements created on 1-st diagram and create 2-nd diagram for them.
This is a way to "link" two diagrams with the same model file. In addition
diagram partitioning feature can be useful for youe use cases: http://wiki.eclipse.org/GMF_2.0_New_and_Noteworthy#Basic_sup port_for_diagram_partitioning.

-----------------
Alex Shatalin
Re: 2 GMF Diagrams based on the same model at runtime [message #199712 is a reply to message #199564] Fri, 01 August 2008 03:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: s.gil.gmx.com

thanks Shatalin,

i ll give a try to the diagram partitioning,

Alex,
thanks for your help,

do you know where can i find some documentation on how to use "diagram
partitioning" ?
any clues would be great,

thanks,
Santiago Gil


"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e624da38cac07a398b3cbd@news.eclipse.org...
> Hello Santiago,
>
> Try calling "Initialize <2-nd>_diagram diagram file" popup menu action on
> the .model file created by first diagram. As a result you should be able
> to choose elements created on 1-st diagram and create 2-nd diagram for
> them. This is a way to "link" two diagrams with the same model file. In
> addition diagram partitioning feature can be useful for youe use cases:
> http://wiki.eclipse.org/GMF_2.0_New_and_Noteworthy#Basic_sup port_for_diagram_partitioning.
>
> -----------------
> Alex Shatalin
>
>
Re: 2 GMF Diagrams based on the same model at runtime [message #199728 is a reply to message #199712] Fri, 01 August 2008 03:29 Go to previous messageGo to next message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
There are a couple of existing news postings on diagram partitioning...

http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06184.html
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg05492.html
Re: 2 GMF Diagrams based on the same model at runtime [message #199735 is a reply to message #199564] Fri, 01 August 2008 04:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: s.gil.gmx.com

Hello, and thanks for your answer..
ill check the links, and try them in my project...

but I what i need in my project is to persist the behaviour of the "Add
Resource.." functionality (Which links the 2 diagram file).
Is there a way i could make this link between the two diagrams permanent?
either at runtime, programatically or modifying the .xml?

thanks in advance.

Santiago Gil


"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e624da38cac07a398b3cbd@news.eclipse.org...
> Hello Santiago,
>
> Try calling "Initialize <2-nd>_diagram diagram file" popup menu action on
> the .model file created by first diagram. As a result you should be able
> to choose elements created on 1-st diagram and create 2-nd diagram for
> them. This is a way to "link" two diagrams with the same model file. In
> addition diagram partitioning feature can be useful for youe use cases:
> http://wiki.eclipse.org/GMF_2.0_New_and_Noteworthy#Basic_sup port_for_diagram_partitioning.
>
> -----------------
> Alex Shatalin
>
>
Re: 2 GMF Diagrams based on the same model at runtime [message #199759 is a reply to message #199735] Fri, 01 August 2008 07:43 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Santiago,

> ill check the links, and try them in my project...
> but I what i need in my project is to persist the behaviour of the
> "Add
> Resource.." functionality (Which links the 2 diagram file).
> Is there a way i could make this link between the two diagrams
> permanent?
> either at runtime, programatically or modifying the .xml?
> thanks in advance.

You can load second diagram in generated ???DocumentProvider (see .createDocument()
method as an entry point). This is a place where Diagram instance is loaded
from EMF Resource, so you can load another instance there based on som information
you have concerning the link between these two diagrams. If you need to store
this knowledge in a notation model - try using DiagramLinkStyle for it.

-----------------
Alex Shatalin
Previous Topic:A tree outline in GMF
Next Topic:NULL with ArrangeAll
Goto Forum:
  


Current Time: Sat Jun 06 11:41:57 GMT 2020

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

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

Back to the top