firing commands when dragging a connection [message #802781] |
Mon, 20 February 2012 12:43 |
Chris B. Messages: 37 Registered: November 2011 |
Member |
|
|
Hello everybody,
as mentioned above i want to override a getCommand method that fires each time i drag a polylineconnection from one diagram to another. I've tried to implement a class that extends DiagramDragDropEditPolicy, but it is never invoked.
public class TestEditPolicy extends DiagramDragDropEditPolicy
{
@Override
public Command getCommand(Request request)
{
System.out.println("Test");
}
}
Did i choose the right edit policy class? The policy is installed in an IEditPolicyProvider instance, using the DRAG_DROP_ROLE. I don't know if this is the correct approach, maybe somebody can give me a few hints.
public class TestEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider
{
@Override
public void createEditPolicies(EditPart editPart)
{
editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE , new TetEditPolicy());
}
}
Regards
bj
[Updated on: Mon, 20 February 2012 12:43] Report message to a moderator
|
|
|
|
|
Re: firing commands when dragging a connection [message #802836 is a reply to message #802790] |
Mon, 20 February 2012 14:21 |
Chris B. Messages: 37 Registered: November 2011 |
Member |
|
|
Hi @all,
thank you for your replies.
@Andreas
I've modified configureGraphicalViewer() as suggested,but still the method is not called.
@Ralph
No, it's a figure not a semantic element, but your proposal regarding ReorientCommand sounds interesting. Finally, dragging a connection implies also a reorientation of the element. Could you provide a code sample?
Thanks,
bj
[Updated on: Mon, 20 February 2012 14:48] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03713 seconds