/* BasicListUI.java --
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
package javax.swing.plaf.basic;
+import gnu.classpath.NotImplementedException;
+
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
int index1 = e.getFirstIndex();
int index2 = e.getLastIndex();
Rectangle damaged = getCellBounds(list, index1, index2);
- list.repaint(damaged);
+ if (damaged != null)
+ list.repaint(damaged);
}
}
* @param index2 The last row to incude in the bounds
*
* @return A rectangle encompassing the range of rows between
- * <code>index1</code> and <code>index2</code> inclusive
+ * <code>index1</code> and <code>index2</code> inclusive, or null
+ * such a rectangle couldn't be calculated for the given indexes.
*/
public Rectangle getCellBounds(JList l, int index1, int index2)
{
* Uninstalls keyboard actions for this UI in the {@link JList}.
*/
protected void uninstallKeyboardActions()
+ throws NotImplementedException
{
// TODO: Implement this properly.
}
for (int row = startIndex; row <= endIndex; ++row)
{
Rectangle bounds = getCellBounds(list, row, row);
- if (bounds.intersects(clip))
+ if (bounds != null && bounds.intersects(clip))
paintCell(g, row, bounds, render, model, sel, lead);
}
}