|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.extensions.jfcunit.eventdata.AbstractEventData
Abstract data container class that holds most of the data necessary for jfcUnit to fire events.
Field Summary | |
private int |
m_modifiers
The modifier key values that need to be passed onto the event. |
private int |
m_position
The position to place the mouse within the component. |
private java.awt.Point |
m_referencePoint
The reference point to place the mouse. |
private java.awt.Point |
m_screenLocation
The screen location to place the mouse. |
private long |
m_sleepTime
The wait time in ms between each event. |
private JFCTestCase |
m_testCase
The JFCTestCase on whose thread awtSleep()
has to be invoked. |
private boolean |
m_valid
State of event data. |
Fields inherited from interface junit.extensions.jfcunit.eventdata.EventDataConstants |
CENTER, CUSTOM, DEFAULT_HOLDTIME, DEFAULT_ISPOPUPTRIGGER, DEFAULT_KEY_MODIFIERS, DEFAULT_MOUSE_MODIFIERS, DEFAULT_NUMBEROFCLICKS, DEFAULT_POPUP_MODIFIERS, DEFAULT_POSITION, DEFAULT_SCROLL_AMOUNT, DEFAULT_SLEEPTIME, DEFAULT_WHEEL_ROTATION, DOWN_ARROW_SUBCOMPONENT, EAST, EDITOR_SUBCOMPONENT, INVALID_SUBCOMPONENT, INVALID_TEXT_OFFSET, NORTH, NORTH_EAST, NORTH_WEST, OFFSET, PERCENT, POSITIONSTRINGS, SOUTH, SOUTH_EAST, SOUTH_WEST, UP_ARROW_SUBCOMPONENT, WEST |
Constructor Summary | |
AbstractEventData()
|
Method Summary | |
protected java.awt.Point |
calculatePoint(java.awt.Rectangle rect)
A utility method to calculate the Point
at which the events are to be fired based on the position
and reference-point specified. |
protected boolean |
canConsume(java.awt.AWTEvent ae)
Check if this event can consume the AWTEvent . |
abstract boolean |
consume(java.awt.AWTEvent ae)
Consume the Event . |
boolean |
equals(java.lang.Object o)
Compare to event datas and deterime if they are equal. |
abstract java.awt.Component |
getComponent()
The source Component on which the event has
to be fired. |
abstract int |
getDefaultModifiers()
Get the default modifiers. |
int |
getDefaultPosition()
Get the default position. |
long |
getDefaultSleepTime()
Get the default sleep time. |
java.awt.Point |
getLocationOnScreen()
Get the screen location for the event. |
int |
getModifiers()
Get the attribute value. |
(package private) abstract java.lang.String |
getModifierText()
Get the modifier text for the current modifiers. |
int |
getPosition()
Get the attribute value. |
java.awt.Point |
getReferencePoint()
Get the attribute value. |
java.awt.Component |
getRoot()
Return the root Container of the
current Component . |
java.awt.Component |
getRoot(java.awt.Component c)
Return the root Container of the
specified Component . |
long |
getSleepTime()
Get the attribute value. |
JFCTestCase |
getTestCase()
Get the attribute value. |
int |
hashCode()
Returns the hashCode of the contained component. |
boolean |
isMetaChar(int keyCode)
Returns true if the keyCode refers to a meta character. |
boolean |
isValid()
Get the valid state. |
protected boolean |
isValidForProcessing(java.awt.Component comp)
Checks whether a component is valid for processing using jfcUnit. |
void |
populate(org.w3c.dom.Element e)
Populate the Element with the attributes to recreate this event data. |
boolean |
prepareComponent()
Prepare the component to receive the Event
by calling requestFocus() on the Component
and calculating the screen location. |
protected void |
setLocationOnScreen(java.awt.Point screenLocation)
Set the screen location for the event. |
void |
setModifiers(int modifiers)
Set the attribute value. |
void |
setPosition(int position)
Set the attribute value. |
void |
setReferencePoint(java.awt.Point referencePoint)
Set the attribute value. |
void |
setSleepTime(long sleepTime)
Set the attribute value. |
void |
setTestCase(JFCTestCase testCase)
Set the attribute value. |
void |
setValid(boolean valid)
Set valid state. |
java.lang.String |
toString()
Get the String description of the abstract event. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private JFCTestCase m_testCase
JFCTestCase
on whose thread awtSleep()
has to be invoked.
private java.awt.Point m_referencePoint
private java.awt.Point m_screenLocation
private boolean m_valid
private int m_modifiers
private int m_position
private long m_sleepTime
Constructor Detail |
public AbstractEventData()
Method Detail |
public final void setTestCase(JFCTestCase testCase)
testCase
- The new value of the attributepublic final JFCTestCase getTestCase()
public abstract java.awt.Component getComponent()
Component
on which the event has
to be fired.
Component
public int getDefaultPosition()
public long getDefaultSleepTime()
public final java.awt.Point getLocationOnScreen()
public final boolean isMetaChar(int keyCode)
keyCode
- code to be checked.
public void setModifiers(int modifiers)
modifiers
- The new value of the attributepublic final int getModifiers()
public abstract int getDefaultModifiers()
public void setPosition(int position)
position
- The value of the attributepublic int getPosition()
public void setReferencePoint(java.awt.Point referencePoint)
referencePoint
- The value of the attributepublic java.awt.Point getReferencePoint()
public java.awt.Component getRoot()
Container
of the
current Component
.
Container
.public java.awt.Component getRoot(java.awt.Component c)
Container
of the
specified Component
.
c
- The Component
to obtain the root for.
Container
.public void setSleepTime(long sleepTime)
sleepTime
- The new value of the attributepublic long getSleepTime()
public abstract boolean consume(java.awt.AWTEvent ae)
Event
.
ae
- Event to be consumed.
public final void setValid(boolean valid)
valid
- true if the event has data configured.public final boolean isValid()
public boolean equals(java.lang.Object o)
o
- Object to be compared.
public int hashCode()
public void populate(org.w3c.dom.Element e)
e
- Element to be populated.public boolean prepareComponent()
Event
by calling requestFocus()
on the Component
and calculating the screen location.
Event
.public java.lang.String toString()
protected final void setLocationOnScreen(java.awt.Point screenLocation)
screenLocation
- screenLocation for event.protected boolean isValidForProcessing(java.awt.Component comp)
comp
- The Component
to be tested.
protected final java.awt.Point calculatePoint(java.awt.Rectangle rect)
Point
at which the events are to be fired based on the position
and reference-point specified.
rect
- The Rectangle
containing the
source component.
Point
at which the mouse
events have to be fired.protected boolean canConsume(java.awt.AWTEvent ae)
AWTEvent
.
ae
- Event to be consumed.
abstract java.lang.String getModifierText()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |