(TableModel sourceModel)
| 583 | } |
| 584 | |
| 585 | protected void init(TableModel sourceModel){ |
| 586 | if(this.sourceModel != null) |
| 587 | this.sourceModel.removeTableModelListener(this); |
| 588 | this.sourceModel = sourceModel; |
| 589 | //start with the identity order |
| 590 | int size = sourceModel.getRowCount(); |
| 591 | sourceToTarget = new int[size]; |
| 592 | targetToSource = new int[size]; |
| 593 | for(int i = 0; i < size; i++) { |
| 594 | sourceToTarget[i] = i; |
| 595 | targetToSource[i] = i; |
| 596 | } |
| 597 | sourceModel.addTableModelListener(this); |
| 598 | if(isSortable() && sortedColumn == -1) setSortedColumn(0); |
| 599 | componentSizedProperly = false; |
| 600 | } |
| 601 | |
| 602 | /** |
| 603 | * This gets events from the source model and forwards them to the UI |
no test coverage detected