abbot.tester
Class ComponentLocation

java.lang.Object
  extended byabbot.tester.ComponentLocation
Direct Known Subclasses:
JListLocation, JTabbedPaneLocation, JTableHeaderLocation, JTableLocation, JTreeLocation, ListLocation

public class ComponentLocation
extends Object

Provides encapsulation of a visible Component-relative location. Hides the specifics location so that ComponentTester primitives (actionClick, actionShowPopup, etc) may be directed to specific elements of substructure on a Component (list rows, tree paths, table cells, substructure values, etc.). "Visible" in this context means currently accessible by the pointer (possibly via scrolling). A hidden node in a collapsed tree path would not be considered visible.

By convention, Point locations are specified with (x,y) notation. Indexed locations should use square brackets, e.g. [i] or [r,c] and value locations should use a quoted String, e.g. '"my value"'. Recorders should use the String value by default for consistency.

See Also:
JListLocation, JTreeLocation, JTableLocation

Constructor Summary
ComponentLocation()
          Create a simple location which represents the center of a component.
ComponentLocation(Point where)
          Create a simple location.
 
Method Summary
protected  String badFormat(String encoded)
           
 boolean equals(Object o)
           
 Rectangle getBounds(Component c)
          Convert the abstract location into a concrete area.
 Point getPoint(Component c)
          Convert the abstract location into a concrete one.
 ComponentLocation parse(String encoded)
          Convert the given encoding into the proper location.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentLocation

public ComponentLocation()
Create a simple location which represents the center of a component.


ComponentLocation

public ComponentLocation(Point where)
Create a simple location.

Method Detail

getPoint

public Point getPoint(Component c)
               throws LocationUnavailableException
Convert the abstract location into a concrete one.

Throws:
LocationUnavailableException

getBounds

public Rectangle getBounds(Component c)
                    throws LocationUnavailableException
Convert the abstract location into a concrete area. If a point has been specified, returns a 1x1 rectangle, otherwise returns the a rectangle at (0, 0) of the Component's size.

Throws:
LocationUnavailableException

equals

public boolean equals(Object o)

toString

public String toString()

badFormat

protected String badFormat(String encoded)

parse

public ComponentLocation parse(String encoded)
Convert the given encoding into the proper location. Allowed formats: (x, y)



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

SourceForge