public boolean render(final GC g2, final Rectangle dataArea,
final int index, final PlotRenderingInfo info) {
boolean foundData = false;
final CategoryDataset currentDataset = this.getDataset(index);
final CategoryItemRenderer renderer = this.getRenderer(index);
final CategoryAxis domainAxis = this.getDomainAxisForDataset(index);
final ValueAxis rangeAxis = this.getRangeAxisForDataset(index);
final boolean hasData = !DatasetUtilities.isEmptyOrNull(currentDataset);
if (hasData && (renderer != null)) {
foundData = true;
final CategoryItemRendererState state = renderer.initialise(g2,
dataArea, this, index, info);
final int columnCount = currentDataset.getColumnCount();
final int rowCount = currentDataset.getRowCount();
final int passCount = renderer.getPassCount();
for (int pass = 0; pass < passCount; pass++) {
if (this.columnRenderingOrder == SortOrder.ASCENDING) {
for (int column = 0; column < columnCount; column++) {
if (this.rowRenderingOrder == SortOrder.ASCENDING) {
for (int row = 0; row < rowCount; row++) {
renderer.drawItem(g2, state, dataArea, this,
domainAxis, rangeAxis, currentDataset,
row, column, pass);
}
} else {
for (int row = rowCount - 1; row >= 0; row--) {
renderer.drawItem(g2, state, dataArea, this,
domainAxis, rangeAxis, currentDataset,
row, column, pass);
}
}
}
} else {
for (int column = columnCount - 1; column >= 0; column--) {
if (this.rowRenderingOrder == SortOrder.ASCENDING) {
for (int row = 0; row < rowCount; row++) {
renderer.drawItem(g2, state, dataArea, this,
domainAxis, rangeAxis, currentDataset,
row, column, pass);
}
} else {
for (int row = rowCount - 1; row >= 0; row--) {
renderer.drawItem(g2, state, dataArea, this,
domainAxis, rangeAxis, currentDataset,
row, column, pass);
}
}
}