Search in sources :

Example 6 with Scene

use of limelight.ui.model.Scene 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 7 with Scene

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

the class RadioButtonPanelTest method settingTheGroupName.

@Test
public void settingTheGroupName() throws Exception {
    Scene scene = new FakeScene();
    PropPanel parent1 = new PropPanel(new FakePropProxy("parent1"));
    RadioButtonPanel radio1 = new RadioButtonPanel();
    parent1.add(radio1);
    PropPanel parent2 = new PropPanel(new FakePropProxy("parent2"));
    RadioButtonPanel radio2 = new RadioButtonPanel();
    parent2.add(radio2);
    scene.add(parent1);
    scene.add(parent2);
    final RadioButtonGroup group = scene.getButtonGroups().get("test_group");
    assertEquals(0, group.getButtons().size());
    radio1.setGroup("test_group");
    assertEquals(1, group.getButtons().size());
    radio2.setGroup("test_group");
    assertEquals(2, group.getButtons().size());
    assertEquals(true, group.getButtons().contains(radio1));
    assertEquals(true, group.getButtons().contains(radio2));
}
Also used : PropPanel(limelight.ui.model.PropPanel) RadioButtonGroup(limelight.ui.RadioButtonGroup) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 8 with Scene

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

the class RadioButtonPanelTest method changingGroupName.

@Test
public void changingGroupName() throws Exception {
    Scene scene = new FakeScene();
    PropPanel parent1 = new PropPanel(new FakePropProxy("parent1"));
    RadioButtonPanel radio1 = new RadioButtonPanel();
    parent1.add(radio1);
    scene.add(parent1);
    final RadioButtonGroup group1 = scene.getButtonGroups().get("group1");
    final RadioButtonGroup group2 = scene.getButtonGroups().get("group2");
    radio1.setGroup("group1");
    radio1.setGroup("group2");
    assertEquals(0, group1.getButtons().size());
    assertEquals(1, group2.getButtons().size());
}
Also used : PropPanel(limelight.ui.model.PropPanel) RadioButtonGroup(limelight.ui.RadioButtonGroup) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) FakePropProxy(limelight.model.api.FakePropProxy) Test(org.junit.Test)

Example 9 with Scene

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

the class Production method openSceneOnStage.

private Scene openSceneOnStage(String scenePath, Stage stage, Map<String, Object> options) {
    Log.info("Production - opening scene: '" + scenePath + "' on stage: '" + stage.getName() + "'");
    Map<String, Object> sceneOptions = new HashMap<String, Object>(options);
    sceneOptions.put("path", scenePath);
    sceneOptions.put("name", Context.fs().filename(scenePath));
    Scene scene = loadScene(scenePath, sceneOptions);
    Log.debug("Production - scene loaded: '" + scene + "' with options: " + Util.mapToString(sceneOptions));
    styleAndStageScene(scene, stage);
    return scene;
}
Also used : HashMap(java.util.HashMap) Scene(limelight.ui.model.Scene)

Example 10 with Scene

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

the class RadioButtonPanel method establishButtonGroup.

private void establishButtonGroup(String name) {
    if (radioButtonGroup != null)
        radioButtonGroup.remove(this);
    final Scene scene = getRoot();
    if (scene != null) {
        final RadioButtonGroup group = scene.getButtonGroups().get(name);
        group.add(this);
    }
}
Also used : RadioButtonGroup(limelight.ui.RadioButtonGroup) Scene(limelight.ui.model.Scene)

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