Search in sources :

Example 6 with MockStage

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

the class TheaterTest method knowsWhenStagesAreDeactivated.

@Test
public void knowsWhenStagesAreDeactivated() throws Exception {
    MockStage stage2 = new MockStage("two");
    theater.add(defaultStage);
    theater.add(stage2);
    new StageActivatedEvent().dispatch(defaultStage);
    new StageDeactivatedEvent().dispatch(defaultStage);
    assertEquals(null, theater.getActiveStage());
}
Also used : StageDeactivatedEvent(limelight.ui.events.stage.StageDeactivatedEvent) MockStage(limelight.ui.model.MockStage) StageActivatedEvent(limelight.ui.events.stage.StageActivatedEvent) Test(org.junit.Test)

Example 7 with MockStage

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

the class TheaterTest method attemptsToCloseProductionWhenAllStagesAreHidden.

@Test
public void attemptsToCloseProductionWhenAllStagesAreHidden() throws Exception {
    MockStage stage2 = new MockStage("two");
    defaultStage.setVital(false);
    stage2.setVital(false);
    theater.add(defaultStage);
    theater.add(stage2);
    defaultStage.setVisible(false);
    stage2.setVisible(false);
    new StageDeactivatedEvent().dispatch(defaultStage);
    new StageDeactivatedEvent().dispatch(stage2);
    assertEquals(true, production.closeAttempted);
}
Also used : StageDeactivatedEvent(limelight.ui.events.stage.StageDeactivatedEvent) MockStage(limelight.ui.model.MockStage) Test(org.junit.Test)

Example 8 with MockStage

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

the class TextAreaPanelTest method setUp.

@Before
public void setUp() {
    assumeTrue(TestUtil.notHeadless());
    panel = new TextAreaPanel();
    parent = new PropPanel(new FakePropProxy());
    parent.add(panel);
    root = new FakeScene();
    root.add(parent);
    root.setStage(new MockStage());
    graphics = new MockGraphics();
    model = panel.getModel();
    model.setText("Some Text");
}
Also used : PropPanel(limelight.ui.model.PropPanel) MockGraphics(limelight.ui.MockGraphics) FakeScene(limelight.ui.model.FakeScene) MockStage(limelight.ui.model.MockStage) FakePropProxy(limelight.model.api.FakePropProxy) Before(org.junit.Before)

Example 9 with MockStage

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

the class DropDownPanelTest method acquiresFocusWhenPressed.

@Test
public void acquiresFocusWhenPressed() throws Exception {
    final MockStage stage = new MockStage();
    root.setStage(stage);
    panel.setChoicesVargs(1, 2, 3);
    new ButtonPushedEvent().dispatch(panel);
    assertEquals(true, panel.hasFocus());
}
Also used : MockStage(limelight.ui.model.MockStage) Test(org.junit.Test)

Example 10 with MockStage

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

the class TextInputPanelTest method setUp.

@Before
public void setUp() {
    assumeTrue(TestUtil.notHeadless());
    root = new FakeScene();
    panel = new MockTextInputPanel();
    parent = new PropPanel(new FakePropProxy());
    parent.add(panel);
    root.add(parent);
    stage = new MockStage();
    root.setStage(stage);
    model = panel.getModel();
    model.setText("Some Text");
}
Also used : PropPanel(limelight.ui.model.PropPanel) FakeScene(limelight.ui.model.FakeScene) MockStage(limelight.ui.model.MockStage) FakePropProxy(limelight.model.api.FakePropProxy) Before(org.junit.Before)

Aggregations

MockStage (limelight.ui.model.MockStage)21 Test (org.junit.Test)16 FakeScene (limelight.ui.model.FakeScene)11 Scene (limelight.ui.model.Scene)5 FakePropProxy (limelight.model.api.FakePropProxy)3 StageActivatedEvent (limelight.ui.events.stage.StageActivatedEvent)3 StageDeactivatedEvent (limelight.ui.events.stage.StageDeactivatedEvent)3 PropPanel (limelight.ui.model.PropPanel)3 Before (org.junit.Before)3 MockGraphics (limelight.ui.MockGraphics)2 LimelightException (limelight.LimelightException)1 RichStyle (limelight.styles.RichStyle)1 StageClosedEvent (limelight.ui.events.stage.StageClosedEvent)1 MockDrawable (limelight.ui.model.MockDrawable)1 TextBoxPanel (limelight.ui.model.inputs.TextBoxPanel)1 Opts (limelight.util.Opts)1