use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method shouldAncestorsWithAutoDimensionsRequireLayoutWhenAllChildrenRemoved.
@Test
public void shouldAncestorsWithAutoDimensionsRequireLayoutWhenAllChildrenRemoved() throws Exception {
createFamilyTree();
MockPanel newPanel = new MockPanel();
grandChild.add(newPanel);
resetFamilyLayouts();
grandChild.removeAll();
assertEquals(true, grandChild.needsLayout());
assertEquals(true, child.needsLayout());
assertEquals(true, parent.needsLayout());
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method shouldGetOwnerOfPointWithNestedPanels.
@Test
public void shouldGetOwnerOfPointWithNestedPanels() throws Exception {
MockParentPanel panel1 = new MockParentPanel();
Panel panel2 = new MockPanel();
panel1.setLocation(50, 50);
panel1.setSize(100, 100);
panel2.setLocation(0, 0);
panel2.setSize(10, 10);
panel.add(panel1);
panel1.add(panel2);
assertSame(panel2, panel.getOwnerOfPoint(new Point(55, 55)));
}
use of limelight.ui.MockPanel 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());
}
use of limelight.ui.MockPanel 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());
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method shouldGetOwnerOfPointWithAFloater.
@Test
public void shouldGetOwnerOfPointWithAFloater() throws Exception {
MockPanel child1 = new MockPanel();
child1.setLocation(0, 0);
child1.setSize(100, 100);
MockPanel floater = new MockPanel();
floater.floater = true;
floater.setLocation(25, 25);
floater.setSize(50, 50);
panel.add(child1);
panel.add(floater);
assertSame(child1, panel.getOwnerOfPoint(new Point(0, 0)));
assertSame(floater, panel.getOwnerOfPoint(new Point(50, 50)));
}
Aggregations