Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Connection deletion
Connection deletion [message #168232] Tue, 15 January 2008 14:02 Go to next message
James Willans is currently offline James WillansFriend
Messages: 47
Registered: July 2009
Member
When a connection is deleted from a diagram we would like connections in
the other diagrams rendering the same semantic element to be also deleted.
We are currently not getting this behaviour even though a
CanonicalConnectionEditPolicy is installed on the top level part. It
seems that refresh() is not getting called on our canonical policy when
the underlying diagram model changes as a result of deleting a connection.
I would appreciate it if someone could outline what listeners/notifiers
should be invoked as part of this process so that we can debug these?

Many thanks,

James
Re: Connection deletion [message #168249 is a reply to message #168232] Tue, 15 January 2008 15:15 Go to previous messageGo to next message
James Willans is currently offline James WillansFriend
Messages: 47
Registered: July 2009
Member
Some further info. The connection is rendering an EReference, when the
ConnectionEditPart is activated, the value of semanticProxy and
semanticElement is null. Consequently the connection is not observing
changes to the semantic model, is this correct? If so, who initially
handles the change notification which gets propogated to the
CanonicalConnectionEditPolicy (which in turn causes a refresh)?

James
Re: Connection deletion [message #168474 is a reply to message #168249] Wed, 16 January 2008 14:19 Go to previous messageGo to next message
James Willans is currently offline James WillansFriend
Messages: 47
Registered: July 2009
Member
Bounce. Any help would be much appreciated, this is a sticking point for
us.

Thanks,

James
Re: Connection deletion [message #168591 is a reply to message #168474] Thu, 17 January 2008 12:03 Go to previous messageGo to next message
James Willans is currently offline James WillansFriend
Messages: 47
Registered: July 2009
Member
I'm not sure if I'm not explaining the problem clear enough.

The domain model of Classes with Structural Features which are rendered as
Nodes and Connections using GMF. We have more than one view/diagram of
the same domain model, but they share the same in memory EditingDomain and
should synchronize on that. This works fine for Nodes, when an object is
removed from the domain model, the rendering of that node is removed from
all diagrams.

Features and their rendering as connections are not working. Removing the
value from a feature is not removing the corresponding connections from
the diagrams. I would like to understand how this should work.

Here is what I understand. When a Feature is rendered as an connection,
then the corresponding EditPart has no underlying semantic model. For
example on a ConnectionEditPart the value of:

(View)getModel()).getElement();

is Null. Therefore I assume it is up to the node's EditPart which owns
the connection to monitor changes to the features of its domain model. If
I debug handleNotificationEvent in the node's EditPart, then notifications
are arriving specifying that the appropriate feature has changed in the
domain model. However there does not seem to be the appropriate code to
processes this change and resynchronize the connections. Here is the
chaining of handleNotificationEvent(..) and the handled changes:

ShapeNodeEditPart::handleNotificationEvent(..)
- Source connections changes in node's diagram model
- Target connections changes in node's diagram model

ShapeEditPart::handleNotificationEvent(..)
- Node size changes
- Fill colour/line colour/font style
- Unresolved event types

GraphicalEditPart::handleNotificationEvent(..)
- Changes in node's diagram model persisted children
- Node visibility
- Other changes to node's diagram model

No where is their a branch that deals with changes to features of the
rendered domain element. Where should this be handled?

Thanks,

James
Re: Connection deletion [message #168789 is a reply to message #168591] Fri, 18 January 2008 14:49 Go to previous messageGo to next message
James Willans is currently offline James WillansFriend
Messages: 47
Registered: July 2009
Member
Is this question that unusual? I'm sure connections must render features
and that a common use case is to have multiple diagrams of the same model?

James
Re: Connection deletion [message #168795 is a reply to message #168789] Fri, 18 January 2008 15:28 Go to previous messageGo to next message
Gilles Cannenterre is currently offline Gilles CannenterreFriend
Messages: 38
Registered: July 2009
Member
Hello James,

Removing node or connection from the diagram on semantic model change is
managed by canonical edit policies.
When the diagram is fully-synchronized, a canonical policy is installed
on the diagram edit part and this policy refresh nodes and connections
(all the connections in fact).
This canonical policy installed on the diagram part listen to the
diagram editpart underlying model element (and others, see activate()
method).
If your connection represents the feature of an eObject you have to take
into account that when you delete the feature the notification will only
go up to that eObject and will not go up the diagram model element and
therefore there will be no refresh for your connection because the
canonical policy responsible for synchronizing the connection will not
be triggered...(so it seems to me)

This problem will only occur when you work in the same editing domain.


A solution could be to register a new listener in the activate of the
canonical policy installed on the diagram edit part(something like an
EContentAdapter that listen to all modification).

An other solution could be to modify the delete command (in the item
semantic edit policy of the connection) to get and delete all the edge
linked to the semantic element being deleted.


best regards,

Gilles


James Willans a écrit :
> Is this question that unusual? I'm sure connections must render
> features and that a common use case is to have multiple diagrams of the
> same model?
>
> James
>
Re: Connection deletion [message #169298 is a reply to message #168795] Tue, 22 January 2008 16:03 Go to previous message
James Willans is currently offline James WillansFriend
Messages: 47
Registered: July 2009
Member
Hi Gilles,

Many thanks, your help is really appreciated. I was not sure whether the
Cannonical policy should have been synchronizing semantic changes
resulting from edge deletion or whether this was user added functionality.
Your advise helped me to realise that it was the latter, from then on it
was relatively easy to implement your suggestion:

> A solution could be to register a new listener in the activate of the
canonical
> policy installed on the diagram edit part(something like an EContentAdapter
> that listen to all modification).

Thanks again,

James
Previous Topic:Accessing and Editing Diagram Element Properties
Next Topic:EMF still alive
Goto Forum:
  


Current Time: Thu Apr 18 07:12:09 GMT 2024

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

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

Back to the top