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);
}
}
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());
}
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();
}
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);
}
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));
}
Aggregations