Search in sources :

Example 11 with FakeScene

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

the class TextBoxPanelTest method changingPasswordModeMakesThePanelDirty.

@Test
public void changingPasswordModeMakesThePanelDirty() throws Exception {
    FakeScene root = new FakeScene();
    root.add(parent);
    panel.getModel().resetChangeFlag();
    assertEquals(false, root.dirtyRegions.contains(panel.getAbsoluteBounds()));
    assertEquals(false, panel.getModel().hasChanged());
    panel.setInPasswordMode(false);
    assertEquals(false, root.dirtyRegions.contains(panel.getAbsoluteBounds()));
    assertEquals(false, panel.getModel().hasChanged());
    panel.setInPasswordMode(true);
    assertEquals(true, root.dirtyRegions.contains(panel.getAbsoluteBounds()));
    assertEquals(true, panel.getModel().hasChanged());
}
Also used : FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Example 12 with FakeScene

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

the class CheckBoxPanelTest method setUp.

@Before
public void setUp() throws Exception {
    panel = new CheckBoxPanel();
    parent = new PropPanel(new FakePropProxy());
    parent.add(panel);
    root = new FakeScene();
    root.add(parent);
}
Also used : PropPanel(limelight.ui.model.PropPanel) FakeScene(limelight.ui.model.FakeScene) FakePropProxy(limelight.model.api.FakePropProxy) Before(org.junit.Before)

Example 13 with FakeScene

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

the class DropDownPanelTest method setUp.

@Before
public void setUp() throws Exception {
    panel = new DropDownPanel();
    parent = new PropPanel(new FakePropProxy());
    parent.add(panel);
    root = new FakeScene();
    root.add(parent);
    root.styleStore = BuiltInStyles.all();
    root.setProduction(new FakeProduction());
}
Also used : PropPanel(limelight.ui.model.PropPanel) FakeProduction(limelight.model.FakeProduction) FakeScene(limelight.ui.model.FakeScene) FakePropProxy(limelight.model.api.FakePropProxy) Before(org.junit.Before)

Example 14 with FakeScene

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

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

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