Search in sources :

Example 11 with MockStage

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

the class TextPanelMouseProcessorTest method setUpWithText.

private void setUpWithText(String text, boolean multiline) {
    if (multiline)
        panel = new TextAreaPanel();
    else
        panel = new TextBoxPanel();
    panel.setSize(150, 75);
    root = new FakeScene();
    root.add(panel);
    stage = new MockStage();
    root.setStage(stage);
    model = panel.getModel();
    model.setTypedLayoutFactory(MockTypedLayoutFactory.instance);
    model.setText(text);
    model.setCaretLocation(TextLocation.origin);
}
Also used : FakeScene(limelight.ui.model.FakeScene) MockStage(limelight.ui.model.MockStage)

Example 12 with MockStage

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

the class TextPanelBorderPainterTest method setUp.

@Before
public void setUp() throws Exception {
    FakeScene root = new FakeScene();
    parent = new PropPanel(new FakePropProxy());
    root.add(parent);
    stage = new MockStage();
    root.setStage(stage);
    panel = new TextBoxPanel();
    parent.add(panel);
    graphics = new MockGraphics();
    TextPanelBorderPainter.normalBorder = normalDrawable = new MockDrawable();
    TextPanelBorderPainter.focusedBorder = focusDrawable = new MockDrawable();
    painter = TextPanelBorderPainter.instance;
    parent.getStyle().setBorderColor("transparent");
}
Also used : PropPanel(limelight.ui.model.PropPanel) MockGraphics(limelight.ui.MockGraphics) TextBoxPanel(limelight.ui.model.inputs.TextBoxPanel) MockDrawable(limelight.ui.model.MockDrawable) FakeScene(limelight.ui.model.FakeScene) MockStage(limelight.ui.model.MockStage) FakePropProxy(limelight.model.api.FakePropProxy)

Example 13 with MockStage

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

the class TheaterTest method canClose.

@Test
public void canClose() throws Exception {
    MockStage stage2 = new MockStage("two");
    MockStage stage3 = new MockStage("three");
    theater.add(defaultStage);
    theater.add(stage2);
    theater.add(stage3);
    theater.close();
    assertEquals(0, theater.getStages().size());
    assertEquals(null, theater.getActiveStage());
    assertEquals(false, theater.isOpen());
}
Also used : MockStage(limelight.ui.model.MockStage) Test(org.junit.Test)

Example 14 with MockStage

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

the class TheaterTest method doesntTryToCloseTheProductionWhenEmptiedButHasVitalStages.

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

Example 15 with MockStage

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

the class TheaterTest method doesNotAllowDuplicateNames.

@Test
public void doesNotAllowDuplicateNames() throws Exception {
    MockStage stage2 = new MockStage("default");
    theater.add(defaultStage);
    try {
        theater.add(stage2);
        fail("should throw error");
    } catch (LimelightException e) {
        assertEquals("Duplicate stage name: 'default'", e.getMessage());
    }
}
Also used : MockStage(limelight.ui.model.MockStage) LimelightException(limelight.LimelightException) Test(org.junit.Test)

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