use of limelight.ui.MockPanel in project limelight by slagyr.
the class MouseEventTest method locationIsRelativeToChangedPanel.
@Test
public void locationIsRelativeToChangedPanel() throws Exception {
panel.setLocation(23, 56);
assertEquals(100, event.getLocation().x);
assertEquals(400, event.getLocation().y);
MockPanel recipient = new MockPanel();
recipient.setLocation(100, 400);
event.setRecipient(recipient);
assertEquals(23, event.getLocation().x);
assertEquals(56, event.getLocation().y);
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class MouseExitedEventTest method setUp.
@Before
public void setUp() throws Exception {
panel = new MockPanel();
event = new MouseExitedEvent(0, new Point(0, 0), 0);
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method shouldSterilization.
@Test
public void shouldSterilization() throws Exception {
panel.sterilize();
try {
panel.add(new MockPanel());
fail("Should have thrown an exception");
} catch (SterilePanelException e) {
assertEquals("The panel for prop 'TestableParentPanel' has been sterilized. Child components may not be added.", e.getMessage());
}
assertEquals(0, panel.getChildren().size());
assertEquals(true, panel.isSterilized());
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class ParentPanelTest method createFamilyTree.
private void createFamilyTree() {
root = new FakeScene();
parent = new MockParentPanel();
root.add(parent);
child = new MockParentPanel();
parent.add(child);
grandChild = new MockParentPanel();
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 shouldGetOwnerOfPointWithOverlappingFloaters.
@Test
public void shouldGetOwnerOfPointWithOverlappingFloaters() throws Exception {
MockPanel child1 = new MockPanel();
child1.setLocation(0, 0);
child1.setSize(100, 100);
MockPanel floater1 = new MockPanel();
floater1.floater = true;
floater1.setLocation(10, 10);
floater1.setSize(50, 50);
MockPanel floater2 = new MockPanel();
floater2.floater = true;
floater2.setLocation(40, 40);
floater2.setSize(50, 50);
panel.add(child1);
panel.add(floater1);
panel.add(floater2);
assertSame(child1, panel.getOwnerOfPoint(new Point(0, 0)));
assertSame(floater2, panel.getOwnerOfPoint(new Point(50, 50)));
assertSame(floater1, panel.getOwnerOfPoint(new Point(20, 20)));
assertSame(floater2, panel.getOwnerOfPoint(new Point(80, 80)));
}
Aggregations