|
JSR-209 (Final Approval Ballot) | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The JList pluggable look and feel delegate. This interface adds methods that allow the JList component to map locations, e.g. mouse coordinates, to list cells and from cell indices to the bounds of the cell.
Method Summary | |
Rectangle |
getCellBounds(JList list,
int index0,
int index1)
Returns the bounds of the specified item in JList coordinates, null if index isn't valid. |
Point |
indexToLocation(JList list,
int index)
Returns the origin of the specified item in JList coordinates, null if index isn't valid. |
int |
locationToIndex(JList list,
Point location)
Convert a point in JList coordinates to the closest index
of the cell at that location. |
Method Detail |
public int locationToIndex(JList list, Point location)
JList
coordinates to the closest index
of the cell at that location. To determine if the cell actually
contains the specified location use a combination of this method and
getCellBounds
. Returns -1 if the model is empty.
location
- The JList relative coordinates of the cell
public Point indexToLocation(JList list, int index)
index
- The index of the JList cell.
public Rectangle getCellBounds(JList list, int index0, int index1)
index0
- - the index of the first JList cell in the rangeindex1
- - the index of the last JList cell in the range
|
JSR-209 (Final Approval Ballot) | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |