Search in sources :

Example 1 with MouseClickedEvent

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);
}
Also used : PropPanel(limelight.ui.model.PropPanel) MouseClickedEvent(limelight.ui.events.panel.MouseClickedEvent) FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 2 with MouseClickedEvent

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());
}
Also used : MouseClickedEvent(limelight.ui.events.panel.MouseClickedEvent) Test(org.junit.Test)

Example 3 with MouseClickedEvent

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);
}
Also used : MouseClickedEvent(limelight.ui.events.panel.MouseClickedEvent) Test(org.junit.Test)

Example 4 with MouseClickedEvent

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()));
}
Also used : Player(limelight.model.api.Player) MouseClickedEvent(limelight.ui.events.panel.MouseClickedEvent) Document(org.w3c.dom.Document) Test(org.junit.Test)

Aggregations

MouseClickedEvent (limelight.ui.events.panel.MouseClickedEvent)4 Test (org.junit.Test)4 FakePropProxy (limelight.model.api.FakePropProxy)1 Player (limelight.model.api.Player)1 PropPanel (limelight.ui.model.PropPanel)1 Document (org.w3c.dom.Document)1