Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How to update existing diagrams, if domain model structure has changed?(how to sychronize domain model structure with existing diagrams)
How to update existing diagrams, if domain model structure has changed? [message #1005489] Fri, 25 January 2013 16:31 Go to next message
Nikolai Raitsev is currently offline Nikolai Raitsev
Messages: 102
Registered: July 2009
Senior Member
Hi all,

I need a little help for following scenario.

0.) We have a Non-EMF-Domain-Model (POJO's) (just for info)

1.) We have created a lot of graphiti diagrams, for existing domain model structure. E.g. we have a domain class Statement with member Name. This POJO is represented in Graphiti as a Connection with one TextDecorator, that shows the Name. All very simple and all that works very well.

2.) Now we changed the domain model: Statement is extended now with two additional members, CardinalityFrom and CardinalityTo. The AddConnectionFeature was rewritten/extended and all new Graphiti-Connection-representations of the Statement-class are with three TextDecorators now: CardinalityFrom, Name and CardinalityTo.

Overall domain model is automatically updated with default-values. But all the old representations of Statements shows allways the old structure. So the question is, how is it possible to update the graphical representation, according to the new structure, but without to change the positioning of the main object (here Connection)? I think, something like automatically "update hook" on loading the diagram?

Many thanks in advance and best regards,

Nikolai
Re: How to update existing diagrams, if domain model structure has changed? [message #1005718 is a reply to message #1005489] Mon, 28 January 2013 11:32 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1595
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Nikolai,

there's a DefaultUpdateDiagramFeature that Graphiti uses by default for
checking if the diagram is up to date. By default this checks all directly
contained shapes (resp. their update features) if an update is needed and
does not take connections into account (they are mostly updated from a shape
update feature). You can create your own subclass of
DefaultUpdateDiagramFeature and register it for the diagram in your feature
provider.

Michael
Re: How to update existing diagrams, if domain model structure has changed? [message #1005752 is a reply to message #1005718] Mon, 28 January 2013 14:54 Go to previous message
Nikolai Raitsev is currently offline Nikolai Raitsev
Messages: 102
Registered: July 2009
Senior Member
Hello Michael,

many many thanks for your hint with DefaultUpdateDiagramFeature! It works now, but to allow the auto update, one of isAutoUpdateXXX-Methods from DiagramTypeProvider should be overwritten...

Otherwise everything is working properly now!

Many thanks and best regards,

Nikolai
Previous Topic:[0.9] Passing our own TransactionalEditingDomain
Next Topic:[0.9.1] Using Graphiti with external editing domain causes problem at clean up
Goto Forum:
  


Current Time: Thu Sep 18 09:45:03 GMT 2014

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

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