use of limelight.ui.MockPanel in project limelight by slagyr.
the class PanelBaseTest method createFamilyTree.
private void createFamilyTree() {
root = new FakeScene();
parent = new MockParentPanel();
root.add(parent);
child = new MockParentPanel();
parent.add(child);
grandChild = new MockPanel();
child.add(grandChild);
sibling = new MockPanel();
parent.add(sibling);
root.setStage(new MockStage());
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method shouldRemoveAll.
@Test
public void shouldRemoveAll() throws Exception {
MockPanel panel1 = new MockPanel();
MockPanel panel2 = new MockPanel();
panel.add(panel1);
panel.add(panel2);
panel.removeAll();
assertEquals(false, panel.hasChildren());
assertEquals(0, panel.getChildren().size());
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method removeRequiresUpdate.
@Test
public void removeRequiresUpdate() throws Exception {
Panel child = new MockPanel();
panel.add(child);
resetFamilyLayouts();
panel.remove(child);
assertEquals(true, panel.needsLayout());
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method shouldGetOwnerOfPoint.
@Test
public void shouldGetOwnerOfPoint() throws Exception {
Panel panel1 = new MockPanel();
Panel panel2 = new MockPanel();
panel1.setLocation(0, 0);
panel1.setSize(100, 100);
panel2.setLocation(100, 100);
panel2.setSize(100, 100);
panel.add(panel1);
panel.add(panel2);
assertSame(panel1, panel.getOwnerOfPoint(new Point(0, 0)));
assertSame(panel2, panel.getOwnerOfPoint(new Point(100, 100)));
assertSame(panel1, panel.getOwnerOfPoint(new Point(50, 50)));
assertSame(panel2, panel.getOwnerOfPoint(new Point(150, 150)));
assertSame(panel, panel.getOwnerOfPoint(new Point(150, 50)));
assertSame(panel, panel.getOwnerOfPoint(new Point(50, 150)));
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method shouldAncestorsWithAutoDimensionsRequireLayoutWhenChildrenRemoved.
@Test
public void shouldAncestorsWithAutoDimensionsRequireLayoutWhenChildrenRemoved() throws Exception {
createFamilyTree();
MockPanel newPanel = new MockPanel();
grandChild.add(newPanel);
resetFamilyLayouts();
grandChild.remove(newPanel);
assertEquals(true, grandChild.needsLayout());
assertEquals(true, child.needsLayout());
assertEquals(true, parent.needsLayout());
}
Aggregations