Search in sources :

Example 1 with PropPanel

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

the class Debug method log.

public void log(Panel panel, String message) {
    if (panel instanceof PropPanel) {
        PropPanel prop = (PropPanel) panel;
        PropProxy propProxy = prop.getProxy();
        if (propProxy != null && "sandbox".equals(prop.getName()))
            System.err.println(message);
    }
}
Also used : PropPanel(limelight.ui.model.PropPanel) PropProxy(limelight.model.api.PropProxy)

Example 2 with PropPanel

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

use of limelight.ui.model.PropPanel 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();
}
Also used : ScenePanel(limelight.ui.model.ScenePanel) PropPanel(limelight.ui.model.PropPanel) Before(org.junit.Before)

Example 4 with PropPanel

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

the class ScrollLayout method doContraction.

@Override
public void doContraction(Panel thePanel) {
    PropPanel panel = (PropPanel) thePanel;
    final ScrollBarPanel horizontalScrollbar = panel.getHorizontalScrollbar();
    final ScrollBarPanel verticalScrollbar = panel.getVerticalScrollbar();
    //scrollBar.isHorizontal() ? scrollBar.getValue() : 0;
    int dx = horizontalScrollbar == null ? 0 : horizontalScrollbar.getValue();
    //scrollBar.isVertical() ? scrollBar.getValue() : 0;
    int dy = verticalScrollbar == null ? 0 : verticalScrollbar.getValue();
    LinkedList<PropPanelLayout.Row> rows = buildRows(panel);
    Dimension consumedDimensions = new Dimension();
    calculateConsumedDimentions(rows, consumedDimensions);
    layoutRows(panel, consumedDimensions, rows, dx, dy);
}
Also used : PropPanel(limelight.ui.model.PropPanel)

Example 5 with PropPanel

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

PropPanel (limelight.ui.model.PropPanel)34 FakePropProxy (limelight.model.api.FakePropProxy)22 FakeScene (limelight.ui.model.FakeScene)17 Before (org.junit.Before)16 Test (org.junit.Test)9 CastEvent (limelight.ui.events.panel.CastEvent)7 MouseClickedEvent (limelight.ui.events.panel.MouseClickedEvent)4 Event (limelight.events.Event)3 EventAction (limelight.events.EventAction)3 MockGraphics (limelight.ui.MockGraphics)3 SimplePropProxy (limelight.ui.SimplePropProxy)3 MouseEnteredEvent (limelight.ui.events.panel.MouseEnteredEvent)3 PanelEvent (limelight.ui.events.panel.PanelEvent)3 MockStage (limelight.ui.model.MockStage)3 RadioButtonGroup (limelight.ui.RadioButtonGroup)2 Scene (limelight.ui.model.Scene)2 ScenePanel (limelight.ui.model.ScenePanel)2 FakeFileSystem (limelight.io.FakeFileSystem)1 FakeProduction (limelight.model.FakeProduction)1 PropProxy (limelight.model.api.PropProxy)1