Search in sources :

Example 36 with MockPanel

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

the class ParentPanelTest method shouldCanAddPanels.

@Test
public void shouldCanAddPanels() throws Exception {
    Panel panel1 = new MockPanel();
    Panel panel2 = new MockPanel();
    panel.add(panel1);
    panel.add(panel2);
    assertEquals(panel1, panel.getChildren().get(0));
    assertEquals(panel2, panel.getChildren().get(1));
}
Also used : Panel(limelight.ui.Panel) MockPanel(limelight.ui.MockPanel) MockPanel(limelight.ui.MockPanel) Test(org.junit.Test)

Example 37 with MockPanel

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

the class ParentPanelTest method shouldRemoveDoesntRequireLayoutIfNoChildWasRemoved.

@Test
public void shouldRemoveDoesntRequireLayoutIfNoChildWasRemoved() throws Exception {
    Panel child = new MockPanel();
    panel.add(child);
    resetFamilyLayouts();
    panel.remove(new MockPanel());
    assertEquals(false, panel.needsLayout());
}
Also used : Panel(limelight.ui.Panel) MockPanel(limelight.ui.MockPanel) MockPanel(limelight.ui.MockPanel) Test(org.junit.Test)

Example 38 with MockPanel

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

the class ParentPanelTest method shouldGetChildrenProvidesReadonlyList.

@Test
public void shouldGetChildrenProvidesReadonlyList() throws Exception {
    Panel child = new MockPanel();
    panel.add(child);
    java.util.List<Panel> children = panel.getChildren();
    try {
        children.add(new MockPanel());
        fail("Should have thrown exception");
    } catch (UnsupportedOperationException e) {
    }
}
Also used : Panel(limelight.ui.Panel) MockPanel(limelight.ui.MockPanel) java.util(java.util) MockPanel(limelight.ui.MockPanel) Test(org.junit.Test)

Example 39 with MockPanel

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

the class AnimationLoopTest method testShouldNotBeIdleWithAnimationTasks.

public void testShouldNotBeIdleWithAnimationTasks() throws Exception {
    loop.add(new MockAnimation(20, new MockPanel()));
    assertEquals(false, loop.shouldBeIdle());
}
Also used : MockPanel(limelight.ui.MockPanel) MockAnimation(limelight.background.MockAnimation)

Example 40 with MockPanel

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

the class AnimationLoopTest method setUp.

public void setUp() throws Exception {
    loop = new AnimationLoop();
    animation20 = new MockAnimation(20, new MockPanel());
    animation30 = new MockAnimation(30, new MockPanel());
    animation10 = new MockAnimation(10, new MockPanel());
}
Also used : MockPanel(limelight.ui.MockPanel) MockAnimation(limelight.background.MockAnimation)

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