abbot.tester
Class ComponentTester

java.lang.Object
  extended byabbot.tester.Robot
      extended byabbot.tester.ComponentTester
Direct Known Subclasses:
ButtonTester, CheckboxTester, ChoiceTester, ContainerTester

public class ComponentTester
extends Robot

Provides basic programmatic operation of a Component. Also provides some useful assertions about properties of a Component.

Actions are generally user-driven actions such as menu selection, table selection, popup menus, etc. All actions should have the following signature:

public void actionWhat(Component c, ...);

It is essential that the argument is of type Component; if you use a more derived class then the actual invocation becomes ambiguous since method parsing doesn't attempt to determine which identically-named method is the most-derived. NOTE: All actions should ensure that the actions they trigger are finished or will be finished before subsequent operations before returning.

Assertions are either independent of any component (and should be implemented in this class), or take a component as the first argument, and perform some check on that component. All assertions should have one of the following signatures:

public boolean assertWhat(...);
public boolean assertWhat(Component c, ...);

Note that these assertions do not throw exceptions; normally these assertions will be wrapped by an abbot.script.Assert step if you want to cause a test failure, or you can manually throw the proper failure exception.

Property checks may also be implemented in cases where the component "property" might not be readily available or easily comparable, e.g. see JPopupMenuTester.getMenuLabels().

public Object getProperty(Component c);
public boolean isProperty(Component c);

Be careful not to name any support methods with the property signature, since these are scanned dynamically to populate the editor's action menus.

There are two sets of event-generating methods. The internal, protected methods inherited from abbot.tester.Robot are for normal programmatic use within derived Tester classes. No event queue synchronization should be performed except when modifying a component for which results are required for the action itself.

The public actionX functions are meant to be invoked from a script or directly from a hand-written test. These actions are distinguished by name, number of arguments, and by argument type. The actionX methods will be synchronized with the event dispatch thread when invoked, so you should only do synchronization with waitForIdle when you depend on the results of a particular event prior to sending the next one (e.g. scrolling a table cell into view before selecting it).

The ComponentLocation abstraction allows all derived tester classes to inherit click, popup menu, and drag variants without having to explicitly define new methods for component-specific substructures. The new class need only define the parseLocation(String) method, which should return a location specific to the component in question.

Derive from this class to implement actions and assertions specific to a given component class. Testers for any classes found in the JRE (i.e. in the java.awt or javax.swing packages) should be in the abbot.tester package. Extensions (testers for any Component subclasses not found in the JRE) must be in the abbot.tester.extensions package and be named the name of the Component subclass followed by "Tester". For example, the javax.swing.JButton tester class is abbot.tester.JButtonTester, and a tester for org.me.MyButton would be abbot.tester.extensions.MyButton.

Add-on tester classes should set the following system properties so that the actions provided by their tester can be properly displayed in the script editor. For an action "actionWiggle" provided by class abbot.tester.extensions.ExtendedTester, the following properties should be defined:

The simple class name is required for the args property to avoid collisions with other Testers which may have the same method.


Field Summary
 
Fields inherited from class abbot.tester.Robot
BUTTON_MASK, componentDelay, defaultDelay, DRAG_THRESHOLD, EM_AWT, EM_ROBOT, MENU_SHORTCUT_KEYCODE, MENU_SHORTCUT_MASK, MENU_SHORTCUT_MODIFIER, MENU_SHORTCUT_STRING, MULTI_CLICK_INTERVAL, POPUP_MASK, POPUP_MODIFIER, POPUP_ON_PRESS, popupDelay, TERTIARY_MASK, TERTIARY_MODIFIER
 
