Search in sources :

Example 1 with MockPanel

use of limelight.ui.MockPanel in project limelight by slagyr.

the class PanelPainterLoopTest method doesLayouts.

@Test
public void doesLayouts() throws Exception {
    MockPanel panel1 = new MockPanel();
    MockPanel panel2 = new MockPanel();
    activeRoot.add(panel1);
    activeRoot.add(panel2);
    final FakeLayout layout1 = new FakeLayout(true);
    final FakeLayout layout2 = new FakeLayout(true);
    panel1.markAsNeedingLayout(layout1);
    panel2.markAsNeedingLayout(layout2);
    loop.doAllLayouts(activeRoot);
    assertEquals(panel1, layout1.lastPanelExpanded);
    assertEquals(panel2, layout2.lastPanelExpanded);
    assertEquals(false, activeRoot.isLayoutRequired());
}
Also used : MockPanel(limelight.ui.MockPanel) Test(org.junit.Test)

Example 2 with MockPanel

use of limelight.ui.MockPanel in project limelight by slagyr.

the class StageMouseListenerTest method setUp.

@Before
public void setUp() throws Exception {
    component = new java.awt.Panel();
    FakeScene root = new FakeScene();
    listener = new StageMouseListener(root);
    parent = new MockParentPanel();
    child = new MockPanel();
    root.add(parent);
    parent.add(child);
    Scene scene = new FakeScene();
    scene.add(parent);
    scene.setStage(new MockStage());
    parent.setSize(1000, 1000);
    child.setLocation(250, 250);
    child.setSize(500, 500);
    parentAction = new MockEventAction();
    childAction = new MockEventAction();
}
Also used : MockPanel(limelight.ui.MockPanel) MockEventAction(limelight.ui.model.inputs.MockEventAction) java.awt(java.awt) Before(org.junit.Before)

Example 3 with MockPanel

use of limelight.ui.MockPanel in project limelight by slagyr.

the class MouseEventTest method setUp.

@Before
public void setUp() throws Exception {
    panel = new MockPanel();
    location = new Point(123, 456);
    event = new TestableMouseEvent(321, location, 1);
    event.setSource(panel);
}
Also used : MockPanel(limelight.ui.MockPanel) Point(java.awt.Point) Before(org.junit.Before)

Example 4 with MockPanel

use of limelight.ui.MockPanel in project limelight by slagyr.

the class MouseWheelEventTest method setUp.

@Before
public void setUp() throws Exception {
    panel = new MockPanel();
    event = new MouseWheelEvent(123, new Point(1, 2), 0, MouseWheelEvent.UNIT_SCROLL, 3, 4);
}
Also used : MockPanel(limelight.ui.MockPanel) Before(org.junit.Before)

Example 5 with MockPanel

use of limelight.ui.MockPanel 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());
}
Also used : MockPanel(limelight.ui.MockPanel) MockEventAction(limelight.ui.model.inputs.MockEventAction) Test(org.junit.Test)

Aggregations

MockPanel (limelight.ui.MockPanel)40 Test (org.junit.Test)26 Panel (limelight.ui.Panel)12 Before (org.junit.Before)10 MockEventAction (limelight.ui.model.inputs.MockEventAction)4 java.util (java.util)2 MockAnimation (limelight.background.MockAnimation)2 java.awt (java.awt)1 Point (java.awt.Point)1 Box (limelight.util.Box)1