Search in sources :

Example 26 with Panel

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

the class PaintJobTest method setUp.

public void setUp() throws Exception {
    bufferedImageCache = new SimpleCache<Panel, BufferedImage>();
    pool = new BufferedImagePool(1);
    Context.instance().bufferedImageCache = bufferedImageCache;
    Context.instance().bufferedImagePool = pool;
    job = new PaintJob(new Box(100, 200, 300, 400), Colors.TRANSPARENT);
    panel = new MockProp();
    style = panel.style;
    graphics = new MockGraphics();
}
Also used : Panel(limelight.ui.Panel) BufferedImagePool(limelight.ui.BufferedImagePool) Box(limelight.util.Box) BufferedImage(java.awt.image.BufferedImage)

Example 27 with Panel

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

Example 28 with Panel

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

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

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

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