Search in sources :

Example 11 with MockPanel

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

the class ParentPanelTest method shouldClearingCacheIsRecursive.

@Test
public void shouldClearingCacheIsRecursive() throws Exception {
    panel.setLocation(20, 21);
    Box parentBounds = panel.getAbsoluteBounds();
    MockPanel child = new MockPanel();
    panel.add(child);
    child.setLocation(10, 11);
    Box childBounds = child.getAbsoluteBounds();
    panel.setLocation(30, 31);
    assertNotSame(parentBounds, panel.getAbsoluteBounds());
    assertNotSame(childBounds, child.getAbsoluteBounds());
}
Also used : MockPanel(limelight.ui.MockPanel) Box(limelight.util.Box) Test(org.junit.Test)

Example 12 with MockPanel

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

the class IlluminatedEventTest method setUp.

@Before
public void setUp() throws Exception {
    panel = new MockPanel();
    event = new IlluminatedEvent(panel);
}
Also used : MockPanel(limelight.ui.MockPanel) Before(org.junit.Before)

Example 13 with MockPanel

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

the class MouseEnteredEventTest method setUp.

@Before
public void setUp() throws Exception {
    panel = new MockPanel();
    event = new MouseEnteredEvent(0, new Point(0, 0), 0);
}
Also used : MockPanel(limelight.ui.MockPanel) Before(org.junit.Before)

Example 14 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 15 with MockPanel

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

the class StageKeyListenerTest method focusIsLostWhenChangingFocus.

@Test
public void focusIsLostWhenChangingFocus() throws Exception {
    panel.getEventHandler().add(FocusLostEvent.class, action);
    MockPanel panel2 = new MockPanel();
    panel2.getEventHandler().add(FocusGainedEvent.class, action2);
    listener.focusOn(panel);
    listener.focusOn(panel2);
    assertEquals(panel2, listener.getFocusedPanel());
    assertEquals(true, action.invoked);
    assertEquals(true, action2.invoked);
}
Also used : MockPanel(limelight.ui.MockPanel) 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