summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java')
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java30
1 files changed, 3 insertions, 27 deletions
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java
index 015443946d7..18b69120d11 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java
@@ -1193,29 +1193,9 @@ public class BasicTableUI extends TableUI
TableCellRenderer rend, TableModel data,
int rowLead, int colLead)
{
- boolean rowSelAllowed = table.getRowSelectionAllowed();
- boolean colSelAllowed = table.getColumnSelectionAllowed();
- boolean isSel = false;
- if (rowSelAllowed && colSelAllowed || !rowSelAllowed && !colSelAllowed)
- isSel = table.isCellSelected(row, col);
- else
- isSel = table.isRowSelected(row) && table.getRowSelectionAllowed()
- || table.isColumnSelected(col) && table.getColumnSelectionAllowed();
-
- // Determine the focused cell. The focused cell is the cell at the
- // leadSelectionIndices of the row and column selection model.
- ListSelectionModel rowSel = table.getSelectionModel();
- ListSelectionModel colSel = table.getColumnModel().getSelectionModel();
- boolean hasFocus = table.hasFocus() && table.isEnabled()
- && rowSel.getLeadSelectionIndex() == row
- && colSel.getLeadSelectionIndex() == col;
-
- Component comp = rend.getTableCellRendererComponent(table,
- data.getValueAt(row, col),
- isSel, hasFocus, row, col);
-
+ Component comp = table.prepareRenderer(rend, row, col);
rendererPane.paintComponent(g, comp, table, bounds);
-
+
// FIXME: this is manual painting of the Caret, why doesn't the
// JTextField take care of this itself?
if (comp instanceof JTextField)
@@ -1263,7 +1243,7 @@ public class BasicTableUI extends TableUI
width - gap.width + 1,
height - gap.height);
if (bounds.intersects(clip))
- {
+ {
paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c),
table.getModel(),
table.getSelectionModel().getLeadSelectionIndex(),
@@ -1286,12 +1266,10 @@ public class BasicTableUI extends TableUI
x = x0;
Color save = gfx.getColor();
gfx.setColor(grid);
- boolean paintedLine = false;
for (int c = 0; c < ncols && x < xmax; ++c)
{
x += cols.getColumn(c).getWidth();
gfx.drawLine(x, y0, x, ymax);
- paintedLine = true;
}
gfx.setColor(save);
}
@@ -1302,12 +1280,10 @@ public class BasicTableUI extends TableUI
y = y0;
Color save = gfx.getColor();
gfx.setColor(grid);
- boolean paintedLine = false;
for (int r = 0; r < nrows && y < ymax; ++r)
{
y += height;
gfx.drawLine(x0, y, xmax, y);
- paintedLine = true;
}
gfx.setColor(save);
}
OpenPOWER on IntegriCloud