Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » When does the diagram editor start listening for graphical changes ?
When does the diagram editor start listening for graphical changes ? [message #69596] Wed, 25 October 2006 18:40 Go to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Hi,
I am trying to figure out where the diagram editor starts listening for
graphical changes.

I have noticed that a CustomModificationListener was generated, and
listened to the SET changes.
I cannot find where a listener is added to the Diagram object so that
changes are reported, and the diagram editor is set to dirty. Is it
somewhere in the DocumentProvider ?

Any help appreciated !

Antoine Toulme
Re: When does the diagram editor start listening for graphical changes ? [message #69851 is a reply to message #69596] Thu, 26 October 2006 06:15 Go to previous messageGo to next message
Eclipse UserFriend
Hello Antoine,

CustomModificationListener is the only place responsible for making editor
dirty. Changes to the diagram resource are processed by it's super-class
- FileDiagramModificationListener.

-----------------
Alex Shatalin
Re: When does the diagram editor start listening for graphical changes ? [message #70454 is a reply to message #69851] Thu, 26 October 2006 18:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Alex,

actually I found out that graphical changes are handled by listening to
the ResourceSet, using a GMFResource object, for which tracking
modifications is on. If you get rid of the custom parser which goes
along with the files, graphical changes are not anymore recorded since a
XMIResource is instanciated instead of a GMFResource. See the FileLoader
and StorageLoader classes andf their load method.

Alex Shatalin wrote:
> Hello Antoine,
>
> CustomModificationListener is the only place responsible for making
> editor dirty. Changes to the diagram resource are processed by it's
> super-class - FileDiagramModificationListener.
>
> -----------------
> Alex Shatalin
>
>
Re: When does the diagram editor start listening for graphical changes ? [message #70623 is a reply to message #70454] Fri, 27 October 2006 05:47 Go to previous messageGo to next message
Eclipse UserFriend
Hello Antoine,

> actually I found out that graphical changes are handled by listening
> to the ResourceSet, using a GMFResource object, for which tracking
Can you please point me to the place where GMF is listening for corresponding
notifications from the ResourceSet?

AFAIK, GMF will not works well if you use custom ResourceFactory for diagram
resources. Looks like diagrams should be loaded by appropriate ResourceFactory
registered in the geenrated plugin.xml. In any case, this is mostly a question
to the runtime team.

-----------------
Alex Shatalin
Re: When does the diagram editor start listening for graphical changes ? [message #71163 is a reply to message #70623] Fri, 27 October 2006 18:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Alex,
I found out that a GMF Resource was used and listened to after taking
some time on the debugger. I think the ResourceSet is being listened to
through the domain. I'd be very pleased to have the guys from the
runtime team tell us about that !

Alex Shatalin wrote:
> Hello Antoine,
>
>> actually I found out that graphical changes are handled by listening
>> to the ResourceSet, using a GMFResource object, for which tracking
> Can you please point me to the place where GMF is listening for
> corresponding notifications from the ResourceSet?
> AFAIK, GMF will not works well if you use custom ResourceFactory for
> diagram resources. Looks like diagrams should be loaded by appropriate
> ResourceFactory registered in the geenrated plugin.xml. In any case,
> this is mostly a question to the runtime team.
>
> -----------------
> Alex Shatalin
>
>
Re: When does the diagram editor start listening for graphical changes ? [message #72196 is a reply to message #71163] Tue, 31 October 2006 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Antoine,

Could you clarify your question please? Unfortunately, I don't quite
understand what the issue is.

Thanks,
Cherie

Antoine Toulmé wrote:
> Alex,
> I found out that a GMF Resource was used and listened to after taking
> some time on the debugger. I think the ResourceSet is being listened to
> through the domain. I'd be very pleased to have the guys from the
> runtime team tell us about that !
>
> Alex Shatalin wrote:
>> Hello Antoine,
>>
>>> actually I found out that graphical changes are handled by listening
>>> to the ResourceSet, using a GMFResource object, for which tracking
>> Can you please point me to the place where GMF is listening for
>> corresponding notifications from the ResourceSet?
>> AFAIK, GMF will not works well if you use custom ResourceFactory for
>> diagram resources. Looks like diagrams should be loaded by appropriate
>> ResourceFactory registered in the geenrated plugin.xml. In any case,
>> this is mostly a question to the runtime team.
>>
>> -----------------
>> Alex Shatalin
>>
>>
Re: When does the diagram editor start listening for graphical changes ? [message #72233 is a reply to message #71163] Tue, 31 October 2006 10:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi Antonie ;

I'm not sure what do you mean by Graphical changes; since you are
talking about resources; I'll assume you are talking about EMF changes
to your semantic model or notation model

By default every GraphicalEditPart will add a listener to its semantic
element and notation view in the methods :

addNotationalListeners and addSemanticListeners
These methods will be called on the edit part activation, if you like
to listen to extra elements you can override these methods in your edit
part add the extra listener

Edit part handle the events in the handleNotificationEvent method, this
is where you will need to add the extra event handling code

One, thing to keep in mind though, these listeners are EObject
Listeners and not Resource level event listeners, if you like to listen
to change on the resource level not on the EObject level you can check
NoteEditPart, in this edit part i needed to listen to resource level
changes (like load and unload ), check the ResourceListener member in
this class and it should give you an idea on how to do that.


I hope this helps. If my answer is not really what you are asking about
then you can give us more details on what you are trying to archive, we
might be able to help

Thanks

Antoine Toulmé wrote:




> Alex,
> I found out that a GMF Resource was used and listened to after taking
> some time on the debugger. I think the ResourceSet is being listened to
> through the domain. I'd be very pleased to have the guys from the
> runtime team tell us about that !
>
> Alex Shatalin wrote:
>> Hello Antoine,
>>
>>> actually I found out that graphical changes are handled by listening
>>> to the ResourceSet, using a GMFResource object, for which tracking
>> Can you please point me to the place where GMF is listening for
>> corresponding notifications from the ResourceSet?
>> AFAIK, GMF will not works well if you use custom ResourceFactory for
>> diagram resources. Looks like diagrams should be loaded by appropriate
>> ResourceFactory registered in the geenrated plugin.xml. In any case,
>> this is mostly a question to the runtime team.
>>
>> -----------------
>> Alex Shatalin
>>
>>
Re: When does the diagram editor start listening for graphical changes ? [message #72248 is a reply to message #71163] Tue, 31 October 2006 11:21 Go to previous message
Eclipse UserFriend
Antoine Toulmé wrote:

One more place that might be of interest to you; is the place where the
editor make triggers the DigramEventBroker to start listening which will
be in the DiagramEditor#startListening method

> Alex,
> I found out that a GMF Resource was used and listened to after taking
> some time on the debugger. I think the ResourceSet is being listened to
> through the domain. I'd be very pleased to have the guys from the
> runtime team tell us about that !
>
> Alex Shatalin wrote:
>> Hello Antoine,
>>
>>> actually I found out that graphical changes are handled by listening
>>> to the ResourceSet, using a GMFResource object, for which tracking
>> Can you please point me to the place where GMF is listening for
>> corresponding notifications from the ResourceSet?
>> AFAIK, GMF will not works well if you use custom ResourceFactory for
>> diagram resources. Looks like diagrams should be loaded by appropriate
>> ResourceFactory registered in the geenrated plugin.xml. In any case,
>> this is mostly a question to the runtime team.
>>
>> -----------------
>> Alex Shatalin
>>
>>
Previous Topic:Only single root element allowed, forbid to D&D a second one to Root pane
Next Topic:mapping a semantic element with two graphical elements
Goto Forum:
  


Current Time: Wed Jul 16 21:21:38 EDT 2025

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

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

Back to the top