Skip to main content



      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 07:31 Go to next message
Eclipse UserFriend
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 03:43 Go to previous messageGo to next message
Eclipse UserFriend
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 08:07 Go to previous message
Eclipse UserFriend
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: Wed Apr 23 12:04:35 EDT 2025

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

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

Back to the top