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());
}
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());
}
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();
}
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());
}