Search in sources :

Example 1 with FakeScene

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

the class ProductionTest method defaultScenesCanBeDisabled.

@Test
public void defaultScenesCanBeDisabled() throws Exception {
    MockStage stage = new MockStage();
    production.getTheater().add(stage);
    stage.setDefaultSceneName("defaultScene");
    production.stubbedScene = new FakeScene();
    production.open(Util.toMap("open-default-scenes", false));
    assertEquals(false, stage.isOpen());
    assertEquals(null, stage.getScene());
}
Also used : MockStage(limelight.ui.model.MockStage) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Example 2 with FakeScene

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

the class ProductionTest method openSceneLoadsStylesExtendingProductionStyles.

@Test
public void openSceneLoadsStylesExtendingProductionStyles() throws Exception {
    production.loadProduction();
    production.getTheater().add(new MockStage("mock"));
    production.getStyles().put("newStyle", new RichStyle());
    Scene scene = new FakeScene();
    production.stubbedScene = scene;
    production.openScene("scenePath", "mock", Util.toMap());
    assertEquals(HashMap.class, scene.getStyles().getClass());
    assertEquals(true, scene.getStyles().containsKey("limelight_builtin_curtains"));
    assertEquals(true, scene.getStyles().containsKey("newStyle"));
}
Also used : RichStyle(limelight.styles.RichStyle) 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 3 with FakeScene

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

the class ProductionTest method openSceneWithNoActiveStage.

@Test
public void openSceneWithNoActiveStage() throws Exception {
    production.loadProduction();
    final MockStage stage = (MockStage) production.getTheater().getDefaultStage();
    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) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Example 4 with FakeScene

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

the class ProductionTest method openSceneWithStage.

@Test
public void openSceneWithStage() throws Exception {
    production.loadProduction();
    MockStage stage = new MockStage("mock");
    production.getTheater().add(stage);
    Scene scene = new FakeScene();
    production.stubbedScene = scene;
    production.openScene("scenePath", "mock", Util.toMap());
    assertEquals("scenePath", production.loadedScenePath);
    assertEquals(scene, stage.getScene());
    assertEquals(true, stage.opened);
}
Also used : 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 5 with FakeScene

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

the class ButtonTest method setUp.

@Before
public void setUp() throws Exception {
    button = new Button();
    propPanel = new PropPanel(new FakePropProxy());
    new FakeScene().add(propPanel);
    button.install(new CastEvent(propPanel));
}
Also used : PropPanel(limelight.ui.model.PropPanel) CastEvent(limelight.ui.events.panel.CastEvent) FakeScene(limelight.ui.model.FakeScene) FakePropProxy(limelight.model.api.FakePropProxy) Before(org.junit.Before)

Aggregations

FakeScene (limelight.ui.model.FakeScene)29 FakePropProxy (limelight.model.api.FakePropProxy)17 PropPanel (limelight.ui.model.PropPanel)17 Before (org.junit.Before)15 MockStage (limelight.ui.model.MockStage)11 Test (org.junit.Test)11 CastEvent (limelight.ui.events.panel.CastEvent)7 Scene (limelight.ui.model.Scene)7 MockGraphics (limelight.ui.MockGraphics)2 RadioButtonGroup (limelight.ui.RadioButtonGroup)2 FakeFileSystem (limelight.io.FakeFileSystem)1 FakeProduction (limelight.model.FakeProduction)1 RichStyle (limelight.styles.RichStyle)1 StageActivatedEvent (limelight.ui.events.stage.StageActivatedEvent)1 MockDrawable (limelight.ui.model.MockDrawable)1 TextBoxPanel (limelight.ui.model.inputs.TextBoxPanel)1 Opts (limelight.util.Opts)1