Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Same interface method in GEF and EMF
Same interface method in GEF and EMF [message #205531] Mon, 19 December 2005 13:16 Go to next message
Roger Villars is currently offline Roger VillarsFriend
Messages: 57
Registered: July 2009
Member
Hi!



I'm trying to create really simple GEF editor based on an EMF model. It only
contains nodes and connections between these nodes. There are several
examples around for this such as the workflow example in the IBM Redbook.
These examples all use the nodes to store the connection information in the
model (getNode().getIncommingConnections(),
getNode().getOutgoingConnections()). What I'm trying to do now is to move
this information to a connection object. It holds references of its start
and end node (connection.getSourceNode(), connection.getTargetNode()).



I think this should work too but there is one problem. The connection
editpart extends from AbstractConnectionEditPart which implements the
ConnectionEditPart interface.

For notification about model changes it also has to implement the Adapter
interface from EMF, which calls notifyChanged method and with this the
refreshTargetConnections() and refreshSourceConnections() methods.



Unfortunately both of these interfaces use a method with the same signature:
getTarget() with different return values. So I can only implement either the
connection functionality of GEF or the notification functionality of EMF
:-(.



Does anybody have a solution or a workaround for this?



Perhaps this problem is more EMF related. But I thought I should try it here
before cross-posting to the EMF group.



Thanks,

Roger
Re: Same interface method in GEF and EMF [message #205545 is a reply to message #205531] Mon, 19 December 2005 16:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zx.us.ibm.com

Roger Villars wrote:
> Does anybody have a solution or a workaround for this?

http://www.eclipse.org/articles/Article-GEF-EMF/gef-emf.html

I have an example included that gets around your little issue :P

http://www.eclipse.org/articles/Article-GEF-EMF/files/shapes emf.zip

Cheers,

~ Chris
Re: Same interface method in GEF and EMF [message #205634 is a reply to message #205545] Tue, 20 December 2005 07:55 Go to previous message
Roger Villars is currently offline Roger VillarsFriend
Messages: 57
Registered: July 2009
Member
Ahh, I see... you used an inner class for the adapter.

My idea was to use some kind of dummy editpart that listens
to changes in the connection model. But yours is better!

Thank you very much.

Roger

"Chris Aniszczyk" <zx@us.ibm.com> schrieb im Newsbeitrag
news:do6nu0$bbm$1@utils.eclipse.org...
> Roger Villars wrote:
>> Does anybody have a solution or a workaround for this?
>
> http://www.eclipse.org/articles/Article-GEF-EMF/gef-emf.html
>
> I have an example included that gets around your little issue :P
>
> http://www.eclipse.org/articles/Article-GEF-EMF/files/shapes emf.zip
>
> Cheers,
>
> ~ Chris
Previous Topic:Coordinate system for a layout manager
Next Topic:Can Connections be clustered and explanded?
Goto Forum:
  


Current Time: Thu Apr 25 05:30:47 GMT 2024

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

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

Back to the top