use of limelight.ui.Panel in project limelight by slagyr.
the class StageMouseListener method mouseMoved.
public void mouseMoved(MouseEvent e) {
if (getRoot() == null)
return;
Panel panel = panelFor(e.getPoint());
if (panel != hooveredPanel)
transition(panel, e);
new MouseMovedEvent(e.getModifiers(), e.getPoint(), e.getClickCount()).dispatch(panel);
}
use of limelight.ui.Panel in project limelight by slagyr.
the class StageMouseListener method transition.
private void transition(Panel panel, MouseEvent e) {
if (hooveredPanel == null) {
new MouseEnteredEvent(e.getModifiers(), e.getPoint(), e.getClickCount()).dispatch(panel);
enter(panel, panel, e);
} else if (hooveredPanel.isDescendantOf(panel))
exit(hooveredPanel, panel, e);
else if (panel.isDescendantOf(hooveredPanel))
enter(panel, hooveredPanel, e);
else {
Panel ancestor = hooveredPanel.getClosestCommonAncestor(panel);
exit(hooveredPanel, ancestor, e);
enter(panel, ancestor, e);
}
hooveredPanel = panel;
}
use of limelight.ui.Panel in project limelight by slagyr.
the class PanelEvent method dispatch.
public void dispatch(Panel panel) {
if (source == null)
setSource(panel);
Panel previousRecipient = recipient;
setRecipient(panel);
final PanelEventHandler eventHandler = recipient.getEventHandler();
eventHandler.dispatch(this);
setRecipient(previousRecipient);
}
use of limelight.ui.Panel in project limelight by slagyr.
the class DropDownPanelTest method itemsIsSelectedOnMouseEnter.
@Test
public void itemsIsSelectedOnMouseEnter() throws Exception {
panel.setChoicesVargs(1, 2, 3);
new ButtonPushedEvent().dispatch(panel);
final Panel item3 = panel.getPopup().getPopupList().getChildren().get(2);
new MouseEnteredEvent(0, null, 0).dispatch(item3);
assertEquals("3", panel.getPopup().getSelectedItem().getText());
}
use of limelight.ui.Panel 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)));
}
Aggregations