use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class StageMouseListenerTest method draggingInvokesEnteredAndExited.
@Test
public void draggingInvokesEnteredAndExited() throws Exception {
MockPanel child2Panel = new MockPanel();
parent.add(child2Panel);
child2Panel.setLocation(1, 1);
child2Panel.setSize(100, 100);
assertNull(listener.hooveredPanel);
MockEventAction parentDragAction = new MockEventAction();
parent.getEventHandler().add(MouseDraggedEvent.class, parentDragAction);
listener.mousePressed(event(0, 0));
listener.mouseDragged(event(0, 0));
assertSame(parent, listener.hooveredPanel);
checkEvent(parentDragAction, MouseDraggedEvent.class, 0, 0);
parentDragAction.reset();
MockEventAction child2EnteredAction = new MockEventAction();
child2Panel.getEventHandler().add(MouseEnteredEvent.class, child2EnteredAction);
listener.mouseDragged(event(50, 50));
assertSame(child2Panel, listener.hooveredPanel);
checkEvent(parentDragAction, MouseDraggedEvent.class, 50, 50);
checkEvent(child2EnteredAction, MouseEnteredEvent.class, 50, 50);
MockEventAction child2ExitedAction = new MockEventAction();
child2Panel.getEventHandler().add(MouseExitedEvent.class, child2ExitedAction);
MockEventAction childEnteredAction = new MockEventAction();
child.getEventHandler().add(MouseEnteredEvent.class, childEnteredAction);
listener.mouseDragged(event(500, 500));
assertSame(child, listener.hooveredPanel);
checkEvent(child2ExitedAction, MouseExitedEvent.class, 500, 500);
checkEvent(childEnteredAction, MouseEnteredEvent.class, 500, 500);
}
use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class ProductionEventTest method setUp.
@Before
public void setUp() throws Exception {
production = new FakeProduction();
event = new TestableProductionEvent();
action = new MockEventAction();
}
use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class EventHandlerTest method setUp.
@Before
public void setUp() throws Exception {
handler = new EventHandler();
action = new MockEventAction();
}
use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class StageTest method settingTheSceneOnAnOpenedStage.
@Test
public void settingTheSceneOnAnOpenedStage() throws Exception {
stage.open();
FakeScene scene = new FakeScene();
MockEventAction action = new MockEventAction();
scene.getEventHandler().add(SceneOpenedEvent.class, action);
stage.setScene(scene);
assertEquals(stage, scene.getStage());
assertEquals(true, action.invoked);
}
use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class StageTest method openingAStageWithAScene.
@Test
public void openingAStageWithAScene() throws Exception {
FakeScene scene = new FakeScene();
MockEventAction action = new MockEventAction();
scene.getEventHandler().add(SceneOpenedEvent.class, action);
stage.setScene(scene);
assertEquals(false, action.invoked);
stage.open();
assertEquals(true, action.invoked);
}
Aggregations