Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Custom Connection Anchors
Custom Connection Anchors [message #556675] Thu, 02 September 2010 09:55 Go to next message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Hi @ all,
does anybody know, how to implement the standard behavior of gmf-editors
in a way, that connections no longer "snap" to the rectangular container
of a node?

I tried to implement the two methods
getTargetConnectionAnchor(ConnectionEditPart arg0) and get
SourceConnectionAnchor(ConnectionEditPart arg0) plus the two methods for
the requests.
In these methods I returned an EllipseAnchor instead of the standard
chopbox Anchor...
These were the steps, I found here in the gmf-forums, but unfortunately
these methods are never called (the request methods are called).

Also, if I add the @Override tags to the methods, an message appears to
remove the tags ("The method
getTargetConnectionAnchor(ConnectionEditPart) of type CircleEditPart
must override or implement a supertype method")

If anybody knows how to change this behavior, please let me know ;)
Thanks a lot,

Masija
Re: Custom Connection Anchors [message #556742 is a reply to message #556675] Thu, 02 September 2010 13:53 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 02-09-10 11:55, Masija wrote:
> Hi @ all,
> does anybody know, how to implement the standard behavior of gmf-editors
> in a way, that connections no longer "snap" to the rectangular container
> of a node?

This use case is actually described in the GMF book. (Yes there is one,
but it's in disguise!)

http://www.eclipse.org/resources/resource.php?id=493
(Page 94)

I have done it myself, but what it describes is overriding indeed those
two methods getSource/TargetConnectionAnchor(..) in your xxxEditPart.

rgds, Christophe

>
> I tried to implement the two methods
> getTargetConnectionAnchor(ConnectionEditPart arg0) and get
> SourceConnectionAnchor(ConnectionEditPart arg0) plus the two methods for
> the requests.
> In these methods I returned an EllipseAnchor instead of the standard
> chopbox Anchor...
> These were the steps, I found here in the gmf-forums, but unfortunately
> these methods are never called (the request methods are called).
>
> Also, if I add the @Override tags to the methods, an message appears to
> remove the tags ("The method
> getTargetConnectionAnchor(ConnectionEditPart) of type CircleEditPart
> must override or implement a supertype method")
>
> If anybody knows how to change this behavior, please let me know ;)
> Thanks a lot,
>
> Masija
Re: Custom Connection Anchors [message #556802 is a reply to message #556742] Thu, 02 September 2010 16:30 Go to previous message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Okay i solved this problem...
For
public ConnectionAnchor getSourceConnectionAnchor(
ConnectionEditPart connEditPart) {
return new EllipseAnchor(this.getFigure());

}
i imported org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditP art instead of the correct org.eclipse.gef.ConnectionEditPart Embarrassed

Sorry for the dumb question, and thanks for your reply Wink
Best regards,
Masija
Previous Topic:eContainer in OCL Expression
Next Topic:One metamodel Two Diagrams
Goto Forum:
  


Current Time: Thu Apr 25 00:31:19 GMT 2024

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

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

Back to the top