Example #1
0
  public void testAlignmentChangeShouldInvokeLayout() throws Exception {
    panel.resetLayout();

    panel.styleChanged(Style.HORIZONTAL_ALIGNMENT, null);
    assertEquals(true, panel.needsLayout());

    panel.resetLayout();
    panel.styleChanged(Style.VERTICAL_ALIGNMENT, null);

    assertEquals(true, panel.needsLayout());
  }
Example #2
0
  public void testChangingSizeToZeroWillReLayoutGrandDaddy() throws Exception {
    PropPanel child = new PropPanel(new MockProp());
    PropPanel grandChild = new PropPanel(new MockProp());
    panel.add(child);
    child.add(grandChild);
    child.resetLayout();
    panel.resetLayout();

    grandChild.styleChanged(Style.HEIGHT, new StaticDimensionAttribute(0));

    assertEquals(true, panel.needsLayout());
  }
Example #3
0
  public void testChangingTextColor() throws Exception {
    panel.setText("foo");
    panel.resetLayout();

    panel.styleChanged(Style.TEXT_COLOR, Style.TEXT_COLOR.compile("red"));

    assertEquals(true, panel.needsLayout());
  }
Example #4
0
  public void testChangingFontStyle() throws Exception {
    panel.setText("foo");
    panel.resetLayout();
    panel.resetPendingSizeChange();

    panel.styleChanged(Style.FONT_STYLE, Style.FONT_STYLE.compile("italic"));

    assertEquals(true, panel.needsLayout());
    assertEquals(true, panel.sizeChangePending());
  }