use of org.malai.javafx.interaction.library.DnD in project Malai by arnobl.
the class MoveShape method testCanCancelDnD.
@Test
public void testCanCancelDnD(final FxRobot robot) {
new NodeBinder<>(new DnD(true, true), i -> new MoveShape(rec), instrument).on(rec).first((i, c) -> rec.requestFocus()).then((i, c) -> c.setCoord(rec.getX() + (i.getTgtScenePoint().getX() - i.getSrcScenePoint().getX()), rec.getY() + (i.getTgtScenePoint().getY() - i.getSrcScenePoint().getY()))).end((i, c) -> fail("")).exec().bind();
robot.drag(rec).moveBy(100, 100).type(KeyCode.ESCAPE).sleep(50L);
assertEquals(0, instrument.exec.get());
}
use of org.malai.javafx.interaction.library.DnD in project Malai by arnobl.
the class TestThrottle method setUp.
@BeforeEach
void setUp() {
counter = new AtomicInteger();
binding = new NodeBinder<>(new DnD(), StubCmd::new, instrument).throttle(500L).on(widget1).then((i, c) -> counter.incrementAndGet()).bind();
}
Aggregations