int y = mLayout.getColumnStart(col);
int rowCount = mModel.getRowCount(col);
for (int row = 0; row < rowCount; row++) {
// Get the program
ProgramPanel panel = mModel.getProgramPanel(col, row);
// Render the program
if (panel != null) {
int cellHeight = panel.getHeight();
// Check whether the cell is within the clipping area
if (((y + cellHeight) > clipBounds.y)
&& (y < (clipBounds.y + clipBounds.height))) {
Rectangle rec = new Rectangle(x, y, mColumnWidth, cellHeight);
if (Settings.propProgramTableMouseOver.getBoolean()) {
if ((mMouse != null) && (rec.contains(mMouse))) {
mouseOver = true;
} else {
mouseOver = false;
}
}
// calculate clipping intersection between global clip border and current cell rectangle
Shape oldClip = grp.getClip();
rec = rec.intersection((Rectangle)oldClip);
// Paint the cell
if (rec.width > 0 || rec.height > 0) {
grp.setClip(rec);
grp.translate(x, y);
panel.setSize(mColumnWidth, cellHeight);
panel.paint(mouseOver,(row == mCurrentRow && col == mCurrentCol), grp);
grp.translate(-x, -y);
grp.setClip(oldClip);
}
}