Search in sources :

Example 16 with FakePropProxy

use of limelight.model.api.FakePropProxy in project limelight by slagyr.

the class RadioButtonPanelTest method changingGroupName.

@Test
public void changingGroupName() throws Exception {
    Scene scene = new FakeScene();
    PropPanel parent1 = new PropPanel(new FakePropProxy("parent1"));
    RadioButtonPanel radio1 = new RadioButtonPanel();
    parent1.add(radio1);
    scene.add(parent1);
    final RadioButtonGroup group1 = scene.getButtonGroups().get("group1");
    final RadioButtonGroup group2 = scene.getButtonGroups().get("group2");
    radio1.setGroup("group1");
    radio1.setGroup("group2");
    assertEquals(0, group1.getButtons().size());
    assertEquals(1, group2.getButtons().size());
}
Also used : PropPanel(limelight.ui.model.PropPanel) RadioButtonGroup(limelight.ui.RadioButtonGroup) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 17 with FakePropProxy

use of limelight.model.api.FakePropProxy 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 18 with FakePropProxy

use of limelight.model.api.FakePropProxy 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 19 with FakePropProxy

use of limelight.model.api.FakePropProxy in project limelight by slagyr.

the class ScrollBarPanelTest method parentIsMarkedAsChanged.

@Test
public void parentIsMarkedAsChanged() throws Exception {
    Scene root = new FakeScene();
    root.setStage(new MockStage());
    PropPanel parent = new PropPanel(new FakePropProxy());
    root.add(parent);
    parent.add(verticalScrollBar);
    Layouts.on(parent, parent.getDefaultLayout());
    verticalScrollBar.setValue(50);
    assertEquals(true, parent.needsLayout());
}
Also used : FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 20 with FakePropProxy

use of limelight.model.api.FakePropProxy in project limelight by slagyr.

the class ScrollLayoutTest method addChildWithSize.

private PropPanel addChildWithSize(ParentPanelBase parent, String width, String height) {
    PropPanel panel = new PropPanel(new FakePropProxy());
    panel.getStyle().setWidth(width);
    panel.getStyle().setHeight(height);
    parent.add(panel);
    return panel;
}
Also used : FakePropProxy(limelight.model.api.FakePropProxy)

Aggregations

FakePropProxy (limelight.model.api.FakePropProxy)37 PropPanel (limelight.ui.model.PropPanel)22 FakeScene (limelight.ui.model.FakeScene)17 Test (org.junit.Test)17 Before (org.junit.Before)15 CastEvent (limelight.ui.events.panel.CastEvent)7 MockGraphics (limelight.ui.MockGraphics)3 MockStage (limelight.ui.model.MockStage)3 LimelightException (limelight.LimelightException)2 FakeProduction (limelight.model.FakeProduction)2 RadioButtonGroup (limelight.ui.RadioButtonGroup)2 Scene (limelight.ui.model.Scene)2 FakeFileSystem (limelight.io.FakeFileSystem)1 FakePlayerRecruiter (limelight.model.api.FakePlayerRecruiter)1 MouseClickedEvent (limelight.ui.events.panel.MouseClickedEvent)1 MockDrawable (limelight.ui.model.MockDrawable)1 TextBoxPanel (limelight.ui.model.inputs.TextBoxPanel)1