Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF without a model elements file
GMF without a model elements file [message #183835] Tue, 22 April 2008 12:40 Go to next message
Eclipse UserFriend
Originally posted by: cold.phusion.gmail.com

Hi all,

I have a question regarding the sources of model elements for the GMF
diagrams. AFAIK there are only two options:
- a single file that stores both model elements and diagram information.
- two separate files - one for the model elements and one for the
diagram information.
Unfortunately, in both cases the model elements are available only for
the current diagram.
Is there a way to keep all diagram models in a single place and then
load specific elements to the diagrams - like a model provider, sort of
speak?

Thanks,
Alex
Re: GMF without a model elements file [message #183842 is a reply to message #183835] Tue, 22 April 2008 12:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

Write custom logic to serialize EMF Resource; it's an API - you may
provide arbitrary implementation.

Alexander Shterev wrote:
> Hi all,
>
> I have a question regarding the sources of model elements for the GMF
> diagrams. AFAIK there are only two options:
> - a single file that stores both model elements and diagram information.
> - two separate files - one for the model elements and one for the
> diagram information.
> Unfortunately, in both cases the model elements are available only for
> the current diagram.
> Is there a way to keep all diagram models in a single place and then
> load specific elements to the diagrams - like a model provider, sort of
> speak?
>
> Thanks,
> Alex
Re: GMF without a model elements file [message #183851 is a reply to message #183835] Tue, 22 April 2008 12:53 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Alexander,

You can try shortcutting functionality - using this feature you can add arbitrary
model element onto your diagram. This functionality used in GMF-generated
ecore diagram example - you can play with it.

-----------------
Alex Shatalin
Re: GMF without a model elements file [message #184690 is a reply to message #183851] Tue, 29 April 2008 11:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cold.phusion.gmail.com

Thank you for the replies. I've tried a couple of things, including a
tutorial about creating multiple diagrams for the same domain model -
this way two diagrams can write in the same DiagramDocument. I'm stuck,
however, on supplying the diagram with a different resource rather than
a file. The instances of the models must be synchronized with a server
and parsing a data file is not a suitable option.

I tried to follow the hint of Dmitry, but I'm not sure which classes
should be overwritten. My suggestions for the time are IDiagramDocument
and IDocumentProvider.

If you have any further hints, I would appreciate it :]


Regards,
Alexander



Alex Shatalin wrote:
> Hello Alexander,
>
> You can try shortcutting functionality - using this feature you can add
> arbitrary model element onto your diagram. This functionality used in
> GMF-generated ecore diagram example - you can play with it.
>
> -----------------
> Alex Shatalin
>
>
Re: GMF without a model elements file [message #184806 is a reply to message #184690] Wed, 30 April 2008 10:42 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Alexander,

> rather than a file. The instances of the models must be synchronized
> with a server and parsing a data file is not a suitable option.
You can try implementing/registering own resource factory + use custom URI
to address (load into the GMF editor) model elements.

-----------------
Alex Shatalin
Re: GMF without a model elements file [message #187269 is a reply to message #184806] Thu, 15 May 2008 12:15 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,
i think i have quite the same issue. Does someone have an idea or
experiences with an gmf editor which works only on model instances and
not on resources. I am not sure if i understood alex´s proposal. Does
the resource factory abstract where the elements in a diagram come from?
Or does it create resources what you would think because of the name?
Would you create a resource which just forwards to the model instance?
Where is the abstraction point from where the editor manipulates a model
and not the resource?

I have two more special requirements:
- Every Diagram is part of the model itself, so it should also be an
EObject and be loaded from the model instance
- Elements of a diagram are usually not containments but only
references. Elements can be part of multiple diagrams
I am not sure if i should use GMF for this purpose or rather GEF. Are
the features "collapsing" and "link points" also avaiable if i use GEF?

Any comments are very much appreciated!
Thanks
Jonas

Alex Shatalin schrieb:
> Hello Alexander,
>
>> rather than a file. The instances of the models must be synchronized
>> with a server and parsing a data file is not a suitable option.
> You can try implementing/registering own resource factory + use custom
> URI to address (load into the GMF editor) model elements.
>
> -----------------
> Alex Shatalin
>
>
Re: GMF without a model elements file [message #187803 is a reply to message #183842] Mon, 19 May 2008 16:01 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Dmitry,
i want to make sure that i got you right, do you think the following
solution would work and make sense:
Diagrams and all elements are included in one model, the elements which
are in that diagram have references to it (e.g. diagram.getElements()).
If a diagram is opened a custom resource is instanciated, containing all
EObjects which are referenced from the corresponding diagram and a
second one containing the diagram itself. The generated gmf editor is
opened with these resources. Do you think this could work?
Thanks
Jonas


> Write custom logic to serialize EMF Resource; it's an API - you may
> provide arbitrary implementation.
>
> Alexander Shterev wrote:
>> Hi all,
>>
>> I have a question regarding the sources of model elements for the GMF
>> diagrams. AFAIK there are only two options:
>> - a single file that stores both model elements and diagram information.
>> - two separate files - one for the model elements and one for the
>> diagram information.
>> Unfortunately, in both cases the model elements are available only for
>> the current diagram.
>> Is there a way to keep all diagram models in a single place and then
>> load specific elements to the diagrams - like a model provider, sort
>> of speak?
>>
>> Thanks,
>> Alex
Re: GMF without a model elements file [message #187911 is a reply to message #187803] Tue, 20 May 2008 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg09141.html

Jonas wrote:
> Dmitry,
> i want to make sure that i got you right, do you think the following
> solution would work and make sense:
> Diagrams and all elements are included in one model, the elements which
> are in that diagram have references to it (e.g. diagram.getElements()).
> If a diagram is opened a custom resource is instanciated, containing all
> EObjects which are referenced from the corresponding diagram and a
> second one containing the diagram itself. The generated gmf editor is
> opened with these resources. Do you think this could work?
> Thanks
> Jonas
>
>
>> Write custom logic to serialize EMF Resource; it's an API - you may
>> provide arbitrary implementation.
>>
>> Alexander Shterev wrote:
>>> Hi all,
>>>
>>> I have a question regarding the sources of model elements for the GMF
>>> diagrams. AFAIK there are only two options:
>>> - a single file that stores both model elements and diagram information.
>>> - two separate files - one for the model elements and one for the
>>> diagram information.
>>> Unfortunately, in both cases the model elements are available only
>>> for the current diagram.
>>> Is there a way to keep all diagram models in a single place and then
>>> load specific elements to the diagrams - like a model provider, sort
>>> of speak?
>>>
>>> Thanks,
>>> Alex
Re: GMF without a model elements file [message #192779 is a reply to message #183835] Mon, 16 June 2008 08:47 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
see news://news.eclipse.org:119/g2om8v$n41$1@build.eclipse.org

Alexander Shterev schrieb:
> Hi all,
>
> I have a question regarding the sources of model elements for the GMF
> diagrams. AFAIK there are only two options:
> - a single file that stores both model elements and diagram information.
> - two separate files - one for the model elements and one for the
> diagram information.
> Unfortunately, in both cases the model elements are available only for
> the current diagram.
> Is there a way to keep all diagram models in a single place and then
> load specific elements to the diagrams - like a model provider, sort of
> speak?
>
> Thanks,
> Alex
Previous Topic:Diagram Partitioning issue : frozen sub-diagram
Next Topic:custom figures
Goto Forum:
  


Current Time: Sat Apr 27 04:32:25 GMT 2024

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

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

Back to the top