/[classpath]/classpath/javax/swing/plaf/basic/BasicTableUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicTableUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37 by rabbit78, Tue Nov 15 20:32:46 2005 UTC revision 1.38 by rabbit78, Mon Nov 21 13:18:29 2005 UTC
# Line 1193  public class BasicTableUI extends TableU Line 1193  public class BasicTableUI extends TableU
1193                   TableCellRenderer rend, TableModel data,                   TableCellRenderer rend, TableModel data,
1194                   int rowLead, int colLead)                   int rowLead, int colLead)
1195    {    {
1196      boolean rowSelAllowed = table.getRowSelectionAllowed();      Component comp = table.prepareRenderer(rend, row, col);
     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);  
       
1197      rendererPane.paintComponent(g, comp, table, bounds);      rendererPane.paintComponent(g, comp, table, bounds);
1198        
1199      // FIXME: this is manual painting of the Caret, why doesn't the      // FIXME: this is manual painting of the Caret, why doesn't the
1200      // JTextField take care of this itself?      // JTextField take care of this itself?
1201      if (comp instanceof JTextField)      if (comp instanceof JTextField)
# Line 1263  public class BasicTableUI extends TableU Line 1243  public class BasicTableUI extends TableU
1243                                               width - gap.width + 1,                                               width - gap.width + 1,
1244                                               height - gap.height);                                               height - gap.height);
1245              if (bounds.intersects(clip))              if (bounds.intersects(clip))
1246                {                                                                    {          
1247                  paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c),                  paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c),
1248                            table.getModel(),                            table.getModel(),
1249                            table.getSelectionModel().getLeadSelectionIndex(),                            table.getSelectionModel().getLeadSelectionIndex(),
# Line 1286  public class BasicTableUI extends TableU Line 1266  public class BasicTableUI extends TableU
1266          x = x0;          x = x0;
1267          Color save = gfx.getColor();          Color save = gfx.getColor();
1268          gfx.setColor(grid);          gfx.setColor(grid);
         boolean paintedLine = false;  
1269          for (int c = 0; c < ncols && x < xmax; ++c)          for (int c = 0; c < ncols && x < xmax; ++c)
1270            {            {
1271              x += cols.getColumn(c).getWidth();              x += cols.getColumn(c).getWidth();
1272              gfx.drawLine(x, y0, x, ymax);              gfx.drawLine(x, y0, x, ymax);
             paintedLine = true;  
1273            }            }
1274          gfx.setColor(save);          gfx.setColor(save);
1275        }        }
# Line 1302  public class BasicTableUI extends TableU Line 1280  public class BasicTableUI extends TableU
1280          y = y0;          y = y0;
1281          Color save = gfx.getColor();          Color save = gfx.getColor();
1282          gfx.setColor(grid);          gfx.setColor(grid);
         boolean paintedLine = false;  
1283          for (int r = 0; r < nrows && y < ymax; ++r)          for (int r = 0; r < nrows && y < ymax; ++r)
1284            {            {
1285              y += height;              y += height;
1286              gfx.drawLine(x0, y, xmax, y);              gfx.drawLine(x0, y, xmax, y);
             paintedLine = true;  
1287            }            }
1288          gfx.setColor(save);          gfx.setColor(save);
1289        }        }

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26