Search in sources :

Example 1 with Opts

use of limelight.util.Opts 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 Opts

use of limelight.util.Opts in project limelight by slagyr.

the class Boot method boot.

public static void boot(Map<String, Object> customizations) {
    Log.info("Boot - Limelight " + About.version.toString());
    Opts options = defaultOptions.merge(customizations);
    if (booted)
        return;
    booted = true;
    try {
        Context context = Context.instance();
        configureOS(context);
        configureLogger(options);
        configureContext(options, context);
        configureSystemProperties(context);
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        Log.config("Boot - Limelight booted ----------");
    } catch (Exception e) {
        throw new LimelightException(e);
    }
}
Also used : Opts(limelight.util.Opts)

Example 3 with Opts

use of limelight.util.Opts in project limelight by slagyr.

the class Devtool method refresh.

public void refresh(Event e) {
    PanelEvent event = (PanelEvent) e;
    final Production production = event.getRecipient().getRoot().getProduction();
    final List<Stage> stages = production.getTheater().getStages();
    for (Stage stage : stages) {
        production.openScene(stage.getScene().getResourceLoader().getRoot(), stage, new Opts());
    }
//      (let [scene (.getRoot (.getRecipient e))
//        stage (.getStage scene)
//        production (.getProduction scene)
//        stages (.getStages (.getTheater production))]
//    (println stages)
//    (doall (map
//      (fn [stage]
//        (println "stage: " stage)
//        (.openScene production (.getName (.getScene stage)) stage (limelight.util.Opts. {})))
//      stages))
}
Also used : PanelEvent(limelight.ui.events.panel.PanelEvent) Opts(limelight.util.Opts) Production(limelight.model.Production) Stage(limelight.model.Stage)

Example 4 with Opts

use of limelight.util.Opts in project limelight by slagyr.

the class Utilities method openRigger.

public void openRigger() {
    establishStage("rigger", riggerStageOptions);
    production.openScene("rigger", "rigger", new Opts());
}
Also used : Opts(limelight.util.Opts)

Example 5 with Opts

use of limelight.util.Opts in project limelight by slagyr.

the class ScenePanelTest method backstage.

@Test
public void backstage() throws Exception {
    assertEquals(0, root.backstage_PRIVATE().size());
    root.add(child);
    Opts backstage = root.getBackstage(child);
    assertEquals(1, root.backstage_PRIVATE().size());
    assertEquals(0, backstage.size());
    assertSame(backstage, root.getBackstage(child));
}
Also used : Opts(limelight.util.Opts) Test(org.junit.Test)

Aggregations

Opts (limelight.util.Opts)14 Test (org.junit.Test)4 RichStyle (limelight.styles.RichStyle)2 Scene (limelight.ui.model.Scene)2 Production (limelight.model.Production)1 Stage (limelight.model.Stage)1 PanelEvent (limelight.ui.events.panel.PanelEvent)1 FakeScene (limelight.ui.model.FakeScene)1 MockStage (limelight.ui.model.MockStage)1 PropPanel (limelight.ui.model.PropPanel)1 ScenePanel (limelight.ui.model.ScenePanel)1