Constructor Summary
ComponentTester()
           
 
Method Summary
 void actionClick(Component comp)
          Click on the center of the component.
 void actionClick(Component c, ComponentLocation loc)
          Click on the component at the given location.
 void actionClick(Component c, ComponentLocation loc, int buttons)
          Click on the component at the given location with the given modifiers.
 void actionClick(Component c, ComponentLocation loc, int buttons, int count)
          Click on the component at the given location, with the given modifiers and click count.
 void actionClick(Component c, ComponentLocation loc, String buttons)
          Deprecated. Use actionClick(Component, ComponentLocation, int) instead
 void actionClick(Component c, ComponentLocation loc, String buttons, int count)
          Deprecated. Use actionClick(Component, ComponentLocation, int, int) instead
 void actionClick(Component comp, int x, int y)
          Click on the component at the given location.
 void actionClick(Component comp, int x, int y, int buttons)
          Click on the component at the given location.
 void actionClick(Component comp, int x, int y, int buttons, int count)
          Click on the component at the given location, specifying buttons and the number of clicks.
 void actionClick(Component comp, int x, int y, String buttons)
          Deprecated. Use actionClick(Component, ComponentLocation, int) instead.
 void actionClick(Component comp, int x, int y, String buttons, int count)
          Deprecated. Use actionClick(Component, ComponentLocation, int, int) instead
 void actionDelay(int ms)
          Delay the given number of ms.
 void actionDrag(Component dragSource)
          Perform a drag action.
 void actionDrag(Component dragSource, ComponentLocation loc)
          Perform a drag action.
 void actionDrag(Component dragSource, ComponentLocation loc, String modifiers)
          Perform a drag action with the given modifiers.
 void actionDrag(Component dragSource, int sx, int sy)
          Perform a drag action.
 void actionDrag(Component dragSource, int sx, int sy, String modifiers)
          Perform a drag action.
 void actionDrop(Component dropTarget)
          Perform a basic drop action (implicitly causing preceding mouse drag motion).
 void actionDrop(Component dropTarget, ComponentLocation loc)
          Perform a basic drop action (implicitly causing preceding mouse drag motion).
 void actionDrop(Component dropTarget, int x, int y)
          Perform a basic drop action (implicitly causing preceding mouse drag motion).
 void actionFocus(Component comp)
          Set the focus on to the given component.
 void actionKeyPress(Component comp, int keyCode)
          Send a key press event for the given virtual key code to the given Component.
 void actionKeyPress(Component comp, String kc)
          Deprecated. Use actionKeyPress(Component, int) instead.
 void actionKeyPress(int keyCode)
          Generate a key press event for the given virtual key code.
 void actionKeyPress(String kc)
          Deprecated. Use actionKeyPress(int) instead.
 void actionKeyRelease(Component comp, int keyCode)
          Generate a key release event sent to the given component.
 void actionKeyRelease(Component comp, String kc)
          Deprecated. Use actionKeyRelease(Component, int) instead.
 void actionKeyRelease(int keyCode)
          Generate a key release event.
 void actionKeyRelease(String kc)
          Deprecated. Use actionKeyRelease(int) instead.
 void actionKeyString(Component c, String string)
          Send events required to generate the given string on the given component.
 void actionKeyString(String string)
          Send events required to generate the given string.
 void actionKeyStroke(Component c, int keyCode)
          Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program.
 void actionKeyStroke(Component c, int keyCode, int modifiers)
          Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program.
 void actionKeyStroke(Component c, String code)
          Deprecated. Use actionKeyStroke(Component, int) instead.
 void actionKeyStroke(Component c, String code, String modifiers)
          Deprecated. Use actionKeyStroke(Component, int, int) instead.
 void actionKeyStroke(int keyCode)
          Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant.
 void actionKeyStroke(int keyCode, int modifiers)
          Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program.
 void actionKeyStroke(String code)
          Deprecated. Use actionKeyStroke(int) instead.
 void actionKeyStroke(String keyCode, String modifiers)
          Deprecated. Use actionKeyStroke(int, int) instead.
 void actionSelectAWTMenuItemByLabel(Frame frame, String label)
           
 void actionSelectAWTPopupMenuItemByLabel(Component invoker, String label)
           
 void actionSelectMenuItem(Component item)
          Select the given menu item.
 void actionSelectPopupMenuItem(Component invoker, ComponentLocation loc, String itemName)
          Pop up a menu at the given location on the given component and select the given item.
 void actionSelectPopupMenuItem(Component invoker, int x, int y, String itemName)
          Pop up a menu at the given coordinates on the given component and select the given item.
 void actionSelectPopupMenuItem(Component invoker, String itemName)
          Pop up a menu at the center of the given component and select the given item.
 void actionShowPopupMenu(Component invoker)
          Pop up a menu in the center of the given component.
 void actionShowPopupMenu(Component invoker, ComponentLocation loc)
          Pop up a menu in the center of the given component.
 void actionShowPopupMenu(Component invoker, int x, int y)
          Pop up a menu at the given location on the given component.
 void actionWaitForIdle()
          Wait for an idle AWT event queue.
 boolean assertComponentShowing(ComponentReference ref)
          Return whether the Component represented by the given ComponentReference is available.
 boolean assertFrameShowing(String id)
          Deprecated. This method does not provide sufficient context to reliably find a component.
 boolean assertImage(Component comp, File fileImage, boolean ignoreBorder)
          Return whether the component's contents matches the given image.
