use of org.malai.javafx.binding.NodeBinder in project Malai by arnobl.
the class MoveShape method testCanCancelDnDWithObsList.
@Test
public void testCanCancelDnDWithObsList() {
new NodeBinder<>(MoveShape.class, new DnD(true, true), instrument).map(i -> new MoveShape((Rectangle) i.getSrcObject().get())).on(widget1.getChildren()).first((c, i) -> Platform.runLater(() -> i.getSrcObject().get().requestFocus())).then((c, i) -> c.setCoord(((Rectangle) i.getSrcObject().get()).getX() + (i.getEndScenePt().getX() - i.getSrcScenePoint().getX()), ((Rectangle) i.getSrcObject().get()).getY() + (i.getEndScenePt().getY() - i.getSrcScenePoint().getY()))).end((c, i) -> fail("")).exec().bind();
Rectangle rec2 = new Rectangle(200d, 200d, 70d, 50d);
Platform.runLater(() -> widget1.getChildren().addAll(rec2));
WaitForAsyncUtils.waitForFxEvents();
drag(rec2).moveBy(100, 100).type(KeyCode.ESCAPE).sleep(50L);
assertEquals(0, instrument.exec.get());
}
Aggregations