Java Doc for Robot.java in  » Testing » abbot-1.0.1 » abbot » tester » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » abbot 1.0.1 » abbot.tester 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   abbot.tester.Robot

All known Subclasses:   abbot.tester.ComponentTester,
Robot
public class Robot implements AWTConstants(Code)
Provide a higher level of abstraction for user input (A Better Robot). The Robot's operation may be affected by the following properties:
abbot.robot.auto_delay

Set this to a value representing the millisecond count in between generated events. Usually just set to 100-200 if you want to slow down the playback to simulate actual user input. The default is zero delay.
abbot.robot.mode

Set this to either "robot" or "awt" to designate the desired mode of event generation. "robot" uses java.awt.Robot to generate events, while "awt" stuffs events directly into the AWT event queue.
abbot.robot.event_post_delay

This is the maximum number of ms it takes the system to post an AWT event in response to a Robot-generated event.
abbot.robot.default_delay

Base delay setting, acts as default value for the next two.
abbot.robot.popup_delay

Set this to the maximum time to wait for a menu to appear or be generated.
abbot.robot.component_delay

Set this to the maximum time to wait for a Component to become available.

The Robot class provides a generic solution for dealing with asynchronous updates to the UI with the Robot.wait(Condition,long,int) method. This allows the testing thread to pause until a given component of data value in a component is ready.