protected  String deriveAccessibleTag(AccessibleContext context)
          Derive a tag from the given accessible context if possible, or return null.
 String deriveTag(Component comp)
          Determine a component-specific identifier not already defined in other component attributes.
 Method[] getActions()
          Return a list of all actions defined by this class that don't depend on a component argument.
 Method[] getAssertMethods()
          Return a list of all assertions defined by this class that don't depend on a component argument.
 Method[] getComponentActions()
          Return a list of all actions defined by this class that require a component argument.
 Method[] getComponentAssertMethods()
          Return a list of all assertions defined by this class that require a component argument.
 ComponentLocation getLocation(Component c, Point where)
          Return a ComponentLocation for the given Point.
 Method[] getPropertyMethods()
          Return an array of all property check methods defined by this class.
static String getTag(Component comp)
          Return a reasonable identifier for the given component.
 Class getTestedClass(Class cls)
          Return the Component class that corresponds to this ComponentTester class.
static ComponentTester getTester(Class componentClass)
          Find the corresponding Tester object for the given component class, chaining up the inheritance tree if no specific tester is found for that class.
static ComponentTester getTester(Component comp)
          Return the appropriate Tester for the given object.
 boolean isExtension()
          Return whether this tester is an extension.
 ComponentLocation parseLocation(String encoded)
          Parse the String representation of a ComponentLocation into the actual ComponentLocation object.
static void setTester(Class forClass, ComponentTester tester)
          Establish the given ComponentTester as the one to use for the given class.
static String stripHTML(String str)
          Quick and dirty strip raw text from html, for getting the basic text from html-formatted labels and buttons.
protected  void waitAction(String desc, Condition cond)
          Wait for the given condition, throwing an ActionFailedException if it times out.
 void waitForComponentShowing(ComponentReference ref)
          Wait for the Component represented by the given ComponentReference to become available.
 void waitForFrameShowing(String identifier)
          Deprecated. This method does not provide sufficient context to reliably find a component.
 
Methods inherited from class abbot.tester.Robot
activate, canMoveWindows, canResizeWindows, capture, capture, capture, click, click, click, click, click, close, deiconify, delay, descriptiveClassName, drag, drag, dragOver, drop, findFocusOwner, fireAccessibleAction, focus, focus, getAutoDelay, getCanonicalClass, getCloseLocation, getEventID, getEventID, getEventMode, getEventModeDescription, getEventPostDelay, getEventQueue, getIconifyLocation, getKeyCode, getKeyCode, getKeyModifiers, getMaximizeLocation, getModifiers, getModifiers, getMouseModifiers, getMoveLocation, getPreferredRobotAutoDelay, getResizeLocation, hasFrameDeiconifyBug, hasHierarchyEventGenerationBug, hasKeyStrokeGenerationBug, hasMultiClickFrameBug, hasRobotMotionBug, iconify, invokeAction, invokeAction, invokeAndWait, invokeAndWait, isModifier, isReadyForInput, isTertiaryButton, jitter, jitter, key, key, keyCodeToMask, keyPress, keyRelease, keyString, keyStroke, maskToKeyCode, maximize, mouseMove, mouseMove, mousePress, mousePress, mousePress, mousePress, mousePress, mouseRelease, mouseRelease, move, moveBy, normalize, postEvent, reset, resize, resizeBy, sample, sample, selectAWTMenuItem, selectAWTMenuItemByLabel, selectAWTPopupMenuItem, selectAWTPopupMenuItemByLabel, selectMenuItem, sendEvent, setAutoDelay, setEventMode, setEventPostDelay, setModifiers, showPopupMenu, showPopupMenu, simpleClassName, sleep, toHierarchyPath, toString, toString, toString, userMovable, userResizable, useScreenMenuBar, wait, wait, wait, waitForIdle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentTester

