Ok, it seems that this is a solution to the above question.
Extend mxGraphComponent, and implement the following method:
public Object[] importCells(Object[] cells, double dx, double dy, Object target, Point location) {
if (target == null && cells.length == 1 && location != null) {
target = getCellAt(location.x, location.y);
if (target instanceof mxICell && cells[0] instanceof mxICell) {
mxICell targetCell = (mxICell) target;
mxICell dropCell = (mxICell) cells[0];
if (targetCell.isVertex() == dropCell.isVertex()) {
// make target null, otherwise we create a group
cells = super.importCells(cells, dx, dy, null, location);
Object parent = graph.getModel().getParent(target);
// we cloned it, so update the reference
dropCell = (mxICell) cells[0];
graph.insertEdge(parent, null, "", target, dropCell);
graph.setSelectionCell(dropCell);
return null;
}
}
}
return super.importCells(cells, dx, dy, target, location);
}