Search in sources :

Example 31 with MockPanel

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

the class ParentPanelTest method shouldAddingPanelsAtIndexRequiresLayout.

@Test
public void shouldAddingPanelsAtIndexRequiresLayout() throws Exception {
    Panel childA = new MockPanel();
    Panel childB = new MockPanel();
    panel.add(childA);
    panel.add(0, childB);
    assertEquals(true, panel.needsLayout());
}
Also used : Panel(limelight.ui.Panel) MockPanel(limelight.ui.MockPanel) MockPanel(limelight.ui.MockPanel) Test(org.junit.Test)

Example 32 with MockPanel

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

the class ParentPanelTest method shouldRemovePanel.

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

Example 33 with MockPanel

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

the class ParentPanelTest method shouldRemoveAllRequiresUpdate.

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

Example 34 with MockPanel

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

the class ParentPanelTest method shouldAddingPanelsRequiresUpdate.

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

Example 35 with MockPanel

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

the class PanelBaseTest method overridingLayouts.

@Test
public void overridingLayouts() throws Exception {
    Panel panel = new MockPanel();
    final FakeLayout weakLayout = new FakeLayout(false);
    final FakeLayout strongLayout = new FakeLayout(true);
    panel.markAsNeedingLayout(weakLayout);
    panel.markAsNeedingLayout(strongLayout);
    assertSame(strongLayout, panel.resetNeededLayout());
}
Also used : Panel(limelight.ui.Panel) MockPanel(limelight.ui.MockPanel) 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