use of limelight.ui.events.panel.MouseClickedEvent in project limelight by slagyr.
the class AbstractButtonPanelTest method aButtonParentWillAlsoGetThePushEvent.
@Test
public void aButtonParentWillAlsoGetThePushEvent() throws Exception {
PropPanel parent = new PropPanel(new FakePropProxy());
parent.add(panel);
parent.getEventHandler().add(ButtonPushedEvent.class, action);
new MouseClickedEvent(0, null, 0).dispatch(panel);
assertEquals(true, action.invoked);
assertEquals(parent, action.recipient);
}
use of limelight.ui.events.panel.MouseClickedEvent in project limelight by slagyr.
the class CheckBoxPanelTest method pushingSelectsCheckBox.
@Test
public void pushingSelectsCheckBox() throws Exception {
assertEquals(false, panel.isSelected());
new MouseClickedEvent(0, null, 0).dispatch(panel);
assertEquals(true, panel.isSelected());
}
use of limelight.ui.events.panel.MouseClickedEvent in project limelight by slagyr.
the class AbstractButtonPanelTest method buttonPressedEventInvokedWhenClicking.
@Test
public void buttonPressedEventInvokedWhenClicking() throws Exception {
panel.getEventHandler().add(ButtonPushedEvent.class, action);
new MouseClickedEvent(0, null, 0).dispatch(panel);
assertEquals(true, action.invoked);
}
use of limelight.ui.events.panel.MouseClickedEvent in project limelight by slagyr.
the class JavaPlayerTest method playerCanAddEvents.
@Test
public void playerCanAddEvents() throws Exception {
final Document doc = Xml.stringToDoc("<player class='SamplePlayer'><onMouseClicked>sampleAction</onMouseClicked></player>");
final Player player = new JavaPlayer("foo", "/testProduction/aScene/players/foo.xml", samplePlayerClass, doc.getDocumentElement(), "limelight.ui.events.panel.");
Object playerObj = player.cast(prop);
assertEquals("SamplePlayer", playerObj.getClass().getName());
assertEquals(1, prop.getEventHandler().getActions(MouseClickedEvent.class).size());
new MouseClickedEvent(0, null, 1).dispatch(prop);
assertEquals(1, samplePlayerClass.getField("invocations").get(lastSamplePlayer()));
}
Aggregations