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
Containers:
- 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 TypeMethodDescriptionvoidMove the givento the requested location.Containerprivate voidprivate PointmoveLocation(Dimension size, Insets insets) protected final voidResizes theto the given size.Containerprivate voidprotected final voidresizeHeight(Container c, int height) Resizes thevertically.Containerprivate static PointresizeLocation(int width, int height, int right, int bottom) private static PointresizeLocation(Dimension size, Insets insets) private static PointresizeLocation(Pair<Dimension, Insets> resizeInfo) protected final voidresizeWidth(Container c, int width) Resizes thehorizontally.Containerprivate voidprivate voidsimulateResizeStarted(Container c, Pair<Dimension, Insets> resizeInfo, int x, int y) private static voidMethods 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 thehorizontally.Container- Parameters:
c- the targetContainer.width- the width that theContainershould have after being resized.- Throws:
IllegalStateException- if theContaineris not enabled.IllegalStateException- if theContaineris not resizable by the user.IllegalStateException- if theContaineris not showing on the screen.
-
resizeHeight
Resizes thevertically.Container- Parameters:
c- the targetContainer.height- the height that theContainershould have after being resized.- Throws:
IllegalStateException- if theContaineris not enabled.IllegalStateException- if theContaineris not resizable by the user.IllegalStateException- if theContaineris not showing on the screen.
-
resize
Resizes theto the given size.Container- Parameters:
c- the targetContainer.width- the width to resize theContainerto.height- the height to resize theContainerto.- Throws:
IllegalStateException- if theContaineris not enabled.IllegalStateException- if theContaineris not resizable by the user.IllegalStateException- if theContaineris 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 givento the requested location.Container- Parameters:
c- the targetContainer.x- the horizontal coordinate.y- the vertical coordinate.- Throws:
IllegalStateException- if theContaineris not enabled.IllegalStateException- if theContaineris not movable by the user.IllegalStateException- if theContaineris not showing on the screen.
-
moveInfo
-
validateCanMove
-
moveBy
-
simulateMoveStarted
-
moveLocation
-