continue;
int pos[] = getRowColumnForIndex(index);
int xpos = convertColumnToX(pos[1]);
int ypos = convertRowToY(pos[0]);
IconElement element = (IconElement) model.getElementAt(index);
ImageIcon icon = element.getIcon();
String name = element.getText();
int stringWidth = metrics.stringWidth(name);
int iconHeight = icon.getIconHeight();
int spacing = view.getIconTextSpacing();
int center = ycell / 2 - (textHeight + iconHeight + spacing) / 2;
if (stringWidth > xcell) {
while (stringWidth > xcell) {
name = name.substring(0, name.length() - 1);
stringWidth = metrics.stringWidth(name + "..");
}
name += "..";
}
g.drawImage(icon.getImage(), xpos + (xcell - icon.getIconWidth()) / 2, ypos + center, null);
if (view.getSelectedIndex() == index) {
if (view.hasFocus()) {
g2.setColor(Color.darkGray);
g2.setStroke(
new BasicStroke(
1.0f,
BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER,
1.0f,
new float[] { 1.0f },
0.0f));
g2.draw(
new Rectangle2D.Double(
xpos + (xcell - icon.getIconWidth()) / 2 - 1,
ypos + center - 2,
icon.getIconWidth() + 2,
iconHeight + 2));
g.setColor(MetalLookAndFeel.getTextHighlightColor());
} else {
g.setColor(MetalLookAndFeel.getControlDisabled());
}