Search in sources :

Example 21 with PropPanel

use of limelight.ui.model.PropPanel in project limelight by slagyr.

the class DropDownPopup method createList.

private void createList() {
    popupList = new PropPanel(new SimplePropProxy(), Util.toMap("name", "limelight_builtin_drop_down_popup_list"));
    popupList.getStyle().addExtension(stylesStore.get("limelight_builtin_drop_down_popup_list"));
    popupList.getStyle().setX(dropDown.getParent().getAbsoluteLocation().x - dropDown.getRoot().getX());
    popupList.getStyle().setY(dropDown.getParent().getAbsoluteLocation().y - dropDown.getRoot().getY());
    popupList.getStyle().setWidth(dropDown.getParent().getWidth());
    popupList.getEventHandler().add(MouseClickedEvent.class, new EventAction() {

        public void invoke(Event event) {
        // eat the event so the curtains won't get it
        }
    });
}
Also used : PropPanel(limelight.ui.model.PropPanel) SimplePropProxy(limelight.ui.SimplePropProxy) EventAction(limelight.events.EventAction) PanelEvent(limelight.ui.events.panel.PanelEvent) Event(limelight.events.Event) MouseEnteredEvent(limelight.ui.events.panel.MouseEnteredEvent) MouseClickedEvent(limelight.ui.events.panel.MouseClickedEvent)

Example 22 with PropPanel

use of limelight.ui.model.PropPanel in project limelight by slagyr.

the class TextInputPanelTest method setUp.

@Before
public void setUp() {
    assumeTrue(TestUtil.notHeadless());
    root = new FakeScene();
    panel = new MockTextInputPanel();
    parent = new PropPanel(new FakePropProxy());
    parent.add(panel);
    root.add(parent);
    stage = new MockStage();
    root.setStage(stage);
    model = panel.getModel();
    model.setText("Some Text");
}
Also used : PropPanel(limelight.ui.model.PropPanel) FakeScene(limelight.ui.model.FakeScene) MockStage(limelight.ui.model.MockStage) FakePropProxy(limelight.model.api.FakePropProxy) Before(org.junit.Before)

Example 23 with PropPanel

use of limelight.ui.model.PropPanel in project limelight by slagyr.

the class TextPanelBorderPainterTest method setUp.

@Before
public void setUp() throws Exception {
    FakeScene root = new FakeScene();
    parent = new PropPanel(new FakePropProxy());
    root.add(parent);
    stage = new MockStage();
    root.setStage(stage);
    panel = new TextBoxPanel();
    parent.add(panel);
    graphics = new MockGraphics();
    TextPanelBorderPainter.normalBorder = normalDrawable = new MockDrawable();
    TextPanelBorderPainter.focusedBorder = focusDrawable = new MockDrawable();
    painter = TextPanelBorderPainter.instance;
    parent.getStyle().setBorderColor("transparent");
}
Also used : PropPanel(limelight.ui.model.PropPanel) MockGraphics(limelight.ui.MockGraphics) TextBoxPanel(limelight.ui.model.inputs.TextBoxPanel) MockDrawable(limelight.ui.model.MockDrawable) FakeScene(limelight.ui.model.FakeScene) MockStage(limelight.ui.model.MockStage) FakePropProxy(limelight.model.api.FakePropProxy)

Example 24 with PropPanel

use of limelight.ui.model.PropPanel in project limelight by slagyr.

the class TextBoxPanelTest method setsPainterOnParent.

@Test
public void setsPainterOnParent() throws Exception {
    PropPanel newParent = new PropPanel(new FakePropProxy());
    panel.setParent(newParent);
    assertEquals(TextInputPanel.TextInputPropPainter.instance, newParent.getPainter());
}
Also used : PropPanel(limelight.ui.model.PropPanel) FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 25 with PropPanel

use of limelight.ui.model.PropPanel in project limelight by slagyr.

the class DropDownPanelTest method pressingButtonOpensList.

@Test
public void pressingButtonOpensList() throws Exception {
    CastingDirector.installed();
    root.illuminate();
    panel.setChoicesVargs(1, 2, 3);
    new ButtonPushedEvent().dispatch(panel);
    assertEquals(2, root.getChildren().size());
    PropPanel curtains = (PropPanel) root.getChildren().get(1);
    assertEquals("limelight_builtin_curtains", curtains.getName());
    PropPanel list = (PropPanel) curtains.getChildren().get(0);
    assertEquals("limelight_builtin_drop_down_popup_list", list.getName());
    assertEquals(3, list.getChildren().size());
    final PropPanel item1 = (PropPanel) list.getChildren().get(0);
    assertEquals("limelight_builtin_drop_down_popup_list_item", item1.getName());
    assertEquals("1", item1.getText());
    final PropPanel item2 = (PropPanel) list.getChildren().get(1);
    assertEquals("limelight_builtin_drop_down_popup_list_item", item2.getName());
    assertEquals("2", item2.getText());
    final PropPanel item3 = (PropPanel) list.getChildren().get(2);
    assertEquals("limelight_builtin_drop_down_popup_list_item", item3.getName());
    assertEquals("3", item3.getText());
}
Also used : PropPanel(limelight.ui.model.PropPanel) Test(org.junit.Test)

Aggregations

PropPanel (limelight.ui.model.PropPanel)34 FakePropProxy (limelight.model.api.FakePropProxy)22 FakeScene (limelight.ui.model.FakeScene)17 Before (org.junit.Before)16 Test (org.junit.Test)9 CastEvent (limelight.ui.events.panel.CastEvent)7 MouseClickedEvent (limelight.ui.events.panel.MouseClickedEvent)4 Event (limelight.events.Event)3 EventAction (limelight.events.EventAction)3 MockGraphics (limelight.ui.MockGraphics)3 SimplePropProxy (limelight.ui.SimplePropProxy)3 MouseEnteredEvent (limelight.ui.events.panel.MouseEnteredEvent)3 PanelEvent (limelight.ui.events.panel.PanelEvent)3 MockStage (limelight.ui.model.MockStage)3 RadioButtonGroup (limelight.ui.RadioButtonGroup)2 Scene (limelight.ui.model.Scene)2 ScenePanel (limelight.ui.model.ScenePanel)2 FakeFileSystem (limelight.io.FakeFileSystem)1 FakeProduction (limelight.model.FakeProduction)1 PropProxy (limelight.model.api.PropProxy)1