NOTE: Only use event queue synchronization (e.g. Robot.invokeAndWait(Runnable) or Robot.waitForIdle() when a subsequent robot-level action is being applied to the results of a prior action (e.g. focus, deiconify, menu selection). Otherwise, don't introduce a mandatory delay (e.g. use Robot.invokeLater(Runnable) ).

NOTE: If a robot action isn't reproduced properly, you may need to introduce either additional events or extra delay. Adding enforced delay for a given platform is usually preferable to generating additional events, so always try that first, but be sure to restrict it to the platform in question.

NOTE: Robot actions should never be invoked on the event dispatch thread.



Field Summary
public static  intEM_AWT
     Post events to the AWT event queue.
public static  intEM_ROBOT
     Use java.awt.Robot to generate events.
protected static  longIDLE_TIMEOUT
    
final public static  StringMOUSELESS_MODIFIER
    
final public static  intMOUSELESS_MODIFIER_MASK
    
public static  intcomponentDelay
     Delay before failing to find a component that should be visible.
public static  intdefaultDelay
     Base delay setting.
protected static  intpopupDelay
     Delay before failing to find a popup menu that should appear.

Constructor Summary
public  Robot()
     Default constructor.

Method Summary
public  voidactivate(Window win)
     Activate the given window.
public static  booleancanMoveWindows()
     Returns whether it is possible to move windows that are not an instance of Frame or Dialog.
public static  booleancanResizeWindows()
     Returns whether it is possible to resize windows that are not an instance of Frame or Dialog.
public  BufferedImagecapture(Rectangle bounds)
     Capture the contents of the given rectangle.
public  BufferedImagecapture(Component comp)
     Capture the contents of the given component, sans any border or insets.
public  BufferedImagecapture(Component comp, boolean ignoreBorder)
     Capture the contents of the given component, optionally including the border and/or insets.
final public  voidclick(Component comp)
     Click in the center of the given component.
final public  voidclick(Component comp, int mask)
     Click in the center of the given component, specifying which button.
final public  voidclick(Component comp, int x, int y)
     Click in the component at the given location.
final public  voidclick(Component comp, int x, int y, int mask)
     Click in the component at the given location with the given button.
public  voidclick(Component comp, int x, int y, int mask, int count)
     Click in the given part of the component.
public  voidclose(Window w)
     Invoke the window close operation.
public  voiddeiconify(Frame frame)
    
public  voiddelay(int ms)
     Sleep the given duration of ms.
protected static  StringdescriptiveClassName(Class cls)
    
public  voiddrag(Component src, int sx, int sy)
     Begin a drag operation using button 1.

This method is tuned for native drag/drop operations, so if you get odd behavior, you might try using a simple Robot.mousePress(Component,int,int) instead.

public  voiddrag(Component src, int sx, int sy, int buttons)
     Begin a drag operation using the given button mask.

This method is tuned for native drag/drop operations, so if you get odd behavior, you might try using a simple Robot.mousePress(Component,int,int,int) instead.

public  voiddragOver(Component dst, int x, int y)
     Move the mouse appropriately to get from the source to the destination.
public  voiddrop(Component target, int x, int y)
     End a drag operation, releasing the mouse button over the given target location.

This method is tuned for native drag/drop operations, so if you get odd behavior, you might try using a simple Robot.mouseMove(Component,int,int) , Robot.mouseRelease() instead.

public  ComponentfindFocusOwner()
     Return the Component which currently owns the focus.
protected  voidfireAccessibleAction(Component context, AccessibleAction action, String name)
    
public  voidfocus(Component comp)
     Move keyboard focus to the given component.
public  voidfocus(Component comp, boolean wait)
     Move keyboard focus to the given component.
public static  intgetAutoDelay()
    
public static  StringgetBorderTitle(Component c)
    
public static  ClassgetCanonicalClass(Class refClass)
    
protected  PointgetCloseLocation(Container c)
    
public static  StringgetDescriptiveName(Component c)
     Return a descriptive name for the given component for use in UI text (may be localized if appropriate and need not be re-usable across locales.
public static  StringgetEventID(AWTEvent event)
     Return the symbolic name of the given event's ID.
public static  intgetEventID(Class cls, String id)
     Return the numeric event ID corresponding to the given string.
public static  intgetEventMode()
     Returns the current event-generation mode.
public static  StringgetEventModeDescription()
    
public static  intgetEventPostDelay()
    
protected  EventQueuegetEventQueue(Component c)
     Usually only needed when dealing with Applets.
public static  StringgetIconName(Component c)
    
protected  PointgetIconifyLocation(Container c)
     Identify the coordinates of the iconify button where we can, returning (0, 0) if we can't.
public static  intgetIndex(Container parent, Component comp)
     Returns the index of the given component within the given container.
public static  StringgetLabel(Component c)
    
protected  PointgetMaximizeLocation(Container c)
     Identify the coordinates of the maximize button where possible, returning null if not.
protected  PointgetMoveLocation(Container c)
     Return where the mouse usually grabs to move a window.
public static  StringgetName(Component c)
    
public static  intgetPreferredRobotAutoDelay()
     Returns the appropriate auto delay for robot-generated events.
protected  PointgetResizeLocation(Container c)
     Return where the mouse usually grabs to resize a window.
public static  java.awt.RobotgetRobot()
     Returns a functioning instance of java.awt.Robot.
public static  InputStategetState()
     Return a singleton InputState object.
public static  StringgetText(Component c)
    
public static  StringgetTitle(Component c)
    
public  voidiconify(Frame frame)
     Iconify the given Frame.
public  voidinvokeAction(Runnable action)
    
public  voidinvokeAction(Component c, Runnable action)
    
public  voidinvokeAndWait(Component c, Runnable action)
     Post a runnable on the given component's event queue and wait for it to finish.
public  voidinvokeAndWait(Runnable action)
     Run the given action on the event dispatch thread, but don't return until it's been run.
public  voidinvokeLater(Component context, Runnable action)
     Post a runnable on the given component's event queue.
public  voidinvokeLater(Runnable action)
     Run the given action on the event dispatch thread.
protected  booleanisReadyForInput(Component c)
    
protected  voidjitter(Component comp, int x, int y)
    
protected  voidjitter(int x, int y)
    
public  voidkey(int keycode)
     Type the given keycode with no modifiers.
public  voidkey(int keycode, int modifiers)
     Type the given keycode with the given modifiers.
public  voidkeyPress(int keycode)
    
public  voidkeyRelease(int keycode)
     Send a key release event.
public  voidkeyString(String str)
     Type the given string.
public  voidkeyStroke(char ch)
     Type the given character.
public  voidmaximize(Frame frame)
     Make the window full size.
public  voidmouseMove(Component comp)
     Move the pointer to the center of the given component.
public  voidmouseMove(Component comp, int x, int y)
     Move the pointer to the given coordinates relative to the given component.
public  voidmousePress(int buttons)
     Send a button press event.
public  voidmousePress(Component comp)
    
public  voidmousePress(Component comp, int mask)
    
public  voidmousePress(Component comp, int x, int y)
    
public  voidmousePress(Component comp, int x, int y, int mask)
     Mouse down in the given part of the component.
public  voidmouseRelease()
     Send a button release event for button 1.
public  voidmouseRelease(int buttons)
     Send a button release event.
public  voidmove(Container comp, int newx, int newy)
     Move the given Frame/Dialog to the requested location.
public  voidmoveBy(Container comp, int dx, int dy)
     Move the given Window by the given amount.
public  voidnormalize(Frame frame)
    
protected  voidpostEvent(Component comp, AWTEvent ev)
     Post the given event to the corresponding event queue for the given component.
protected  booleanpostInvocationEvent(EventQueue eq, Toolkit toolkit, long timeout)
    
protected  booleanqueueBlocked()
     Check for a blocked event queue (symptomatic of an active w32 AWT popup menu).
public  voidreset()
    
public  voidresize(Container comp, int width, int height)
     Resize the given Frame/Dialog to the given size.
public  voidresizeBy(Container comp, int dx, int dy)
     Resize the given Frame/Dialog by the given amounts.
public  Colorsample(int x, int y)
     Sample the color at the given point on the screen.
public  Colorsample(Component c, int x, int y)
     Sample the color at the given point on the component.
public  Colorsample(Component c, ComponentLocation loc)
     Sample the color at the given location on the component.
public  voidselectAWTMenuItem(Frame frame, String path)
     Select the given menu item from the given Frame.
public  voidselectAWTMenuItem(MenuComponent item)
     Select an AWT menu item.
public  voidselectAWTMenuItemByLabel(Frame frame, String path)
    
public  voidselectAWTPopupMenuItem(Component invoker, String path)
     Select the given menu item from a PopupMenu on the given Component. The given String may be either a label or path of labels, but must uniquely identify the menu item.
public  voidselectAWTPopupMenuItem(MenuComponent item)
     Select an AWT popup menu item.
public  voidselectAWTPopupMenuItemByLabel(Component invoker, String path)
    
public  voidselectMenuItem(Component sameWindow, String path)
     Find and select the given menu item, by path.
public  voidselectMenuItem(Component item)
     Find and select the given menu item.
public  voidselectPopupMenuItem(Component invoker, ComponentLocation loc, String path)
    
public  voidsendEvent(AWTEvent event)
     Send the given event as appropriate to the event-generation mode.
public static  voidsetAutoDelay(int ms)
     Allow this to be adjusted, mostly for testing.
public static  voidsetEventMode(int mode)
     Set the event-generation mode.
public static  voidsetEventPostDelay(int delay)
    
public  voidsetModifiers(int modifiers, boolean press)
     Press or release the appropriate modifiers corresponding to the given mask.
public  ComponentshowPopupMenu(Component invoker)
     Attempt to display a popup menu at center of the component.
public  ComponentshowPopupMenu(Component invoker, int x, int y)
     Attempt to display a popup menu at the given coordinates.
public static  StringsimpleClassName(Class cls)
     Strip the package from the class name.
public  voidsleep()
     Sleep for a little bit, measured in UI time.
public static  StringtoHierarchyPath(Component c)
     Provides the hierarchic path of the given component by component class, e.g.
public static  StringtoString(Component comp)
     Provides a more concise representation of the component than the default Component.toString().
public static  StringtoString(Object obj)
     Provide a string representation of the given component (Component or MenuComponent.
public static  StringtoString(AWTEvent event)
     Provide a more concise representation of the event than the default AWTEvent.toString().
final protected static  booleanuseScreenMenuBar()
     OS X using screenMenuBar actually uses an AWT menu as the live component.
protected  booleanuserMovable(Component comp)
     Return whether it is possible for the user to move the given component.
protected  booleanuserResizable(Component comp)
     Return whether it is possible for the user to resize the given component.
public  voidwait(Condition condition)
     Wait for the given Condition to return true.
public  voidwait(Condition condition, long timeout)
     Wait for the given Condition to return true, waiting for timeout ms.
throws:
  WaitTimedOutError - if the timeout is exceeded.
public  voidwait(Condition condition, long timeout, int interval)
     Wait for the given Condition to return true, waiting for timeout ms, polling at the given interval.
public  voidwaitForIdle()
     Wait for an idle AWT event queue.

Field Detail
EM_AWT
public static int EM_AWT(Code)
Post events to the AWT event queue.



EM_ROBOT
public static int EM_ROBOT(Code)
Use java.awt.Robot to generate events.



IDLE_TIMEOUT
protected static long IDLE_TIMEOUT(Code)



MOUSELESS_MODIFIER
final public static String MOUSELESS_MODIFIER(Code)



MOUSELESS_MODIFIER_MASK
final public static int MOUSELESS_MODIFIER_MASK(Code)



componentDelay
public static int componentDelay(Code)
Delay before failing to find a component that should be visible.



defaultDelay
public static int defaultDelay(Code)
Base delay setting.



popupDelay
protected static int popupDelay(Code)
Delay before failing to find a popup menu that should appear.




Constructor Detail
Robot
public Robot()(Code)
Default constructor.




Method Detail
activate
public void activate(Window win)(Code)
Activate the given window.



canMoveWindows
public static boolean canMoveWindows()(Code)
Returns whether it is possible to move windows that are not an instance of Frame or Dialog. Most X11 window managers will allow this, but stock Macintosh and Windows do not.



canResizeWindows
public static boolean canResizeWindows()(Code)
Returns whether it is possible to resize windows that are not an instance of Frame or Dialog. Most X11 window managers will allow this, but stock Macintosh and Windows do not.



capture
public BufferedImage capture(Rectangle bounds)(Code)
Capture the contents of the given rectangle.



capture
public BufferedImage capture(Component comp)(Code)
Capture the contents of the given component, sans any border or insets. This should only be used on components that do not use a LAF UI, or the results will not be consistent across platforms.



capture
public BufferedImage capture(Component comp, boolean ignoreBorder)(Code)
Capture the contents of the given component, optionally including the border and/or insets. This should only be used on components that do not use a LAF UI, or the results will not be consistent across platforms.



click
final public void click(Component comp)(Code)
Click in the center of the given component.



click
final public void click(Component comp, int mask)(Code)
Click in the center of the given component, specifying which button.



click
final public void click(Component comp, int x, int y)(Code)
Click in the component at the given location.



click
final public void click(Component comp, int x, int y, int mask)(Code)
Click in the component at the given location with the given button.



click
public void click(Component comp, int x, int y, int mask, int count)(Code)
Click in the given part of the component. All other click methods must eventually invoke this one. This method sometimes needs to be redefined (i.e. JComponent to scroll before clicking).



close
public void close(Window w)(Code)
Invoke the window close operation.



deiconify
public void deiconify(Frame frame)(Code)



delay
public void delay(int ms)(Code)
Sleep the given duration of ms.



descriptiveClassName
protected static String descriptiveClassName(Class cls)(Code)



drag
public void drag(Component src, int sx, int sy)(Code)
Begin a drag operation using button 1.

This method is tuned for native drag/drop operations, so if you get odd behavior, you might try using a simple Robot.mousePress(Component,int,int) instead.




drag
public void drag(Component src, int sx, int sy, int buttons)(Code)
Begin a drag operation using the given button mask.

This method is tuned for native drag/drop operations, so if you get odd behavior, you might try using a simple Robot.mousePress(Component,int,int,int) instead.




dragOver
public void dragOver(Component dst, int x, int y)(Code)
Move the mouse appropriately to get from the source to the destination. Enter/exit events will be generated where appropriate.



drop
public void drop(Component target, int x, int y)(Code)
End a drag operation, releasing the mouse button over the given target location.

This method is tuned for native drag/drop operations, so if you get odd behavior, you might try using a simple Robot.mouseMove(Component,int,int) , Robot.mouseRelease() instead.




findFocusOwner
public Component findFocusOwner()(Code)
Return the Component which currently owns the focus.



fireAccessibleAction
protected void fireAccessibleAction(Component context, AccessibleAction action, String name)(Code)



focus
public void focus(Component comp)(Code)
Move keyboard focus to the given component. Note that the component may not yet have focus when this method returns.



focus
public void focus(Component comp, boolean wait)(Code)
Move keyboard focus to the given component.



getAutoDelay
public static int getAutoDelay()(Code)



getBorderTitle
public static String getBorderTitle(Component c)(Code)



getCanonicalClass
public static Class getCanonicalClass(Class refClass)(Code)



getCloseLocation
protected Point getCloseLocation(Container c)(Code)



getDescriptiveName
public static String getDescriptiveName(Component c)(Code)
Return a descriptive name for the given component for use in UI text (may be localized if appropriate and need not be re-usable across locales.



getEventID
public static String getEventID(AWTEvent event)(Code)
Return the symbolic name of the given event's ID.



getEventID
public static int getEventID(Class cls, String id)(Code)
Return the numeric event ID corresponding to the given string.



getEventMode
public static int getEventMode()(Code)
Returns the current event-generation mode.



getEventModeDescription
public static String getEventModeDescription()(Code)



getEventPostDelay
public static int getEventPostDelay()(Code)



getEventQueue
protected EventQueue getEventQueue(Component c)(Code)
Usually only needed when dealing with Applets.



getIconName
public static String getIconName(Component c)(Code)



getIconifyLocation
protected Point getIconifyLocation(Container c)(Code)
Identify the coordinates of the iconify button where we can, returning (0, 0) if we can't.



getIndex
public static int getIndex(Container parent, Component comp)(Code)
Returns the index of the given component within the given container.



getLabel
public static String getLabel(Component c)(Code)



getMaximizeLocation
protected Point getMaximizeLocation(Container c)(Code)
Identify the coordinates of the maximize button where possible, returning null if not.



getMoveLocation
protected Point getMoveLocation(Container c)(Code)
Return where the mouse usually grabs to move a window. Center of the top of the frame is usually a good choice.



getName
public static String getName(Component c)(Code)



getPreferredRobotAutoDelay
public static int getPreferredRobotAutoDelay()(Code)
Returns the appropriate auto delay for robot-generated events.



getResizeLocation
protected Point getResizeLocation(Container c)(Code)
Return where the mouse usually grabs to resize a window. The lower right corner of the window is usually a good choice.



getRobot
public static java.awt.Robot getRobot()(Code)
Returns a functioning instance of java.awt.Robot. If this method returns null, it should be assumed that java.awt.Robot is unavailable or non-functional on the current system.



getState
public static InputState getState()(Code)
Return a singleton InputState object.



getText
public static String getText(Component c)(Code)



getTitle
public static String getTitle(Component c)(Code)



iconify
public void iconify(Frame frame)(Code)
Iconify the given Frame. Don't support iconification of Dialogs at this point (although maybe should).



invokeAction
public void invokeAction(Runnable action)(Code)
Robot.invokeLater(Runnable)
Parameters:
  action -



invokeAction
public void invokeAction(Component c, Runnable action)(Code)
Robot.invokeLater(Component,Runnable)
Parameters:
  c -
Parameters:
  action -



invokeAndWait
public void invokeAndWait(Component c, Runnable action)(Code)
Post a runnable on the given component's event queue and wait for it to finish.



invokeAndWait
public void invokeAndWait(Runnable action)(Code)
Run the given action on the event dispatch thread, but don't return until it's been run.



invokeLater
public void invokeLater(Component context, Runnable action)(Code)
Post a runnable on the given component's event queue. Useful when driving multiple Applets, but is also useful to ensure an operation happens on the event dispatch thread.



invokeLater
public void invokeLater(Runnable action)(Code)
Run the given action on the event dispatch thread. This should be used for any non-read-only methods invoked directly on a GUI component. NOTE: if you want to use the results of the action, use invokeAndWait instead.



isReadyForInput
protected boolean isReadyForInput(Component c)(Code)
Is the given component ready for robot input?



jitter
protected void jitter(Component comp, int x, int y)(Code)



jitter
protected void jitter(int x, int y)(Code)



key
public void key(int keycode)(Code)
Type the given keycode with no modifiers.



key
public void key(int keycode, int modifiers)(Code)
Type the given keycode with the given modifiers. Modifiers is a mask from the available InputEvent masks.



keyPress
public void keyPress(int keycode)(Code)



keyRelease
public void keyRelease(int keycode)(Code)
Send a key release event.



keyString
public void keyString(String str)(Code)
Type the given string.



keyStroke
public void keyStroke(char ch)(Code)
Type the given character. Note that this sends the key to whatever component currently has the focus.



maximize
public void maximize(Frame frame)(Code)
Make the window full size. On 1.3.1, this is not reversible.



mouseMove
public void mouseMove(Component comp)(Code)
Move the pointer to the center of the given component.



mouseMove
public void mouseMove(Component comp, int x, int y)(Code)
Move the pointer to the given coordinates relative to the given component.



mousePress
public void mousePress(int buttons)(Code)
Send a button press event.



mousePress
public void mousePress(Component comp)(Code)



mousePress
public void mousePress(Component comp, int mask)(Code)



mousePress
public void mousePress(Component comp, int x, int y)(Code)



mousePress
public void mousePress(Component comp, int x, int y, int mask)(Code)
Mouse down in the given part of the component. All other mousePress methods must eventually invoke this one.



mouseRelease
public void mouseRelease()(Code)
Send a button release event for button 1.



mouseRelease
public void mouseRelease(int buttons)(Code)
Send a button release event.



move
public void move(Container comp, int newx, int newy)(Code)
Move the given Frame/Dialog to the requested location.



moveBy
public void moveBy(Container comp, int dx, int dy)(Code)
Move the given Window by the given amount.



normalize
public void normalize(Frame frame)(Code)



postEvent
protected void postEvent(Component comp, AWTEvent ev)(Code)
Post the given event to the corresponding event queue for the given component.



postInvocationEvent
protected boolean postInvocationEvent(EventQueue eq, Toolkit toolkit, long timeout)(Code)
whether we timed out waiting for the invocation to run



queueBlocked
protected boolean queueBlocked()(Code)
Check for a blocked event queue (symptomatic of an active w32 AWT popup menu). whether the event queue is blocked.



reset
public void reset()(Code)



resize
public void resize(Container comp, int width, int height)(Code)
Resize the given Frame/Dialog to the given size.



resizeBy
public void resizeBy(Container comp, int dx, int dy)(Code)
Resize the given Frame/Dialog by the given amounts.



sample
public Color sample(int x, int y)(Code)
Sample the color at the given point on the screen.



sample
public Color sample(Component c, int x, int y)(Code)
Sample the color at the given point on the component.



sample
public Color sample(Component c, ComponentLocation loc)(Code)
Sample the color at the given location on the component.



selectAWTMenuItem
public void selectAWTMenuItem(Frame frame, String path)(Code)
Select the given menu item from the given Frame. The given String may be either a label or path of labels, but must uniquely identify the menu item. For example, "Copy" would be valid if there is only one instance of that menu label under the MenuBar, otherwise you would need to specify "Edit|Copy" to ensure the proper selection. Note that this method doesn't require referencing the MenuComponent directly as a parameter.



selectAWTMenuItem
public void selectAWTMenuItem(MenuComponent item)(Code)
Select an AWT menu item.



selectAWTMenuItemByLabel
public void selectAWTMenuItemByLabel(Frame frame, String path)(Code)
Robot.selectAWTMenuItem(Frame,String)



selectAWTPopupMenuItem
public void selectAWTPopupMenuItem(Component invoker, String path)(Code)
Select the given menu item from a PopupMenu on the given Component. The given String may be either a label or path of labels, but must uniquely identify the menu item. For example, "Copy" would be valid if there is only one instance of that menu label under the MenuBar, otherwise you would need to specify "Edit|Copy" to ensure the proper selection. If there are more than one PopupMenu registerd on the invoking component, you will need to prefix the PopupMenu name as well, e.g. "popup0|Edit|Copy".



selectAWTPopupMenuItem
public void selectAWTPopupMenuItem(MenuComponent item)(Code)
Select an AWT popup menu item.



selectAWTPopupMenuItemByLabel
public void selectAWTPopupMenuItemByLabel(Component invoker, String path)(Code)
Robot.selectAWTPopupMenuItem(Component,String)



selectMenuItem
public void selectMenuItem(Component sameWindow, String path)(Code)
Find and select the given menu item, by path.



selectMenuItem
public void selectMenuItem(Component item)(Code)
Find and select the given menu item.



selectPopupMenuItem
public void selectPopupMenuItem(Component invoker, ComponentLocation loc, String path)(Code)



sendEvent
public void sendEvent(AWTEvent event)(Code)
Send the given event as appropriate to the event-generation mode.



setAutoDelay
public static void setAutoDelay(int ms)(Code)
Allow this to be adjusted, mostly for testing.



setEventMode
public static void setEventMode(int mode)(Code)
Set the event-generation mode.
throws:
  IllegalStateException - if the requested mode is EM_ROBOT andjava.awt.Robot is unavailable in the current environment.



setEventPostDelay
public static void setEventPostDelay(int delay)(Code)



setModifiers
public void setModifiers(int modifiers, boolean press)(Code)
Press or release the appropriate modifiers corresponding to the given mask.



showPopupMenu
public Component showPopupMenu(Component invoker)(Code)
Attempt to display a popup menu at center of the component.



showPopupMenu
public Component showPopupMenu(Component invoker, int x, int y)(Code)
Attempt to display a popup menu at the given coordinates.



simpleClassName
public static String simpleClassName(Class cls)(Code)
Strip the package from the class name.



sleep
public void sleep()(Code)
Sleep for a little bit, measured in UI time.



toHierarchyPath
public static String toHierarchyPath(Component c)(Code)
Provides the hierarchic path of the given component by component class, e.g. "JFrame:JRootPane:JPanel:JButton".



toString
public static String toString(Component comp)(Code)
Provides a more concise representation of the component than the default Component.toString().



toString
public static String toString(Object obj)(Code)
Provide a string representation of the given component (Component or MenuComponent.



toString
public static String toString(AWTEvent event)(Code)
Provide a more concise representation of the event than the default AWTEvent.toString().



useScreenMenuBar
final protected static boolean useScreenMenuBar()(Code)
OS X using screenMenuBar actually uses an AWT menu as the live component. The JXXX components exist, but are not effectively active.



userMovable
protected boolean userMovable(Component comp)(Code)
Return whether it is possible for the user to move the given component.



userResizable
protected boolean userResizable(Component comp)(Code)
Return whether it is possible for the user to resize the given component.



wait
public void wait(Condition condition)(Code)
Wait for the given Condition to return true. The default timeout may be changed by setting abbot.robot.default_delay.
throws:
  WaitTimedOutError - if the default timeout (30s) is exceeded.
See Also:   Robot.wait(Conditionlongint)
See Also:    Robot.wait For a description of the use of this function to support lazy loading in class files



wait
public void wait(Condition condition, long timeout)(Code)
Wait for the given Condition to return true, waiting for timeout ms.
throws:
  WaitTimedOutError - if the timeout is exceeded.
See Also:   Robot.wait(Conditionlongint)
See Also:    Robot.wait For a description of the use of this function to support lazy loading in class files



wait
public void wait(Condition condition, long timeout, int interval)(Code)
Wait for the given Condition to return true, waiting for timeout ms, polling at the given interval. This method can be used generically to support components that are lazily loaded in the context of writing testers or other testing code.

Take for example the simple case of trying to select an item in a list. If the model for this list is populate asynchronously then you may need to poll the list for a given amount of time until the item appears. This is very common in an application that contains many long running tasks.

A general solution to the problem can be seen in this pseudo code:

 wait(new Condition()
 {
 public boolean test()
 {
 return whether the ui element is avaliable
 }
 });
 performAction(ui element);
 

If you are writing a tester method then it is a good idea to use a standard timeout such as Robot.componentDelay to ensure they are consistently handled accross different testers.
throws:
  WaitTimedOutError - if the timeout is exceeded.




waitForIdle
public void waitForIdle()(Code)
Wait for an idle AWT event queue. Note that this is different from the implementation of java.awt.Robot.waitForIdle(), which may have events on the queue when it returns. Do NOT use this method if there are animations or other continual refreshes happening, since in that case it may never return.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.