Search in sources :

Example 1 with ScenePanel

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

the class JavaProductionTest method loadsSceneWithProps.

@Test
public void loadsSceneWithProps() throws Exception {
    fs.createTextFile("/testProduction/aScene/props.xml", "<props><child><grandchild/></child><child2/></props>");
    final Opts options = Opts.with("backgroundColor", "red", "shouldAllowClose", false);
    ScenePanel scene = (ScenePanel) production.loadScene("aScene", options.merge("name", "aScene", "path", "aScene"));
    scene.illuminate();
    assertEquals(2, scene.getChildren().size());
    final PropPanel child1 = (PropPanel) scene.getChildren().get(0);
    assertEquals("child", child1.getName());
    final PropPanel child2 = (PropPanel) scene.getChildren().get(1);
    assertEquals("child2", child2.getName());
    assertEquals(1, child1.getChildren().size());
    final PropPanel grandChild = (PropPanel) child1.getChildren().get(0);
    assertEquals("grandchild", grandChild.getName());
    assertEquals(0, child2.getChildren().size());
}
Also used : ScenePanel(limelight.ui.model.ScenePanel) PropPanel(limelight.ui.model.PropPanel) Opts(limelight.util.Opts) Test(org.junit.Test)

Example 2 with ScenePanel

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

the class JavaProductionTest method loadsScene.

@Test
public void loadsScene() throws Exception {
    final Scene result = production.loadScene("aScene", Opts.with("name", "aScene"));
    assertEquals(ScenePanel.class, result.getClass());
    ScenePanel scene = (ScenePanel) result;
    assertEquals(JavaScene.class, scene.getProxy().getClass());
    scene.illuminate();
    assertEquals("aScene", scene.getName());
}
Also used : ScenePanel(limelight.ui.model.ScenePanel) Scene(limelight.ui.model.Scene) Test(org.junit.Test)

Example 3 with ScenePanel

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

the class CastingDirectorTest method setUp.

@Before
public void setUp() throws Exception {
    FakeProduction production = new FakeProduction("/path/to/testProduction");
    ScenePanel scene = new ScenePanel(new FakePropProxy(), new FakePlayerRecruiter(), Util.toMap("name", "theScene", "path", "theScene"));
    scene.setProduction(production);
    panel = new PropPanel(new FakePropProxy());
    scene.add(panel);
    playerRecruiter = new FakePlayerRecruiter();
    castingDirector = new CastingDirector();
    builtinPlayerRecruiter = new FakePlayerRecruiter();
    castingDirector.setBuiltinPlayerRecruiter(builtinPlayerRecruiter);
    FakeFileSystem.installed();
}
Also used : ScenePanel(limelight.ui.model.ScenePanel) PropPanel(limelight.ui.model.PropPanel) Before(org.junit.Before)

Example 4 with ScenePanel

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

the class JavaProductionTest method loadsSceneWithOptions.

@Test
public void loadsSceneWithOptions() throws Exception {
    final Map<String, Object> options = Util.toMap("backgroundColor", "red", "shouldAllowClose", false);
    ScenePanel result = (ScenePanel) production.loadScene("aScene", options);
    result.illuminate();
    assertEquals(false, result.shouldAllowClose());
    assertEquals("#ff0000ff", result.getStyle().getBackgroundColor());
}
Also used : ScenePanel(limelight.ui.model.ScenePanel) Test(org.junit.Test)

Aggregations

ScenePanel (limelight.ui.model.ScenePanel)4 Test (org.junit.Test)3 PropPanel (limelight.ui.model.PropPanel)2 Scene (limelight.ui.model.Scene)1 Opts (limelight.util.Opts)1 Before (org.junit.Before)1