harness.check(pane.getScrollPosition(), new Point());
}
public void test5(TestHarness harness)
{
ScrollPane pane = new ScrollPane();
Button button = new Button();
button.setSize(100, 100);
pane.add(button);
harness.check(pane.getComponent(0).getWidth(), 100);
harness.check(pane.getComponent(0).getHeight(), 100);
harness.check(pane.getViewportSize().getWidth(), 100);
harness.check(pane.getViewportSize().getHeight(), 100);
// Check that if x > (child's width - viewport width),
// then x is set to (child's width - viewport width) and
// that if y > (child's height - viewport height),
// then y is set to (child's height o veiwport height).
int x = 100;
int y = 100;
int tempx = (int) (pane.getComponent(0).getWidth() -
pane.getViewportSize().getWidth());
int tempy = (int) (pane.getComponent(0).getHeight() -
pane.getViewportSize().getHeight());
harness.check(tempx < x);
harness.check(tempy < y);
pane.setScrollPosition(x, y);
harness.check(pane.getScrollPosition().getX(), tempx);
harness.check(pane.getScrollPosition().getY(), tempy);
}