use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class PanelEventTest method dispatching.
@Test
public void dispatching() throws Exception {
MockPanel recipient = new MockPanel();
MockEventAction action = new MockEventAction();
recipient.getEventHandler().add(event.getClass(), action);
event.dispatch(recipient);
assertEquals(event, action.event);
assertEquals(source, event.getSource());
assertEquals(source, event.getRecipient());
}
use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class StageEventTest method dispatching.
@Test
public void dispatching() throws Exception {
StageEvent event = new TestableStageEvent();
MockEventAction action = new MockEventAction();
stage.getEventHandler().add(TestableStageEvent.class, action);
event.dispatch(stage);
assertEquals(true, action.invoked);
}
use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class AlertFrameManagerTest method setUp.
@Before
public void setUp() throws Exception {
assumeTrue(TestUtil.notHeadless());
StageFrame.hiddenMode = false;
context = MockContext.stub();
manager = new AlertFrameManager(context);
context.frameManager = manager;
context.studio = new MockStudio();
context.environment = "test";
stage = new MockStage();
frame = new StageFrame(stage);
action = new MockEventAction();
}
use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class StageKeyListenerTest method setUp.
@Before
public void setUp() throws Exception {
root = new FakeScene();
listener = new StageKeyListener(root);
panel = new MockParentPanel();
root.add(panel);
component = new Panel();
action = new MockEventAction();
action2 = new MockEventAction();
}
use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.
the class StageMouseListenerTest method mouseEnteredAndExited.
@Test
public void mouseEnteredAndExited() throws Exception {
MockPanel child2Panel = new MockPanel();
parent.add(child2Panel);
child2Panel.setLocation(1, 1);
child2Panel.setSize(100, 100);
assertNull(listener.hooveredPanel);
MockEventAction moveAction = new MockEventAction();
parent.getEventHandler().add(MouseEnteredEvent.class, parentAction);
parent.getEventHandler().add(MouseMovedEvent.class, moveAction);
listener.mouseMoved(event(0, 0));
assertSame(parent, listener.hooveredPanel);
checkEvent(parentAction, MouseEnteredEvent.class, 0, 0);
checkEvent(moveAction, MouseMovedEvent.class, 0, 0);
moveAction.reset();
parentAction.reset();
MockEventAction child2MoveAction = new MockEventAction();
child2Panel.getEventHandler().add(MouseEnteredEvent.class, childAction);
child2Panel.getEventHandler().add(MouseMovedEvent.class, child2MoveAction);
listener.mouseMoved(event(50, 50));
assertSame(child2Panel, listener.hooveredPanel);
assertEquals(false, moveAction.invoked || parentAction.invoked);
checkEvent(childAction, MouseEnteredEvent.class, 50, 50);
checkEvent(child2MoveAction, MouseMovedEvent.class, 50, 50);
child2MoveAction.reset();
MockEventAction childExitAction = new MockEventAction();
MockEventAction childMoveAction = new MockEventAction();
child2Panel.getEventHandler().add(MouseExitedEvent.class, childExitAction);
child.getEventHandler().add(MouseMovedEvent.class, childMoveAction);
listener.mouseMoved(event(500, 500));
assertSame(child, listener.hooveredPanel);
checkEvent(childExitAction, MouseExitedEvent.class, 500, 500);
checkEvent(childMoveAction, MouseMovedEvent.class, 500, 500);
}
Aggregations