public class LayoutPolicy extends XYLayoutEditPolicy {
@Override
protected Command createChangeConstraintCommand(EditPart child,
Object constraint) {
VertexMoveCommand command = null;
if (child instanceof VertexEditPart) {
VertexEditPart editPart = (VertexEditPart) child;
Vertex vertex = (Vertex) editPart.getModel();
command = new VertexMoveCommand(vertex, (Rectangle) constraint);
}
return command;
}