Search in sources :

Example 11 with Scene

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

the class CastingDirector method castRole.

public Player castRole(PropPanel panel, String playerName, PlayerRecruiter playerRecruiter) {
    Player result;
    final Scene scene = panel.getRoot();
    final String scenePlayersPath = Context.fs().pathTo(scene.getPath(), "players");
    result = castFrom(panel, playerName, playerRecruiter, scenePlayersPath);
    if (result == null && scene.getProduction() != null) {
        final String productionPlayersPath = Context.fs().pathTo(scene.getProduction().getPath(), "players");
        result = castFrom(panel, playerName, playerRecruiter, productionPlayersPath);
    }
    if (result == null)
        result = castFrom(panel, playerName, builtinPlayerRecruiter, BuiltinBeacon.getBuiltinPlayersPath());
    return result;
}
Also used : Player(limelight.model.api.Player) Scene(limelight.ui.model.Scene)

Example 12 with Scene

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

the class JavaProductionTest method loadEmptyStylesForScene.

@Test
public void loadEmptyStylesForScene() throws Exception {
    final Scene scene = production.loadScene("aScene", new Opts());
    final Map<String, RichStyle> styles = production.loadStyles(scene, new HashMap<String, RichStyle>());
    assertEquals(0, styles.size());
}
Also used : Opts(limelight.util.Opts) RichStyle(limelight.styles.RichStyle) Scene(limelight.ui.model.Scene) Test(org.junit.Test)

Example 13 with Scene

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

the class ProductionTest method openDefaultScenes.

@Test
public void openDefaultScenes() throws Exception {
    production.getEventHandler().add(ProductionOpenedEvent.class, action);
    MockStage stage = new MockStage();
    production.getTheater().add(stage);
    stage.setDefaultSceneName("defaultScene");
    Scene scene = new FakeScene();
    production.stubbedScene = scene;
    production.open(new Opts());
    assertEquals(true, action.invoked);
    assertEquals(true, stage.isOpen());
    assertEquals(scene, stage.getScene());
}
Also used : Opts(limelight.util.Opts) MockStage(limelight.ui.model.MockStage) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Example 14 with Scene

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

the class ProductionTest method openSceneWithActiveStage.

@Test
public void openSceneWithActiveStage() throws Exception {
    production.loadProduction();
    MockStage stage = new MockStage("active");
    production.getTheater().add(stage);
    new StageActivatedEvent().dispatch(stage);
    Scene scene = new FakeScene();
    production.stubbedScene = scene;
    production.openScene("scenePath", Util.toMap());
    assertEquals("scenePath", production.loadedScenePath);
    assertEquals(scene, stage.getScene());
    assertEquals(true, stage.opened);
}
Also used : MockStage(limelight.ui.model.MockStage) StageActivatedEvent(limelight.ui.events.stage.StageActivatedEvent) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Aggregations

Scene (limelight.ui.model.Scene)14 Test (org.junit.Test)10 FakeScene (limelight.ui.model.FakeScene)7 MockStage (limelight.ui.model.MockStage)5 RichStyle (limelight.styles.RichStyle)3 RadioButtonGroup (limelight.ui.RadioButtonGroup)3 FakePropProxy (limelight.model.api.FakePropProxy)2 PropPanel (limelight.ui.model.PropPanel)2 Opts (limelight.util.Opts)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 Player (limelight.model.api.Player)1 Style (limelight.styles.Style)1 StringValue (limelight.styles.abstrstyling.StringValue)1 StageActivatedEvent (limelight.ui.events.stage.StageActivatedEvent)1 ImageCache (limelight.ui.model.ImageCache)1 ScenePanel (limelight.ui.model.ScenePanel)1 Box (limelight.util.Box)1