Search in sources :

Example 21 with Panel

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

the class ParentPanelTest method shouldGetChildrenReturnsACopiedList.

@Test
public void shouldGetChildrenReturnsACopiedList() throws Exception {
    Panel child = new MockPanel();
    panel.add(child);
    java.util.List<Panel> children = panel.getChildren();
    panel.remove(child);
    java.util.List<Panel> children2 = panel.getChildren();
    assertNotSame(children, children2);
    assertEquals(1, children.size());
    assertEquals(0, children2.size());
}
Also used : Panel(limelight.ui.Panel) MockPanel(limelight.ui.MockPanel) java.util(java.util) MockPanel(limelight.ui.MockPanel) Test(org.junit.Test)

Example 22 with Panel

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

the class ParentPanelTest method shouldAddingChildrenAtIndex.

@Test
public void shouldAddingChildrenAtIndex() throws Exception {
    Panel childA = new MockPanel();
    Panel childB = new MockPanel();
    Panel childC = new MockPanel();
    panel.add(0, childA);
    panel.add(0, childB);
    panel.add(1, childC);
    assertSame(childA, panel.getChildren().get(2));
    assertSame(childB, panel.getChildren().get(0));
    assertSame(childC, panel.getChildren().get(1));
    assertSame(panel, childA.getParent());
    assertSame(panel, childB.getParent());
    assertSame(panel, childC.getParent());
}
Also used : Panel(limelight.ui.Panel) MockPanel(limelight.ui.MockPanel) MockPanel(limelight.ui.MockPanel) Test(org.junit.Test)

Example 23 with Panel

use of limelight.ui.Panel 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 24 with Panel

use of limelight.ui.Panel 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 25 with Panel

use of limelight.ui.Panel 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)

Aggregations

Panel (limelight.ui.Panel)38 Test (org.junit.Test)13 MockPanel (limelight.ui.MockPanel)12 PropPanel (limelight.ui.model.PropPanel)9 BufferedImage (java.awt.image.BufferedImage)4 java.util (java.util)2 MockChangeablePanel (limelight.ui.model.MockChangeablePanel)2 InputPanel (limelight.ui.model.inputs.InputPanel)2 ScrollBarPanel (limelight.ui.model.inputs.ScrollBarPanel)2 Box (limelight.util.Box)2 Before (org.junit.Before)2 LinkedList (java.util.LinkedList)1 FakeProduction (limelight.model.FakeProduction)1 FakePlayerRecruiter (limelight.model.api.FakePlayerRecruiter)1 IntegerAttributeCompiler (limelight.styles.compiling.IntegerAttributeCompiler)1 SimpleIntegerValue (limelight.styles.values.SimpleIntegerValue)1 BufferedImagePool (limelight.ui.BufferedImagePool)1 limelight.ui.events.panel (limelight.ui.events.panel)1 PanelEvent (limelight.ui.events.panel.PanelEvent)1 TextLocation (limelight.ui.text.TextLocation)1