Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » One-click drag of the endpoint of a connector
One-click drag of the endpoint of a connector [message #670282] Fri, 13 May 2011 11:31 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: May 2011
Junior Member
I've spent a fair amount of time working on this, and haven't been able to get anything to work. I trying to make is so the user can simply click on the endpoint of a connector and drag it to another node, instead of having to select the connector and then drag. The best way I could come up with is to automatically select a connection when the mouse is over it, but still being new to GEF, I really have no idea how this would be done.

Thanks for helping out the new guy.
Re: One-click drag of the endpoint of a connector [message #670913 is a reply to message #670282] Mon, 16 May 2011 07:43 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: May 2011
Junior Member
So, I worked on it some over the weekend and it's looking like the easiest way to do this is just to create endpoint editparts and attach them somehow to the ends of the connector. Any suggestions of how to accomplish this?
Re: One-click drag of the endpoint of a connector [message #671584 is a reply to message #670913] Wed, 18 May 2011 12:07 Go to previous message
Girish Kumar is currently offline Girish KumarFriend
Messages: 48
Registered: May 2011
Member
Dear Friend ,

I dint get your question properly ...
but anyway i feel its something related to connection steps

Steps involved in creating a connection
1 selecting the connection from the palette ,
2 then followed by clicking on the source node and dragging till the target and
3 again clicking on it completes the connection ....

Instead of this you can achieve connection by drag source and drop on target ....

all you need to do is just override the method

@Override
public DragTracker getDragTracker(Request request) {
return new ConnectionDragCreationTool();
}
and install this policy in the source and target EditPart

installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
new AppConnectionPolicy());

public class AppConnectionPolicy extends GraphicalNodeEditPolicy{

//define all the Abstract methods
}
Previous Topic:Simple layout policy question
Next Topic:NPE when initialising GraphicalEditor
Goto Forum:
  


Current Time: Fri Apr 26 18:14:05 GMT 2024

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

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

Back to the top