private void checkLayoutOnStyle(StyleDescriptor styleDescriptor) { Box box = panel.getBoxInsidePadding(); panel.styleChanged(styleDescriptor, new StaticPixelsAttribute(20)); assertEquals(true, panel.needsLayout()); panel.doLayout(); assertNotSame(box, panel.getBoxInsidePadding()); assertEquals(false, panel.needsLayout()); }
public void testRactanglesAreCached() throws Exception { Box rectangle = panel.getBoundingBox(); Box insideMargins = panel.getBoxInsideMargins(); Box insideBorders = panel.getBoxInsideBorders(); Box insidePadding = panel.getBoxInsidePadding(); assertSame(rectangle, panel.getBoundingBox()); assertSame(insideMargins, panel.getBoxInsideMargins()); assertSame(insideBorders, panel.getBoxInsideBorders()); assertSame(insidePadding, panel.getBoxInsidePadding()); panel.setSize(123, 456); assertNotSame(rectangle, panel.getBoundingBox()); assertNotSame(insideMargins, panel.getBoxInsideMargins()); assertNotSame(insideBorders, panel.getBoxInsideBorders()); assertNotSame(insidePadding, panel.getBoxInsidePadding()); }