-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
6
-
generic
-
generic
Javadoc of JTable.tableChanged(TableModelEvent e) says:
* The <code>TableModelEvent</code> should be constructed in the
* coordinate system of the model; the appropriate mapping to the
* view coordinate system is performed by this <code>JTable</code>
* when it receives the event.
But this is not true! The column is correctly converted:
int modelColumn = e.getColumn();
...
int column = convertColumnIndexToView(modelColumn);
...
but the rows are not converted at all:
int start = e.getFirstRow();
int end = e.getLastRow();
...
dirtyRegion = getCellRect(start, column, false);
...
Reopening.
It's true that in the middle of some long description there is some complicated text that tells us that you have to convert the row indexes to be in terms of the view.
But the Javadoc of tableChanged(TableModelEvent e) is clear:
"* The <code>TableModelEvent</code> should be constructed in the
* coordinate system of the model; the appropriate mapping to the
* view coordinate system is performed by this <code>JTable</code>
* when it receives the event."
This implies a false assumption that tableChanged() method needs to have the row from the *model* (coordinate system of the model).
Since the behavior can not be changed because of compatibility, the Javadoc should be corrected to explicitly say that the column should be in the coordinate system of the model and the row in the coordinate system of the view.
Do we want to help developers to use our APIs or not?
* The <code>TableModelEvent</code> should be constructed in the
* coordinate system of the model; the appropriate mapping to the
* view coordinate system is performed by this <code>JTable</code>
* when it receives the event.
But this is not true! The column is correctly converted:
int modelColumn = e.getColumn();
...
int column = convertColumnIndexToView(modelColumn);
...
but the rows are not converted at all:
int start = e.getFirstRow();
int end = e.getLastRow();
...
dirtyRegion = getCellRect(start, column, false);
...
Reopening.
It's true that in the middle of some long description there is some complicated text that tells us that you have to convert the row indexes to be in terms of the view.
But the Javadoc of tableChanged(TableModelEvent e) is clear:
"* The <code>TableModelEvent</code> should be constructed in the
* coordinate system of the model; the appropriate mapping to the
* view coordinate system is performed by this <code>JTable</code>
* when it receives the event."
This implies a false assumption that tableChanged() method needs to have the row from the *model* (coordinate system of the model).
Since the behavior can not be changed because of compatibility, the Javadoc should be corrected to explicitly say that the column should be in the coordinate system of the model and the row in the coordinate system of the view.
Do we want to help developers to use our APIs or not?
- links to
-
Review openjdk/jdk/7253