1763 |
if ((event.getFirstRow() ==TableModelEvent.HEADER_ROW) |
if ((event.getFirstRow() ==TableModelEvent.HEADER_ROW) |
1764 |
&& autoCreateColumnsFromModel) |
&& autoCreateColumnsFromModel) |
1765 |
|
|
1766 |
createDefaultColumnsFromModel(); |
createDefaultColumnsFromModel(); |
1767 |
|
|
1768 |
// If the structure changes, we need to revalidate, since that might |
// If the structure changes, we need to revalidate, since that might |
1769 |
// affect the size parameters of the JTable. Otherwise we only need |
// affect the size parameters of the JTable. Otherwise we only need |
1796 |
{ |
{ |
1797 |
if (point != null) |
if (point != null) |
1798 |
{ |
{ |
|
int x0 = getLocation().x; |
|
1799 |
int ncols = getColumnCount(); |
int ncols = getColumnCount(); |
1800 |
Dimension gap = getIntercellSpacing(); |
Dimension gap = getIntercellSpacing(); |
1801 |
TableColumnModel cols = getColumnModel(); |
TableColumnModel cols = getColumnModel(); |
1825 |
{ |
{ |
1826 |
if (point != null) |
if (point != null) |
1827 |
{ |
{ |
|
int y0 = getLocation().y; |
|
1828 |
int nrows = getRowCount(); |
int nrows = getRowCount(); |
1829 |
int height = getRowHeight(); |
int height = getRowHeight(); |
1830 |
int y = point.y; |
int y = point.y; |
1982 |
} |
} |
1983 |
} |
} |
1984 |
|
|
|
|
|
|
|
|
1985 |
public TableCellRenderer getCellRenderer(int row, int column) |
public TableCellRenderer getCellRenderer(int row, int column) |
1986 |
{ |
{ |
1987 |
TableCellRenderer renderer = |
TableCellRenderer renderer = |
2034 |
int row, |
int row, |
2035 |
int column) |
int column) |
2036 |
{ |
{ |
2037 |
boolean rsa = getRowSelectionAllowed(); |
|
2038 |
boolean csa = getColumnSelectionAllowed(); |
boolean rowSelAllowed = getRowSelectionAllowed(); |
2039 |
boolean rs = rsa ? getSelectionModel().isSelectedIndex(row) : false; |
boolean colSelAllowed = getColumnSelectionAllowed(); |
2040 |
boolean cs = csa ? columnModel.getSelectionModel().isSelectedIndex(column) : false; |
boolean isSel = false; |
2041 |
boolean isSelected = ((rsa && csa && rs && cs) |
if (rowSelAllowed && colSelAllowed || !rowSelAllowed && !colSelAllowed) |
2042 |
|| (rsa && !csa && rs) |
isSel = isCellSelected(row, column); |
2043 |
|| (!rsa && csa && cs)); |
else |
2044 |
|
isSel = isRowSelected(row) && getRowSelectionAllowed() |
2045 |
|
|| isColumnSelected(column) && getColumnSelectionAllowed(); |
2046 |
|
|
2047 |
|
// Determine the focused cell. The focused cell is the cell at the |
2048 |
|
// leadSelectionIndices of the row and column selection model. |
2049 |
|
ListSelectionModel rowSel = getSelectionModel(); |
2050 |
|
ListSelectionModel colSel = getColumnModel().getSelectionModel(); |
2051 |
|
boolean hasFocus = hasFocus() && isEnabled() |
2052 |
|
&& rowSel.getLeadSelectionIndex() == row |
2053 |
|
&& colSel.getLeadSelectionIndex() == column; |
2054 |
|
|
2055 |
return renderer.getTableCellRendererComponent(this, |
return renderer.getTableCellRendererComponent(this, |
2056 |
dataModel.getValueAt(row, |
dataModel.getValueAt(row, |
2057 |
convertColumnIndexToModel(column)), |
convertColumnIndexToModel(column)), |
2058 |
isSelected, |
isSel, |
2059 |
false, // hasFocus |
hasFocus, |
2060 |
row, column); |
row, column); |
2061 |
} |
} |
2062 |
|
|
2222 |
int lo = lsm.getMinSelectionIndex(); |
int lo = lsm.getMinSelectionIndex(); |
2223 |
int hi = lsm.getMaxSelectionIndex(); |
int hi = lsm.getMaxSelectionIndex(); |
2224 |
int j = 0; |
int j = 0; |
|
java.util.ArrayList ls = new java.util.ArrayList(); |
|
2225 |
if (lo != -1 && hi != -1) |
if (lo != -1 && hi != -1) |
2226 |
{ |
{ |
2227 |
switch (lsm.getSelectionMode()) |
switch (lsm.getSelectionMode()) |