|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.extensions.jfcunit.TestHelper
junit.extensions.jfcunit.JFCTestHelper
Class that provides facilities for locating components within a GUI. To use create a new instance of JFCTestHelper in your setUp. Windows can only be located once they have been shown once to the user. Provide methods for entering clicks and drag operations. Note: java.awt.dnd functions are tightly integrated with the OS and are not dependent on the AWTEventQueue processing. Thus these interactions can only be done with the RobotTestHelper which sends events in at the OS level.
Field Summary | |
private int |
m_lastClicks
Last number of clicks. |
private int |
m_lastMouseModifiers
The mouse buttons that were pressed in the previous call. |
private boolean |
m_lastPopup
The popup that appeared in the previous call. |
private long |
m_lastPressed
The mouse buttons that were pressed in the previous call. |
private java.awt.EventQueue |
m_queue
The EventQueue on which all events are processed. |
private static java.awt.Point |
s_last
The coordinate where the last event was fired. |
Fields inherited from class junit.extensions.jfcunit.TestHelper |
DEFAULTSLEEP |
Constructor Summary | |
JFCTestHelper()
Constructor. |
Method Summary | |
protected void |
keyPressed(java.awt.Component ultimate,
JFCKeyStroke stroke)
Process a key press event on a component. |
protected void |
keyReleased(java.awt.Component ultimate,
JFCKeyStroke stroke)
Process a key release event on a component. |
protected void |
mouseMoved(java.awt.Component ultimate,
int x,
int y)
Process a mouse move event on a component. |
protected void |
mousePressed(java.awt.Component ultimate,
int modifiers,
int click,
boolean isPopupTrigger)
Process a mouse press event on a component. |
protected void |
mouseReleased(java.awt.Component ultimate,
int modifiers,
int click,
boolean isPopupTrigger)
Process a mouse release event on a component. |
protected void |
mouseWheel(java.awt.Component ultimate,
int amount,
int wheelRotation)
Simulate rotating the mouseWheel Only supported in Java 1.4. |
private void |
postEvent(java.awt.AWTEvent evt)
This method is just present so as to put debug statements in one central place, without repeating everywhere. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.awt.Point s_last
private java.awt.EventQueue m_queue
private boolean m_lastPopup
private int m_lastClicks
private int m_lastMouseModifiers
private long m_lastPressed
Constructor Detail |
public JFCTestHelper()
Method Detail |
protected void keyPressed(java.awt.Component ultimate, JFCKeyStroke stroke)
keyPressed
in class TestHelper
ultimate
- The ultimate parent Componentstroke
- The JFCKeyStroke to be performed.protected void keyReleased(java.awt.Component ultimate, JFCKeyStroke stroke)
keyReleased
in class TestHelper
ultimate
- The ultimate parent Componentstroke
- The JFCKeyStroke to be performed.protected void mouseMoved(java.awt.Component ultimate, int x, int y)
mouseMoved
in class TestHelper
ultimate
- The ultimate parent Componentx
- The x coordinate of the point where the mouse is being moved to.y
- The y coordinate of the point where the mouse is being moved to.protected void mousePressed(java.awt.Component ultimate, int modifiers, int click, boolean isPopupTrigger)
mousePressed
in class TestHelper
ultimate
- The ultimate parent Componentmodifiers
- The modifiers associated with this mouse event.click
- The number of clicks associated with this mouse event.isPopupTrigger
- Whether this mouse event will generate a popup.protected void mouseReleased(java.awt.Component ultimate, int modifiers, int click, boolean isPopupTrigger)
mouseReleased
in class TestHelper
ultimate
- The ultimate parent Componentmodifiers
- The modifiers associated with this mouse event.click
- The number of clicks associated with this mouse event.isPopupTrigger
- Whether this mouse event will generate a popup.protected void mouseWheel(java.awt.Component ultimate, int amount, int wheelRotation)
mouseWheel
in class TestHelper
ultimate
- Component to fire the events on.amount
- Amount to rotate the wheel.wheelRotation
- amount to rotate the wheel. positive for
rotation towards the user. Negative for rotation away from the user.private void postEvent(java.awt.AWTEvent evt)
evt
- The event to be posted.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |