Package org.fest.swing.driver
Class ContainerDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
- Direct Known Subclasses:
JComponentDriver
,WindowDriver
Understands functional testing of
Container
s:
- user input simulation
- state verification
- property value query
org.fest.swing.fixture
in your tests.-
Field Summary
Fields inherited from class org.fest.swing.driver.ComponentDriver
robot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Move the given
to the requested location.Container
private void
private Point
moveLocation
(Dimension size, Insets insets) protected final void
Resizes the
to the given size.Container
private void
protected final void
resizeHeight
(Container c, int height) Resizes the
vertically.Container
private static Point
resizeLocation
(int width, int height, int right, int bottom) private static Point
resizeLocation
(Dimension size, Insets insets) private static Point
resizeLocation
(Pair<Dimension, Insets> resizeInfo) protected final void
resizeWidth
(Container c, int width) Resizes the
horizontally.Container
private void
private void
simulateResizeStarted
(Container c, Pair<Dimension, Insets> resizeInfo, int x, int y) private static void
Methods inherited from class org.fest.swing.driver.ComponentDriver
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
-
Constructor Details
-
ContainerDriver
Creates a newContainerDriver
.- Parameters:
robot
- the robot to use to simulate user input.
-
-
Method Details
-
resizeWidth
Resizes the
horizontally.Container
- Parameters:
c
- the targetContainer
.width
- the width that theContainer
should have after being resized.- Throws:
IllegalStateException
- if theContainer
is not enabled.IllegalStateException
- if theContainer
is not resizable by the user.IllegalStateException
- if theContainer
is not showing on the screen.
-
resizeHeight
Resizes the
vertically.Container
- Parameters:
c
- the targetContainer
.height
- the height that theContainer
should have after being resized.- Throws:
IllegalStateException
- if theContainer
is not enabled.IllegalStateException
- if theContainer
is not resizable by the user.IllegalStateException
- if theContainer
is not showing on the screen.
-
resize
Resizes the
to the given size.Container
- Parameters:
c
- the targetContainer
.width
- the width to resize theContainer
to.height
- the height to resize theContainer
to.- Throws:
IllegalStateException
- if theContainer
is not enabled.IllegalStateException
- if theContainer
is not resizable by the user.IllegalStateException
- if theContainer
is not showing on the screen.
-
resizeInfo
-
resizeBy
-
simulateResizeStarted
@RunsInEDT private void simulateResizeStarted(Container c, Pair<Dimension, Insets> resizeInfo, int x, int y) -
resizeLocation
-
resizeLocation
-
resizeLocation
-
move
Move the given
to the requested location.Container
- Parameters:
c
- the targetContainer
.x
- the horizontal coordinate.y
- the vertical coordinate.- Throws:
IllegalStateException
- if theContainer
is not enabled.IllegalStateException
- if theContainer
is not movable by the user.IllegalStateException
- if theContainer
is not showing on the screen.
-
moveInfo
-
validateCanMove
-
moveBy
-
simulateMoveStarted
-
moveLocation
-