Hi, On Wed, 2006-01-04 at 21:40 +0000, Roman Kennke wrote: > 2006-01-04 Roman Kennke <[EMAIL PROTECTED]> > > * javax/swing/plaf/basic/BasicListUI.java > (locationToIndex): Added FIXME about getVisibleRowCount() usage. > Adjusted iteration to not use visibleRowCount and instead iterate > over the real number of elements in cellHeights. > (indexToLocation): Added FIXME about getVisibleRowCount() usage. > Adjusted iteration to not use visibleRowCount and instead iterate > over the real number of elements in cellHeights. > [...] @@ -1189,6 +1189,9 @@ break; case JList.HORIZONTAL_WRAP: // determine visible rows and cells per row + // FIXME: We really should not use getVisibleRowCount() here. Please + // refer to the (Sun) API docs of JList.setVisibleRowCount() for + // details. int visibleRows = list.getVisibleRowCount(); int cellsPerRow = -1; int numberOfItems = list.getModel().getSize();
That is a bit obscure comment. I think you refer to the fact that getVisibleRowCount() doesn't give the actual visible rows, but only the preferred number of rows. We do document that, but only as part of the property, which isn't visible in the public docs since it is package private: /** * This property indicates a <em>preference</em> for the number of rows * displayed in the list, and will scale the * [EMAIL PROTECTED] #getPreferredScrollableViewportSize} property accordingly. The actual * number of displayed rows, when the list is placed in a real [EMAIL PROTECTED] * JViewport} or other component, may be greater or less than this number. */ int visibleRowCount; We probably should move this documentation to the getter and setter method or the class documentation to more prominently explain this. BTW, what is the correct fix? You could get the viewPort and try to deduce the number of rows from that I guess. Cheers, Mark
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches