Package org.fest.swing.driver
Class JInternalFrameDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JInternalFrameDriver
Understands functional testing of
JInternalFrames:
- 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 TypeMethodDescriptionvoidclose(JInternalFrame internalFrame) Closes the given.JInternalFramecloseInfo(JInternalFrame internalFrame) voiddeiconify(JInternalFrame internalFrame) De-iconifies the given.JInternalFramedeiconifyInfo(JInternalFrame internalFrame) (package private) voidfailIfVetoed(JInternalFrame internalFrame, JInternalFrameAction action, UnexpectedException unexpected) private static PointfindIconifyLocation(JInternalFrame internalFrame) findMaximizeLocation(JInternalFrame internalFrame) voidiconify(JInternalFrame internalFrame) Iconifies the given.JInternalFrameiconifyInfo(JInternalFrame internalFrame) voidmaximize(JInternalFrame internalFrame) Maximizes the given, deconifying it first if it is iconified.JInternalFrameprivate voidmaximizeOrNormalize(JInternalFrame internalFrame, JInternalFrameAction action, Pair<Container, Point> toMoveMouseTo) voidmoveTo(JInternalFrame internalFrame, Point where) Moves theto the given location.JInternalFramevoidmoveToBack(JInternalFrame internalFrame) Brings the givento the back.JInternalFramevoidmoveToFront(JInternalFrame internalFrame) Brings the givento the front.JInternalFramevoidnormalize(JInternalFrame internalFrame) Normalizes the given, deconifying it first if it is iconified.JInternalFramevoidresizeHeightTo(JInternalFrame w, int height) Resizes thevertically.JInternalFramevoidresizeTo(JInternalFrame internalFrame, Dimension size) Resizes theto the given size.JInternalFramevoidresizeWidthTo(JInternalFrame internalFrame, int width) Resizes thehorizontally.JInternalFrameprivate voidsetIconProperty(JInternalFrame internalFrame, JInternalFrameAction action) private voidsetMaximumProperty(JInternalFrame internalFrame, JInternalFrameAction action) private static voidtoBack(JInternalFrame internalFrame) private static voidtoFront(JInternalFrame internalFrame) validateAndFindCloseInfo(JInternalFrame internalFrame) validateAndfindDeiconifyInfo(JInternalFrame internalFrame) validateAndfindIconifyInfo(JInternalFrame internalFrame) validateAndFindMaximizeLocation(JInternalFrame internalFrame) validateAndFindNormalizeLocation(JInternalFrame internalFrame) private static voidvalidateCanClose(JInternalFrame internalFrame) private static voidvalidateCanMaximize(JInternalFrame internalFrame) private static voidvalidateIsShowingOrIconified(JInternalFrame internalFrame) private PropertyVetoExceptionvetoFrom(UnexpectedException unexpected) Methods inherited from class org.fest.swing.driver.JComponentDriver
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisibleMethods inherited from class org.fest.swing.driver.ContainerDriver
move, resize, resizeHeight, resizeWidthMethods 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
-
JInternalFrameDriver
Creates a newJInternalFrameDriver.- Parameters:
robot- the robot to use to simulate user input.
-
-
Method Details
-
moveToFront
Brings the givento the front.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.
-
toFront
-
moveToBack
Brings the givento the back.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.
-
toBack
-
maximize
Maximizes the given, deconifying it first if it is iconified.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.- Throws:
IllegalStateException- if theJInternalFrameis not maximizable.IllegalStateException- if theJInternalFrameis not showing on the screen.ActionFailedException- if theJInternalFramevetoes the action.
-
validateAndFindMaximizeLocation
@RunsInEDT private static Pair<Container,Point> validateAndFindMaximizeLocation(JInternalFrame internalFrame) -
validateCanMaximize
-
normalize
Normalizes the given, deconifying it first if it is iconified.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.- Throws:
IllegalStateException- if theJInternalFrameis not showing on the screen.ActionFailedException- if theJInternalFramevetoes the action.
-
validateAndFindNormalizeLocation
@RunsInEDT private static Pair<Container,Point> validateAndFindNormalizeLocation(JInternalFrame internalFrame) -
validateIsShowingOrIconified
-
findMaximizeLocation
@RunsInCurrentThread private static Pair<Container,Point> findMaximizeLocation(JInternalFrame internalFrame) -
maximizeOrNormalize
@RunsInEDT private void maximizeOrNormalize(JInternalFrame internalFrame, JInternalFrameAction action, Pair<Container, Point> toMoveMouseTo) -
setMaximumProperty
@RunsInEDT private void setMaximumProperty(JInternalFrame internalFrame, JInternalFrameAction action) -
iconify
Iconifies the given.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.- Throws:
IllegalStateException- if theJInternalFrameis not showing on the screen.IllegalStateException- if theJInternalFrameis not iconifiable.ActionFailedException- if theJInternalFramevetoes the action.
-
validateAndfindIconifyInfo
@RunsInEDT private static Pair<Boolean,Point> validateAndfindIconifyInfo(JInternalFrame internalFrame) -
iconifyInfo
-
deiconify
De-iconifies the given.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.- Throws:
IllegalStateException- if theJInternalFrameis not showing on the screen.ActionFailedException- if theJInternalFramevetoes the action.
-
validateAndfindDeiconifyInfo
@RunsInEDT private static Triple<Boolean,Container, validateAndfindDeiconifyInfoPoint> (JInternalFrame internalFrame) -
deiconifyInfo
@RunsInCurrentThread private static Triple<Boolean,Container, deiconifyInfoPoint> (JInternalFrame internalFrame) -
findIconifyLocation
-
setIconProperty
-
failIfVetoed
void failIfVetoed(JInternalFrame internalFrame, JInternalFrameAction action, UnexpectedException unexpected) -
vetoFrom
-
resizeWidthTo
Resizes thehorizontally.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.width- the width that theJInternalFrameshould have after being resized.- Throws:
IllegalStateException- if theJInternalFrameis not showing on the screen.IllegalStateException- if theJInternalFrameis not resizable by the user.
-
resizeHeightTo
Resizes thevertically.JInternalFrame- Parameters:
w- the targetJInternalFrame.height- the height that theJInternalFrameshould have after being resized.- Throws:
IllegalStateException- if theJInternalFrameis not showing on the screen.IllegalStateException- if theJInternalFrameis not resizable by the user.
-
resizeTo
Resizes theto the given size.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.size- the size to resize theJInternalFrameto.- Throws:
IllegalStateException- if theJInternalFrameis not showing on the screen.IllegalStateException- if theJInternalFrameis not resizable by the user.
-
moveTo
Moves theto the given location.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.where- the location to move theJInternalFrameto.- Throws:
IllegalStateException- if theJInternalFrameis not showing on the screen.
-
close
Closes the given.JInternalFrame- Parameters:
internalFrame- the targetJInternalFrame.- Throws:
IllegalStateException- if theJInternalFrameis not showing on the screen.IllegalStateException- if theJInternalFrameis not closable.
-
validateAndFindCloseInfo
@RunsInEDT private static Pair<Boolean,Point> validateAndFindCloseInfo(JInternalFrame internalFrame) -
validateCanClose
-
closeInfo
-