TopBlend: Here is the first difference. There are 14 differences. is old. is new.


javax.swing.plaf
Class ListUI


java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ListUI
Direct Known Subclasses:
BasicListUI , MultiListUI

public abstract class ListUI
extends ComponentUI

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.


Constructor Summary
ListUI ()
           
 
Method Summary
abstract   Rectangle getCellBounds ( JList
          Returns the bounding rectangle, in bounds of the given list's coordinate system, for the range of cells specified by the two indices. item in JList coordinates, null if index isn't valid.
abstract   Point indexToLocation ( JList
          Returns the origin in the given JList, of the specified item, item in the list's coordinate system. JList coordinates, null if index isn't valid.
abstract  int locationToIndex ( JList  list, Point
          Returns the cell index           Convert a point in the specified JList closest coordinates to the given location in closest index of the list's coordinate system. cell at that location.
 
Methods inherited from class javax.swing.plaf. ComponentUI
contains , createUI , getAccessibleChild , getAccessibleChildrenCount , getBaseline , getBaselineResizeBehavior , getMaximumSize , getMinimumSize , getPreferredSize , installUI , paint , uninstallUI , update
 
Methods inherited from class java.lang. Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

Constructor Detail

ListUI


public ListUI()
Method Detail

locationToIndex


public abstract int locationToIndex(JList list,
                                    Point location)
Returns the cell index in the specified JList closest to the given location in the list's coordinate system. To determine if the cell actually contains the specified location, compare the point against the cell's bounds, as provided by getCellBounds. This method returns -1 if the list's model is empty. Convert a point in 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.

Parameters:
list - the list
location - the coordinates of the point location - The JList relative coordinates of the cell
Returns:
the cell index closest to the given location, or -1
Throws:
NullPointerException - if location is null The index of the cell at location, or -1.

indexToLocation


public abstract Point indexToLocation(JList list,
                                      int index)
Returns the origin in the given JList, of the specified item, item in the list's coordinate system. Returns JList coordinates, null if the index isn't valid.

Parameters:
list - the list
index - the cell index index - The index of the JList cell.
Returns:
the origin of the cell, or null The origin of the index'th cell.

getCellBounds


public abstract Rectangle getCellBounds(JList list,
                                        int index1,
                                        int index2)
Returns the bounding rectangle, in the given list's coordinate system, for the range of cells specified by the two indices. The indices can be supplied in any order. Returns the bounds of the specified item in JList coordinates, null if index isn't valid.

If the smaller index is outside the list's range of cells, this method returns null. If the smaller index is valid, but the larger index is outside the list's range, the bounds of just the first index is returned. Otherwise, the bounds of the valid range is returned.

Parameters:
list - the list
index1 - the first index in the range
index2 - the second index in the range index - The index of the JList cell.
Returns:
the bounding rectangle for the range of cells, or null The bounds of the index'th cell.