abbot.tester
Class JListLocation

java.lang.Object
  extended by abbot.tester.ComponentLocation
      extended by abbot.tester.JListLocation

public class JListLocation
extends ComponentLocation

Provides encapsulation of the location of a row on a JList (a coordinate, item index or value).


Field Summary
 
Fields inherited from class abbot.tester.ComponentLocation
CENTER
 
Constructor Summary
JListLocation()
          The center of the target list.
JListLocation(int row)
          Specify location by row in the list.
JListLocation(Object value)
          Specify location by explicit reference to an object.
JListLocation(Point where)
          Specify a location by component-relative coordinate.
JListLocation(String value)
          Specify location by string representation of an object.
 
Method Summary
protected  String badFormat(String encoded)
           
 boolean equals(Object o)
          Returns whether the given object is an equivalent ComponentLocation.
 Rectangle getBounds(Component c)
          Convert the abstract location into a concrete area, relative to the given Component.
 int getIndex(JList list)
           
 Point getPoint(Component c)
          Return a concrete point for the abstract location.
protected  Point indexToPoint(JList list, int index)
          Convert the given index into a coordinate.
 ComponentLocation parse(String encoded)
          Convert the given encoding into the proper location.
 String toString()
           
 
Methods inherited from class abbot.tester.ComponentLocation
encodeIndex, encodeValue, isIndex, isValue, parseIndex, parseValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JListLocation

public JListLocation()
The center of the target list.


JListLocation

public JListLocation(Object value)
Specify location by explicit reference to an object.


JListLocation

public JListLocation(String value)
Specify location by string representation of an object.

See Also:
JListTester.valueToString(javax.swing.JList, int)

JListLocation

public JListLocation(int row)
Specify location by row in the list.


JListLocation

public JListLocation(Point where)
Specify a location by component-relative coordinate.

Method Detail

badFormat

protected String badFormat(String encoded)
Overrides:
badFormat in class ComponentLocation

indexToPoint

protected Point indexToPoint(JList list,
                             int index)
Convert the given index into a coordinate.


getIndex

public int getIndex(JList list)

getPoint

public Point getPoint(Component c)
Return a concrete point for the abstract location.

Overrides:
getPoint in class ComponentLocation

getBounds

public Rectangle getBounds(Component c)
Description copied from class: ComponentLocation
Convert the abstract location into a concrete area, relative to the given Component. If a point has been specified, returns a 1x1 rectangle, otherwise returns the a rectangle at (0, 0) of the Component's size.

Overrides:
getBounds in class ComponentLocation

equals

public boolean equals(Object o)
Description copied from class: ComponentLocation
Returns whether the given object is an equivalent ComponentLocation.

Overrides:
equals in class ComponentLocation

toString

public String toString()
Overrides:
toString in class ComponentLocation

parse

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

Overrides:
parse in class ComponentLocation


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

SourceForge