columnWidth, height - 1);
dataRenderer.paint(rendererGraphics);
rendererGraphics.dispose();
// Draw the sort image
Image sortImage = null;
SortDirection sortDirection = column.getSortDirection();
if (sortDirection != null) {
switch (sortDirection) {
case ASCENDING: {
sortImage = sortAscendingImage;
break;
}
case DESCENDING: {
sortImage = sortDescendingImage;
break;
}
}
}
if (sortImage != null) {
int sortImageMargin = sortImage.getWidth()
+ SORT_INDICATOR_PADDING * 2;
if (columnWidth >= dataRenderer.getPreferredWidth(-1) + sortImageMargin) {
Graphics2D sortImageGraphics = (Graphics2D)graphics.create();
sortImageGraphics.translate(cellX + columnWidth - sortImageMargin,
(height - sortImage.getHeight()) / 2);
sortImage.paint(sortImageGraphics);
sortImageGraphics.dispose();
}
}
// Draw the divider