Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Update Diagram for create
Update Diagram for create [message #654532] Wed, 16 February 2011 08:57 Go to next message
John Georgakis is currently offline John GeorgakisFriend
Messages: 2
Registered: February 2011
Junior Member
Hi,

Is there a way to update the diagram when new business objects are created in the EMF model.
It seems that the domainlistener doesn't detect this
Is it needed to subclass the NotificationService ?

Thanks !
Re: Update Diagram for create [message #654554 is a reply to message #654532] Wed, 16 February 2011 09:49 Go to previous messageGo to next message
Matthias Gorning is currently offline Matthias GorningFriend
Messages: 81
Registered: April 2010
Location: Germany
Member
There is no way in Grahiti. There are only listeners for those business objects which do have a graphical representation.

I think the NotificationService is the wrong place for that what you want.

You should write your own domain listener, where you can handle new objects and if necessary change the diagram model.

BR,
Matthias
Re: Update Diagram for create [message #654598 is a reply to message #654532] Wed, 16 February 2011 13:07 Go to previous messageGo to next message
Dobrou Mising name is currently offline Dobrou Mising nameFriend
Messages: 16
Registered: December 2010
Junior Member
What about this scenario:

You have all business objects stored in one root business object.
All business objects ale linked from corresponding diagram elements AND Diagram object (that is root of diagram) has link to root business object.

Now create update feature for Diagram object, that checks if Diagram contains elements for all objects from linked root business object.


Graphiti should listen for changes on business object linked from Diagram (same way as it's done for normal diagram elements).
Re: Update Diagram for create [message #654810 is a reply to message #654598] Thu, 17 February 2011 09:25 Go to previous messageGo to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 108
Registered: October 2010
Senior Member
I would not artificially store lots of references to domain objects in your Graphiti editor. That 'pollutes' your editor.

For your goal you can use the EMF notifications (lots of tutorials and documentation available on the web). This will allow you to listen to all changes you need and do anything you want whenever an EMF object changes or is created.

We are doing exactly the same in our application. In our case we use CDO for storing objects and listen through CDO to changes in the domain objects. Based on that we update any open editors when needed.

Jos
Re: Update Diagram for create [message #654915 is a reply to message #654554] Thu, 17 February 2011 15:32 Go to previous message
John Georgakis is currently offline John GeorgakisFriend
Messages: 2
Registered: February 2011
Junior Member
As I do not have a root object, I have tried the solution of Matthias and it seems to work.

I do understand why this store a lot of references. I think there is only refs in the pictolinks and you need them to update each pictogram

The problem was, with the defult DomainChangeListener, that only modification are detected and that there is no update of the diagram if an object is created or deleted

Thanks for your help
Previous Topic:Custom feature always marks editor as dirty
Next Topic:Might be able to sponsor a developer to make an open source graphiti app
Goto Forum:
  


Current Time: Mon Dec 22 04:16:09 GMT 2014

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

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