Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Reflecting Connection source/target change from diagram to business objects
Reflecting Connection source/target change from diagram to business objects [message #657314] Wed, 02 March 2011 12:18 Go to next message
Dobrou Mising name is currently offline Dobrou Mising name
Messages: 16
Registered: December 2010
Junior Member
I have diagram with elements that are connected using Connections.
Every connection has linked business object, that stores this connection as references between another business objects.

I would like to react on situation when user clicks on Connection in diagram and moves source/target of this Connection to different element.
Connection in diagram is updated, but business object connection doesn't.


Possible solution would be using update feature. But update features are used to reflect changes from business objects to diagram elements. So it wouldn't be possible to decide in which direction changes should be reflected (data->diagram or diagram->data).

Is there any event where I can listen on changing connection source/target and reflect those changes in my data?
I investigated get* methods in feature provider, but I couldn't find any good solution.


Edit: And now I found another problem. Some elements in my diagram are not allowed to be source of Connection. Connection create feature behaves correctly, so it's not possible to create new connection from those elements. But moving source of already existing Connection is possible to elements that are not allowed to be source of Connection. So there should be some way to react and possibly don't allow moving of connection source/target.

[Updated on: Wed, 02 March 2011 12:41]

Report message to a moderator

Re: Reflecting Connection source/target change from diagram to business objects [message #657541 is a reply to message #657314] Thu, 03 March 2011 08:53 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1618
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Have you tried using a your own reconnection feature to achieve this? This
can be done by providing your own subclass of DefaultReconnectionFeature for
this connection.

Michael

"Dobrou" wrote in message news:iklc5s$tqb$1@news.eclipse.org...

I have diagram with elements that are connected using Connections.
Every connection has linked business object, that stores this connection as
references between another business objects.

I would like to react on situation when user clicks on Connection in diagram
and moves source/target of this Connection to different element.
Connection in diagram is updated, but business object connection doesn't.


Possible solution would be using update feature. But update features are
used to reflect changes from business objects to diagram elements. So it
wouldn't be possible to decide in which direction changes should be
reflected (data->diagram or diagram->data).

Is there any event where I can listen on changing connection source/target
and reflect those changes in my data?
I investigated get* methods in feature provider, but I couldn't find any
good solution.
Re: Reflecting Connection source/target change from diagram to business objects [message #658288 is a reply to message #657541] Mon, 07 March 2011 17:37 Go to previous message
Dobrou Mising name is currently offline Dobrou Mising name
Messages: 16
Registered: December 2010
Junior Member
Exactly what I need, thank you!!!
Next time, I will look more carefully on all provided "get*Feature" methods Smile
Previous Topic:Auto update when domain model changes
Next Topic:Add Feature Implementation Exposed In Serialization & Legacy Diagrams
Goto Forum:
  


Current Time: Thu Oct 23 08:11:23 GMT 2014

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

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