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();
}
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());
}
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));
}
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());
}
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) {
}
}
Aggregations