Thanks to Sergey, I managed to get it to work with the following method:
protected void dragAndDrop(Wrap<? extends Object> from, Wrap<? extends Object> to) throws InterruptedException {
Point start = scene.wrap().toLocal(from.toAbsolute(from.getClickPoint()));
Point end = scene.wrap().toLocal(to.toAbsolute(to.getClickPoint()));
scene.mouse().move(start);
scene.mouse().press();
scene.mouse().move(end);
scene.mouse().release();
}
I haven't managed to do a progressive move with a loop as he suggested: the code gets stuck at the second iteration when move
is called again.