@Test public void checkSpanRowsOnCustomComponent() throws Exception { launchGui(RowSpan7SpecialComponent.class); checkSnapshot("pref-size"); frame().moveTo(new Point(frame().target.getX(), 0)); Dimension size = new Dimension( frame().target.getWidth(), frame().target.getHeight()); for (int i = 1; i <= 5; i++) { size.width += 6; size.height += 9; frame().resizeTo(size); checkSnapshot("resize-" + i); } }
final protected void checkExampleAndResizeHeight( Class<? extends IExample> clazz, int increment, int steps) throws Exception { launchGui(clazz); checkSnapshot("pref-size"); frame().moveTo(new Point(frame().target.getX(), 0)); for (int i = 1; i <= steps; i++) { frame().resizeHeightTo(frame().target.getHeight() + increment); checkSnapshot("resize-" + (i * increment)); } }
final protected void checkExampleAndResizeWidth( Class<? extends IExample> clazz, double... ratios) throws Exception { launchGui(clazz); checkSnapshot("pref-size"); frame().moveTo(new Point(0, frame().target.getY())); for (int i = 0; i < ratios.length; i++) { frame().resizeWidthTo((int) (frame().target.getWidth() * ratios[i])); checkSnapshot("resize-" + (i + 1)); } }
@Test public void checkBug36SmartVerticalResize() throws Exception { launchGui(SmartVerticalResize4RealWorldExample.class); checkSnapshot("bug36-pref-size"); frame().moveTo(new Point(frame().target.getX(), 0)); for (int i = 1; i <= BUG36_STEPS; i++) { frame().resizeHeightTo(frame().target.getHeight() + BUG36_INCREMENT); checkSnapshot("bug36-resize-" + (i * BUG36_INCREMENT)); } for (int i = 1; i <= BUG36_STEPS; i++) { frame().resizeHeightTo(frame().target.getHeight() - BUG36_INCREMENT); checkSnapshot("bug36-reverse-" + (i * BUG36_INCREMENT)); } }