Search in sources :

Example 26 with FakePropProxy

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

the class LayoutTest 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)

Example 27 with FakePropProxy

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

the class LayoutTest method autoSizingWithNoChildrenAndScrollBars.

@Test
public void autoSizingWithNoChildrenAndScrollBars() throws Exception {
    PropPanel panel = new PropPanel(new FakePropProxy());
    parent.add(panel);
    panel.getStyle().setWidth("auto");
    panel.getStyle().setHeight("auto");
    panel.getStyle().setScrollbars("on");
    Layouts.on(root);
    assertEquals(0, panel.getWidth());
    assertEquals(0, panel.getHeight());
}
Also used : FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 28 with FakePropProxy

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

the class ScenePanelTest method propWithIdIsIndexWhenAddedToScene.

@Test
public void propWithIdIsIndexWhenAddedToScene() throws Exception {
    setupIlluminatedScene();
    PropPanel panel = new PropPanel(new FakePropProxy(), Util.toMap("id", "some id"));
    root.add(panel);
    assertSame(panel, root.find("some id"));
}
Also used : FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 29 with FakePropProxy

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

the class ScenePanelTest method propTreesAreIndexedWhenAddedAndUnindexedWhenRemoved.

@Test
public void propTreesAreIndexedWhenAddedAndUnindexedWhenRemoved() throws Exception {
    setupIlluminatedScene();
    PropPanel parent = new PropPanel(new FakePropProxy(), Util.toMap("id", "parent"));
    PropPanel child = new PropPanel(new FakePropProxy(), Util.toMap("id", "child"));
    parent.add(child);
    root.add(parent);
    assertSame(parent, root.find("parent"));
    assertSame(child, root.find("child"));
    root.remove(parent);
    assertEquals(null, root.find("parent"));
    assertEquals(null, root.find("child"));
}
Also used : FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 30 with FakePropProxy

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

the class ScenePanelTest method sceneGetLoaderFromOptions.

@Test
public void sceneGetLoaderFromOptions() throws Exception {
    root.setProduction(new FakeProduction("test_prod"));
    assertEquals("test_prod", root.getPath());
    root = new ScenePanel(new FakePropProxy(), new FakePlayerRecruiter());
    root.setProduction(new FakeProduction("/test_prod"));
    root.addOptions(Util.toMap("path", "some/path"));
    assertEquals("/test_prod/some/path", root.getPath());
}
Also used : FakePlayerRecruiter(limelight.model.api.FakePlayerRecruiter) FakeProduction(limelight.model.FakeProduction) FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

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