Package limelight.ui

Examples of limelight.ui.MockPanel


  }

  @Test
  public void shouldRemoveDoesntRequireLayoutIfNoChildWasRemoved() throws Exception
  {
    Panel child = new MockPanel();
    panel.add(child);
    resetFamilyLayouts();

    panel.remove(new MockPanel());

    assertEquals(false, panel.needsLayout());
  }
View Full Code Here


  }

  @Test
  public void shouldRemoveAllRequiresUpdate() throws Exception
  {
    Panel child = new MockPanel();
    panel.add(child);
    resetFamilyLayouts();

    panel.removeAll();
View Full Code Here

  }

  @Test
  public void shouldAddingChildrenAtIndex() throws Exception
  {
    Panel childA = new MockPanel();
    Panel childB = new MockPanel();
    Panel childC = new MockPanel();

    panel.add(0, childA);
    panel.add(0, childB);
    panel.add(1, childC);

    assertSame(childA, panel.getChildren().get(2));
    assertSame(childB, panel.getChildren().get(0));
    assertSame(childC, panel.getChildren().get(1));
    assertSame(panel, childA.getParent());
    assertSame(panel, childB.getParent());
    assertSame(panel, childC.getParent());
  }
View Full Code Here

  }

  @Test
  public void shouldAddingPanelsAtIndexRequiresLayout() throws Exception
  {
    Panel childA = new MockPanel();
    Panel childB = new MockPanel();

    panel.add(childA);
    panel.add(0, childB);

    assertEquals(true, panel.needsLayout());
View Full Code Here

  }

  @Test
  public void shouldGetChildrenReturnsACopiedList() throws Exception
  {
    Panel child = new MockPanel();
    panel.add(child);

    java.util.List<Panel> children = panel.getChildren();
    panel.remove(child);
View Full Code Here

  }

  @Test
  public void shouldGetChildrenProvidesReadonlyList() throws Exception
  {
    Panel child = new MockPanel();
    panel.add(child);

    java.util.List<Panel> children = panel.getChildren();

    try
    {
      children.add(new MockPanel());
      fail("Should have thrown exception");
    }
    catch(UnsupportedOperationException e)
    {
    }
View Full Code Here

  @Test
  public void shouldAncestorsWithAutoDimensionsRequireLayoutWhenChildrenRemoved() throws Exception
  {
    createFamilyTree();

    MockPanel newPanel = new MockPanel();
    grandChild.add(newPanel);
    resetFamilyLayouts();
    grandChild.remove(newPanel);

    assertEquals(true, grandChild.needsLayout());
View Full Code Here

  @Test
  public void shouldAncestorsWithAutoDimensionsRequireLayoutWhenAllChildrenRemoved() throws Exception
  {
    createFamilyTree();

    MockPanel newPanel = new MockPanel();
    grandChild.add(newPanel);
    resetFamilyLayouts();
    grandChild.removeAll();

    assertEquals(true, grandChild.needsLayout());
View Full Code Here

  }

  @Test
  public void doesLayouts() throws Exception
  {
    MockPanel panel1 = new MockPanel();
    MockPanel panel2 = new MockPanel();
    activeRoot.add(panel1);
    activeRoot.add(panel2);
    final FakeLayout layout1 = new FakeLayout(true);
    final FakeLayout layout2 = new FakeLayout(true);
    panel1.markAsNeedingLayout(layout1);
    panel2.markAsNeedingLayout(layout2);

    loop.doAllLayouts(activeRoot);

    assertEquals(panel1, layout1.lastPanelExpanded);
    assertEquals(panel2, layout2.lastPanelExpanded);
View Full Code Here

  private MockAnimation animation10;

  public void setUp() throws Exception
  {
    loop = new AnimationLoop();
    animation20 = new MockAnimation(20, new MockPanel());
    animation30 = new MockAnimation(30, new MockPanel());
    animation10 = new MockAnimation(10, new MockPanel());
  }
View Full Code Here

TOP

Related Classes of limelight.ui.MockPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.