public ComponentTester()
Method Detail

setTester

public static void setTester(Class forClass,
                             ComponentTester tester)
Establish the given ComponentTester as the one to use for the given class. This may be used to override the default tester for a given core class. Note that this will only work with components loaded by the framework class loader, not those loaded by the class loader for the code under test.


getTester

public static ComponentTester getTester(Component comp)
Return the appropriate Tester for the given object.


getTester

public static ComponentTester getTester(Class componentClass)
Find the corresponding Tester object for the given component class, chaining up the inheritance tree if no specific tester is found for that class.

The abbot tester package is searched first, followed by the tester extensions package.


isExtension

public final boolean isExtension()
Return whether this tester is an extension.


deriveAccessibleTag

protected String deriveAccessibleTag(AccessibleContext context)
Derive a tag from the given accessible context if possible, or return null.


getTag

public static String getTag(Component comp)
Return a reasonable identifier for the given component. Note that this should not duplicate information provided by existing attributes such as title, label, or text.


deriveTag

public String deriveTag(Component comp)
Determine a component-specific identifier not already defined in other component attributes.


actionWaitForIdle

public void actionWaitForIdle()
Wait for an idle AWT event queue. Will return when there are no more events on the event queue.


actionDelay

public void actionDelay(int ms)
Delay the given number of ms.


actionSelectAWTMenuItemByLabel

public void actionSelectAWTMenuItemByLabel(Frame frame,
                                           String label)

actionSelectAWTPopupMenuItemByLabel

public void actionSelectAWTPopupMenuItemByLabel(Component invoker,
                                                String label)

actionSelectMenuItem

public void actionSelectMenuItem(Component item)
Select the given menu item.


actionSelectPopupMenuItem

public void actionSelectPopupMenuItem(Component invoker,
                                      String itemName)
Pop up a menu at the center of the given component and select the given item.


actionSelectPopupMenuItem

public void actionSelectPopupMenuItem(Component invoker,
                                      ComponentLocation loc,
                                      String itemName)
Pop up a menu at the given location on the given component and select the given item.


actionSelectPopupMenuItem

public void actionSelectPopupMenuItem(Component invoker,
                                      int x,
                                      int y,
                                      String itemName)
Pop up a menu at the given coordinates on the given component and select the given item.


actionShowPopupMenu

public void actionShowPopupMenu(Component invoker)
Pop up a menu in the center of the given component.


actionShowPopupMenu

public void actionShowPopupMenu(Component invoker,
                                ComponentLocation loc)
Pop up a menu in the center of the given component.


actionShowPopupMenu

public void actionShowPopupMenu(Component invoker,
                                int x,
                                int y)
Pop up a menu at the given location on the given component.


actionClick

public void actionClick(Component comp)
Click on the center of the component.


actionClick

public void actionClick(Component c,
                        ComponentLocation loc)
Click on the component at the given location.


actionClick

public void actionClick(Component c,
                        ComponentLocation loc,
                        int buttons)
Click on the component at the given location with the given modifiers.


actionClick

public void actionClick(Component c,
                        ComponentLocation loc,
                        int buttons,
                        int count)
Click on the component at the given location, with the given modifiers and click count.


actionClick

public void actionClick(Component comp,
                        int x,
                        int y)
Click on the component at the given location.


actionClick

public void actionClick(Component comp,
                        int x,
                        int y,
                        int buttons)
Click on the component at the given location. The buttons mask should be the InputEvent masks for the desired button, e.g. InputEvent.BUTTON1_MASK. ComponentTester also defines POPUP_MASK and TERTIARY_MASK for platform-independent masks for those buttons.


actionClick

public void actionClick(Component comp,
                        int x,
                        int y,
                        int buttons,
                        int count)
Click on the component at the given location, specifying buttons and the number of clicks. The buttons mask should be the InputEvent mask for the desired button, e.g. InputEvent.BUTTON1_MASK. ComponentTester also defines POPUP_MASK and TERTIARY_MASK for platform-independent masks for those buttons.


actionClick

public void actionClick(Component c,
                        ComponentLocation loc,
                        String buttons)
Deprecated. Use actionClick(Component, ComponentLocation, int) instead

