1065 |
Rectangle bounds = new Rectangle(x, y, width, height); |
Rectangle bounds = new Rectangle(x, y, width, height); |
1066 |
if (bounds.intersects(clip)) |
if (bounds.intersects(clip)) |
1067 |
{ |
{ |
1068 |
|
// FIXME: Handle cell painting via CellRendererPane! |
1069 |
TableCellRenderer rend = table.getCellRenderer(r, c); |
TableCellRenderer rend = table.getCellRenderer(r, c); |
1070 |
Component comp = table.prepareRenderer(rend, r, c); |
Component comp = table.prepareRenderer(rend, r, c); |
1071 |
|
Rectangle oldClip = gfx.getClipBounds(); |
1072 |
gfx.translate(x, y); |
gfx.translate(x, y); |
1073 |
|
gfx.setClip(0, 0, width, height); |
1074 |
comp.setBounds(new Rectangle(0, 0, width, height)); |
comp.setBounds(new Rectangle(0, 0, width, height)); |
1075 |
// Set correct border on cell renderer. |
// Set correct border on cell renderer. |
1076 |
// Only the lead selection cell gets a border |
// Only the lead selection cell gets a border |
1087 |
if (comp instanceof JTextField) |
if (comp instanceof JTextField) |
1088 |
((JTextField)comp).getCaret().paint(gfx); |
((JTextField)comp).getCaret().paint(gfx); |
1089 |
gfx.translate(-x, -y); |
gfx.translate(-x, -y); |
1090 |
|
gfx.setClip(oldClip); |
1091 |
} |
} |
1092 |
y += height; |
y += height; |
1093 |
} |
} |