Package org.netbeans.jemmy.operators
Class FrameOperator
- java.lang.Object
-
- org.netbeans.jemmy.operators.Operator
-
- org.netbeans.jemmy.operators.ComponentOperator
-
- org.netbeans.jemmy.operators.ContainerOperator
-
- org.netbeans.jemmy.operators.WindowOperator
-
- org.netbeans.jemmy.operators.FrameOperator
-
- All Implemented Interfaces:
Outputable
,Timeoutable
- Direct Known Subclasses:
JFrameOperator
public class FrameOperator extends WindowOperator implements Outputable
Timeouts used:
FrameWaiter.WaitFrameTimeout - time to wait frame displayed
FrameWaiter.AfterFrameTimeout - time to sleep after frame has been dispayed
ComponentOperator.WaitStateTimeout - time to wait for text
.- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
Timeouts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FrameOperator.FrameByTitleFinder
Allows to find component by title.static class
FrameOperator.FrameFinder
Checks component type.-
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.ContainerOperator
ContainerOperator.ContainerFinder
-
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.Operator
Operator.ComponentVisualizer, Operator.DefaultPathParser, Operator.DefaultStringComparator, Operator.Finder, Operator.MapAction, Operator.MapBooleanAction, Operator.MapByteAction, Operator.MapCharacterAction, Operator.MapDoubleAction, Operator.MapFloatAction, Operator.MapIntegerAction, Operator.MapLongAction, Operator.MapVoidAction, Operator.NoBlockingAction, Operator.PathParser, Operator.StringComparator
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
IS_RESIZABLE_DPROP
Identifier for a resizable property.static java.lang.String
STATE_DPROP
Identifier for a state property.static java.lang.String
STATE_ICONIFIED_DPROP_VALUE
Identifier for a "iconified state" state property value.static java.lang.String
STATE_NORMAL_DPROP_VALUE
Identifier for a "normal state" state property value.static java.lang.String
TITLE_DPROP
Identifier for a title property.-
Fields inherited from class org.netbeans.jemmy.operators.ComponentOperator
HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, NAME_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROP
-
Fields inherited from class org.netbeans.jemmy.operators.Operator
CLASS_DPROP, TO_STRING_DPROP
-
-
Constructor Summary
Constructors Constructor Description FrameOperator()
Constructor.FrameOperator(int index)
Constructor.FrameOperator(java.awt.Frame w)
Constructs a FrameOperator object.FrameOperator(java.lang.String title)
Constructor.FrameOperator(java.lang.String title, int index)
Constructor.FrameOperator(java.lang.String title, int index, Operator env)
Constructor.FrameOperator(ComponentChooser chooser)
Constructs a FrameOperator object.FrameOperator(ComponentChooser chooser, int index)
Constructs a FrameOperator object.FrameOperator(ComponentChooser chooser, int index, Operator env)
Constructs a FrameOperator object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyEnvironment(Operator anotherOperator)
Copies all environment (output, timeouts, visualizer) from another operator.void
deiconify()
Deiconifies the frame.void
demaximize()
Demaximizes the frame.java.util.Hashtable
getDump()
Returns information about component.java.awt.Image
getIconImage()
MapsFrame.getIconImage()
through queuejava.awt.MenuBar
getMenuBar()
MapsFrame.getMenuBar()
through queueTestOut
getOutput()
Returns print output streams or writers.int
getState()
MapsFrame.getState()
through queuejava.lang.String
getTitle()
MapsFrame.getTitle()
through queuevoid
iconify()
Iconifies the frame.boolean
isResizable()
MapsFrame.isResizable()
through queuevoid
maximize()
Maximizes the frame.void
setIconImage(java.awt.Image image)
MapsFrame.setIconImage(Image)
through queuevoid
setMenuBar(java.awt.MenuBar menuBar)
MapsFrame.setMenuBar(MenuBar)
through queuevoid
setOutput(TestOut out)
Defines print output streams or writers.void
setResizable(boolean b)
MapsFrame.setResizable(boolean)
through queuevoid
setState(int i)
MapsFrame.setState(int)
through queuevoid
setTitle(java.lang.String string)
MapsFrame.setTitle(String)
through queueprotected static java.awt.Frame
waitFrame(ComponentChooser chooser, int index, Timeouts timeouts, TestOut output)
A method to be used from subclasses.void
waitState(int state)
Waits for the frame to have a specified state.void
waitTitle(java.lang.String title)
Waits for title.-
Methods inherited from class org.netbeans.jemmy.operators.WindowOperator
activate, addWindowListener, applyResourceBundle, applyResourceBundle, close, dispose, findSubWindow, findSubWindow, findWindow, findWindow, findWindow, findWindow, getFocusOwner, getOwnedWindows, getOwner, getWarningString, isActive, isFocused, move, pack, removeWindowListener, resize, toBack, toFront, waitClosed, waitSubWindow, waitSubWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow
-
Methods inherited from class org.netbeans.jemmy.operators.ContainerOperator
add, add, add, add, add, addContainerListener, createSubOperator, createSubOperator, findComponentAt, findComponentAt, findContainer, findContainer, findContainer, findContainer, findContainerUnder, findContainerUnder, findSubComponent, findSubComponent, getComponent, getComponentCount, getComponents, getInsets, getLayout, getTimeouts, isAncestorOf, paintComponents, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, setTimeouts, waitContainer, waitContainer, waitContainer, waitContainer, waitSubComponent, waitSubComponent
-
Methods inherited from class org.netbeans.jemmy.operators.ComponentOperator
activateWindow, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, checkImage, checkImage, clickForPopup, clickForPopup, clickForPopup, clickForPopup, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, contains, contains, createImage, createImage, dispatchEvent, doLayout, dragMouse, dragMouse, dragMouse, dragNDrop, dragNDrop, dragNDrop, enableInputMethods, enterMouse, exitMouse, findComponent, findComponent, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getCenterX, getCenterXForClick, getCenterY, getCenterYForClick, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getContainer, getContainers, getCursor, getDropTarget, getEventDispatcher, getFocus, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getSize, getSource, getToolkit, getTreeLock, getWidth, getWindow, getX, getY, hasFocus, imageUpdate, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, list, list, list, list, list, makeComponentVisible, moveMouse, paint, paintAll, prepareImage, prepareImage, pressKey, pressKey, pressMouse, pressMouse, print, printAll, pushKey, pushKey, releaseKey, releaseKey, releaseMouse, releaseMouse, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, transferFocus, typeKey, typeKey, typeKey, update, validate, waitComponent, waitComponent, waitComponent, waitComponent, waitComponentEnabled, waitComponentShowing, waitComponentVisible, waitHasFocus, wtComponentEnabled
-
Methods inherited from class org.netbeans.jemmy.operators.Operator
addOperatorPackage, addToDump, addToDump, createOperator, getCharBindingMap, getCharKey, getCharModifiers, getCharsKeys, getCharsKeys, getCharsModifiers, getCharsModifiers, getComparator, getDefaultComponentVisualizer, getDefaultMouseButton, getDefaultPathParser, getDefaultStringComparator, getDefaultVerification, getEnvironmentOperator, getParentPath, getParentPath, getPathParser, getPopupMouseButton, getProperties, getQueueTool, getVerification, getVisualizer, isCaptionEqual, isCaptionEqual, isCaptionEqual, lockQueue, parseString, parseString, printDump, produceNoBlocking, produceNoBlocking, produceTimeRestricted, produceTimeRestricted, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, setCharBindingMap, setComparator, setDefaultComponentVisualizer, setDefaultPathParser, setDefaultStringComparator, setDefaultVerification, setPathParser, setProperties, setVerification, setVisualizer, toStringSource, unlockAndThrow, unlockQueue, waitState
-
-
-
-
Field Detail
-
TITLE_DPROP
public static final java.lang.String TITLE_DPROP
Identifier for a title property.- See Also:
getDump()
, Constant Field Values
-
STATE_DPROP
public static final java.lang.String STATE_DPROP
Identifier for a state property.- See Also:
getDump()
, Constant Field Values
-
STATE_NORMAL_DPROP_VALUE
public static final java.lang.String STATE_NORMAL_DPROP_VALUE
Identifier for a "normal state" state property value.- See Also:
getDump()
, Constant Field Values
-
STATE_ICONIFIED_DPROP_VALUE
public static final java.lang.String STATE_ICONIFIED_DPROP_VALUE
Identifier for a "iconified state" state property value.- See Also:
getDump()
, Constant Field Values
-
IS_RESIZABLE_DPROP
public static final java.lang.String IS_RESIZABLE_DPROP
Identifier for a resizable property.- See Also:
getDump()
, Constant Field Values
-
-
Constructor Detail
-
FrameOperator
public FrameOperator(java.awt.Frame w)
Constructs a FrameOperator object.- Parameters:
w
- window
-
FrameOperator
public FrameOperator(ComponentChooser chooser, int index, Operator env)
Constructs a FrameOperator object.- Parameters:
chooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.env
- an operator to copy environment from.
-
FrameOperator
public FrameOperator(ComponentChooser chooser, int index)
Constructs a FrameOperator object.- Parameters:
chooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.
-
FrameOperator
public FrameOperator(ComponentChooser chooser)
Constructs a FrameOperator object.- Parameters:
chooser
- a component chooser specifying searching criteria.
-
FrameOperator
public FrameOperator(java.lang.String title, int index, Operator env)
Constructor. Waits for the frame with "title" subtitle. Constructor can be used in complicated cases when output or timeouts should differ from default.- Parameters:
title
- a window titleindex
- Ordinal component index.env
- an operator to copy environment from.- Throws:
TimeoutExpiredException
- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
FrameOperator
public FrameOperator(java.lang.String title, int index)
Constructor. Waits for the frame with "title" subtitle. Uses current timeouts and output values.- Parameters:
title
- a window titleindex
- Ordinal component index.- Throws:
TimeoutExpiredException
- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
,JemmyProperties#getCurrentTimeouts()
,JemmyProperties#getCurrentOutput()
-
FrameOperator
public FrameOperator(java.lang.String title)
Constructor. Waits for the frame with "title" subtitle. Uses current timeouts and output values.- Parameters:
title
- a window title- Throws:
TimeoutExpiredException
- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
,JemmyProperties#getCurrentTimeouts()
,JemmyProperties#getCurrentOutput()
-
FrameOperator
public FrameOperator(int index)
Constructor. Waits for the index'th frame. Uses current timeout and output for waiting and to init operator.- Parameters:
index
- Ordinal component index.- Throws:
TimeoutExpiredException
-
FrameOperator
public FrameOperator()
Constructor. Waits for the first frame. Uses current timeout and output for waiting and to init operator.- Throws:
TimeoutExpiredException
-
-
Method Detail
-
setOutput
public void setOutput(TestOut out)
Description copied from interface:Outputable
Defines print output streams or writers.- Specified by:
setOutput
in interfaceOutputable
- Overrides:
setOutput
in classWindowOperator
- Parameters:
out
- Identify the streams or writers used for print output.- See Also:
Outputable.getOutput()
-
getOutput
public TestOut getOutput()
Description copied from interface:Outputable
Returns print output streams or writers.- Specified by:
getOutput
in interfaceOutputable
- Overrides:
getOutput
in classWindowOperator
- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
Outputable.setOutput(org.netbeans.jemmy.TestOut)
-
copyEnvironment
public void copyEnvironment(Operator anotherOperator)
Description copied from class:Operator
Copies all environment (output, timeouts, visualizer) from another operator.- Overrides:
copyEnvironment
in classWindowOperator
- Parameters:
anotherOperator
- an operator to copy the environment to.
-
waitTitle
public void waitTitle(java.lang.String title)
Waits for title. Uses getComparator() comparator.- Parameters:
title
- Title to wait for.
-
iconify
public void iconify()
Iconifies the frame.
-
deiconify
public void deiconify()
Deiconifies the frame.
-
maximize
public void maximize()
Maximizes the frame.
-
demaximize
public void demaximize()
Demaximizes the frame.
-
waitState
public void waitState(int state)
Waits for the frame to have a specified state.- Parameters:
state
- a state for the frame to have.
-
getDump
public java.util.Hashtable getDump()
Returns information about component.- Overrides:
getDump
in classComponentOperator
- Returns:
- a Hashtable containing name-value pairs.
-
getIconImage
public java.awt.Image getIconImage()
MapsFrame.getIconImage()
through queue
-
getMenuBar
public java.awt.MenuBar getMenuBar()
MapsFrame.getMenuBar()
through queue
-
getState
public int getState()
MapsFrame.getState()
through queue
-
getTitle
public java.lang.String getTitle()
MapsFrame.getTitle()
through queue
-
isResizable
public boolean isResizable()
MapsFrame.isResizable()
through queue
-
setIconImage
public void setIconImage(java.awt.Image image)
MapsFrame.setIconImage(Image)
through queue
-
setMenuBar
public void setMenuBar(java.awt.MenuBar menuBar)
MapsFrame.setMenuBar(MenuBar)
through queue
-
setResizable
public void setResizable(boolean b)
MapsFrame.setResizable(boolean)
through queue
-
setState
public void setState(int i)
MapsFrame.setState(int)
through queue
-
setTitle
public void setTitle(java.lang.String string)
MapsFrame.setTitle(String)
through queue
-
waitFrame
protected static java.awt.Frame waitFrame(ComponentChooser chooser, int index, Timeouts timeouts, TestOut output)
A method to be used from subclasses. Uses timeouts and output passed as parameters during the waiting.- Parameters:
chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.timeouts
- timeouts to be used during the waiting.output
- an output to be used during the waiting.- Returns:
- Component instance or null if component was not found.
- Throws:
TimeoutExpiredException
-
-