Click on the component at the given location, with the given modifiers.


actionClick

public void actionClick(Component c,
                        ComponentLocation loc,
                        String buttons,
                        int count)
Deprecated. Use actionClick(Component, ComponentLocation, int, int) instead

Click on the component at the given location, with the given modifiers and click count.


actionClick

public void actionClick(Component comp,
                        int x,
                        int y,
                        String buttons)
Deprecated. Use actionClick(Component, ComponentLocation, int) instead.

Click on the component at the given location. The buttons string should be the InputEvent field name for the desired masks, e.g. BUTTON1_MASK. The special names POPUP_MASK, and TERTIARY_MASK are also available.


actionClick

public void actionClick(Component comp,
                        int x,
                        int y,
                        String buttons,
                        int count)
Deprecated. Use actionClick(Component, ComponentLocation, int, int) instead

Click on the component at the given location. The buttons string should be the InputEvent field name for the desired masks, e.g. BUTTON1_MASK. The special names POPUP_MASK, and TERTIARY_MASK are also available. This variation provides for multiple clicks.


actionKeyPress

public void actionKeyPress(Component comp,
                           String kc)
Deprecated. Use actionKeyPress(Component, int) instead.

Used only for modifier keys. Use actionKeyStroke for non-modifier keys.

See Also:
actionKeyPress(Component, int)

actionKeyPress

public void actionKeyPress(Component comp,
                           int keyCode)
Send a key press event for the given virtual key code to the given Component.


actionKeyPress

public void actionKeyPress(String kc)
Deprecated. Use actionKeyPress(int) instead.

See Also:
actionKeyPress(int)

actionKeyPress

public void actionKeyPress(int keyCode)
Generate a key press event for the given virtual key code.


actionKeyRelease

public void actionKeyRelease(Component comp,
                             String kc)
Deprecated. Use actionKeyRelease(Component, int) instead.

See Also:
actionKeyRelease(Component, int)

actionKeyRelease

public void actionKeyRelease(Component comp,
                             int keyCode)
Generate a key release event sent to the given component.


actionKeyRelease

public void actionKeyRelease(String kc)
Deprecated. Use actionKeyRelease(int) instead.

See Also:
actionKeyRelease(int)

actionKeyRelease

public void actionKeyRelease(int keyCode)
Generate a key release event.


actionKeyStroke

public void actionKeyStroke(Component c,
                            String code)
Deprecated. Use actionKeyStroke(Component, int) instead.

See Also:
actionKeyStroke(Component, int)

actionKeyStroke

public void actionKeyStroke(Component c,
                            int keyCode)
Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program. Sends a key down/up, with no modifiers. The focus is changed to the target component.


actionKeyStroke

public void actionKeyStroke(String code)
Deprecated. Use actionKeyStroke(int) instead.

See Also:
actionKeyStroke(int)

actionKeyStroke

public void actionKeyStroke(int keyCode)
Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant. Sends a key press and key release, with no modifiers. Note that this method does not affect the current focus.


actionKeyStroke

public void actionKeyStroke(Component c,
                            String code,
                            String modifiers)
Deprecated. Use actionKeyStroke(Component, int, int) instead.

See Also:
actionKeyStroke(Component, int, int)

actionKeyStroke

public void actionKeyStroke(Component c,
                            int keyCode,
                            int modifiers)
Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program. Sends a key down/up, with the given modifiers, which should be the InputEvent field name modifier masks optionally ORed together with "|". The focus is changed to the target component.


actionKeyStroke

public void actionKeyStroke(String keyCode,
                            String modifiers)
Deprecated. Use actionKeyStroke(int, int) instead.

See Also:
actionKeyStroke(int, int)

actionKeyStroke

public void actionKeyStroke(int keyCode,
                            int modifiers)
Send the given keystroke, which must be the KeyEvent field name of a KeyEvent VK_ constant to the program. Sends a key down/up, with the given modifiers, which should be the InputEvent field name modifier masks optionally ORed together with "|". Note that this does not affect the current focus.


actionKeyString

public void actionKeyString(Component c,
                            String string)
Send events required to generate the given string on the given component. This version is preferred over actionKeyString(String).


actionKeyString

public void actionKeyString(String string)
Send events required to generate the given string.


actionFocus

public void actionFocus(Component comp)
Set the focus on to the given component.


