use of limelight.ui.MockPanel in project limelight by slagyr.
the class PanelPainterLoopTest method doesLayouts.
@Test
public void doesLayouts() throws Exception {
MockPanel panel1 = new MockPanel();
MockPanel panel2 = new MockPanel();
activeRoot.add(panel1);
activeRoot.add(panel2);
final FakeLayout layout1 = new FakeLayout(true);
final FakeLayout layout2 = new FakeLayout(true);
panel1.markAsNeedingLayout(layout1);
panel2.markAsNeedingLayout(layout2);
loop.doAllLayouts(activeRoot);
assertEquals(panel1, layout1.lastPanelExpanded);
assertEquals(panel2, layout2.lastPanelExpanded);
assertEquals(false, activeRoot.isLayoutRequired());
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class StageMouseListenerTest method setUp.
@Before
public void setUp() throws Exception {
component = new java.awt.Panel();
FakeScene root = new FakeScene();
listener = new StageMouseListener(root);
parent = new MockParentPanel();
child = new MockPanel();
root.add(parent);
parent.add(child);
Scene scene = new FakeScene();
scene.add(parent);
scene.setStage(new MockStage());
parent.setSize(1000, 1000);
child.setLocation(250, 250);
child.setSize(500, 500);
parentAction = new MockEventAction();
childAction = new MockEventAction();
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class MouseEventTest method setUp.
@Before
public void setUp() throws Exception {
panel = new MockPanel();
location = new Point(123, 456);
event = new TestableMouseEvent(321, location, 1);
event.setSource(panel);
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class MouseWheelEventTest method setUp.
@Before
public void setUp() throws Exception {
panel = new MockPanel();
event = new MouseWheelEvent(123, new Point(1, 2), 0, MouseWheelEvent.UNIT_SCROLL, 3, 4);
}
use of limelight.ui.MockPanel in project limelight by slagyr.
the class PanelEventTest method dispatching.
@Test
public void dispatching() throws Exception {
MockPanel recipient = new MockPanel();
MockEventAction action = new MockEventAction();
recipient.getEventHandler().add(event.getClass(), action);
event.dispatch(recipient);
assertEquals(event, action.event);
assertEquals(source, event.getSource());
assertEquals(source, event.getRecipient());
}
Aggregations