actionDrag

public void actionDrag(Component dragSource,
                       ComponentLocation loc)
Perform a drag action. Derived classes may provide more specific identifiers for what is being dragged simply by deriving a new class from ComponentLocation which identifies the appropriate substructure.


actionDrag

public void actionDrag(Component dragSource)
Perform a drag action. Grabs the center of the given component.


actionDrag

public void actionDrag(Component dragSource,
                       ComponentLocation loc,
                       String modifiers)
Perform a drag action with the given modifiers.


actionDrag

public void actionDrag(Component dragSource,
                       int sx,
                       int sy)
Perform a drag action. Grabs at the given location.


actionDrag

public void actionDrag(Component dragSource,
                       int sx,
                       int sy,
                       String modifiers)
Perform a drag action. Grabs at the given location with the given modifiers.


actionDrop

public void actionDrop(Component dropTarget)
Perform a basic drop action (implicitly causing preceding mouse drag motion). Drops in the center of the component.


actionDrop

public void actionDrop(Component dropTarget,
                       ComponentLocation loc)
Perform a basic drop action (implicitly causing preceding mouse drag motion).


actionDrop

public void actionDrop(Component dropTarget,
                       int x,
                       int y)
Perform a basic drop action (implicitly causing preceding mouse drag motion). The modifiers represents the set of active modifiers when the drop is made.


assertImage

public boolean assertImage(Component comp,
                           File fileImage,
                           boolean ignoreBorder)
Return whether the component's contents matches the given image.


assertFrameShowing

public boolean assertFrameShowing(String id)
Deprecated. This method does not provide sufficient context to reliably find a component.

Returns whether a Window corresponding to the given String is showing. The string may be a plain String or regular expression and may match either the window title (for Frames or Dialogs) or its Component name.

See Also:
ComponentTestFixture.isShowing(String)

waitForFrameShowing

public void waitForFrameShowing(String identifier)
Deprecated. This method does not provide sufficient context to reliably find a component.

Convenience wait for a window to be displayed. The given string may be a plain String or regular expression and may match either the window title (for Frames and Dialogs) or its Component name. This method is provided as a convenience for hand-coded tests, since scripts will use a wait step instead.

The property abbot.robot.component_delay affects the default timeout.

See Also:
ComponentTestFixture.isShowing(String)

assertComponentShowing

public boolean assertComponentShowing(ComponentReference ref)
Return whether the Component represented by the given ComponentReference is available.


waitForComponentShowing

public void waitForComponentShowing(ComponentReference ref)
Wait for the Component represented by the given ComponentReference to become available. The timeout is affected by abbot.robot.component_delay, which defaults to 30s.


getActions

public Method[] getActions()
Return a list of all actions defined by this class that don't depend on a component argument.


getComponentActions

public Method[] getComponentActions()
Return a list of all actions defined by this class that require a component argument.


getPropertyMethods

public Method[] getPropertyMethods()
Return an array of all property check methods defined by this class. The first argument must be a Component.


getAssertMethods

public Method[] getAssertMethods()
Return a list of all assertions defined by this class that don't depend on a component argument.


getComponentAssertMethods

public Method[] getComponentAssertMethods()
Return a list of all assertions defined by this class that require a component argument.


stripHTML

public static String stripHTML(String str)
Quick and dirty strip raw text from html, for getting the basic text from html-formatted labels and buttons. Behavior is undefined for badly formatted html.


waitAction

protected void waitAction(String desc,
                          Condition cond)
                   throws ActionFailedException
Wait for the given condition, throwing an ActionFailedException if it times out.

Throws:
ActionFailedException

getTestedClass

public Class getTestedClass(Class cls)
Return the Component class that corresponds to this ComponentTester class. For example, JComponentTester.getTestedClass(JLabel.class) would return JComponent.class.


parseLocation

public ComponentLocation parseLocation(String encoded)
Parse the String representation of a ComponentLocation into the actual ComponentLocation object.


getLocation

public ComponentLocation getLocation(Component c,
                                     Point where)
Return a ComponentLocation for the given Point. Derived classes may provide something more suitable than an (x, y) coordinate. A JTree, for example, might provide a JTreeLocation indicating a path or row in the tree.



Copyright © 2002-2004 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge