/** * Returns the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates.<p> * * Note: the asymetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows.<p> * * This implementation messages the StringValue.TO_STRING with the filteredValue, * subclasses should re-implement and use the API appropriate for the target component type.<p> * * PENDING JW: what about null cell values? StringValue has a contract to return a * empty string then, would that be okay here as well? * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public String getFilteredStringAt(int row, int column) { return getStringAt(convertRowIndexToModel(row), column); }
/** * Returns the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates.<p> * * Note: the asymetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows.<p> * * This implementation messages the StringValue.TO_STRING with the filteredValue, * subclasses should re-implement and use the API appropriate for the target component type.<p> * * PENDING JW: what about null cell values? StringValue has a contract to return a * empty string then, would that be okay here as well? * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public String getFilteredStringAt(int row, int column) { return getStringAt(convertRowIndexToModel(row), column); }
/** * Returns the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates.<p> * * Note: the asymetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows.<p> * * This implementation messages the StringValue.TO_STRING with the filteredValue, * subclasses should re-implement and use the API appropriate for the target component type.<p> * * PENDING JW: what about null cell values? StringValue has a contract to return a * empty string then, would that be okay here as well? * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public String getFilteredStringAt(int row, int column) { return getStringAt(convertRowIndexToModel(row), column); }
/** * Returns the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates.<p> * * Note: the asymetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows.<p> * * This implementation messages the StringValue.TO_STRING with the filteredValue, * subclasses should re-implement and use the API appropriate for the target component type.<p> * * PENDING JW: what about null cell values? StringValue has a contract to return a * empty string then, would that be okay here as well? * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public String getFilteredStringAt(int row, int column) { return getStringAt(convertRowIndexToModel(row), column); }
/** * Returns the string representation of cell at the specified row and column. * * @param row in the coordinates of what is the filter's "model" (== input) coordinates * @param column in model coordinates * @return the string representation of the cell at the specified row and column. */ protected String getInputString(int row, int column) { Filter filter = getMappingFilter(); if (filter != null) { return filter.getStringAt(row, column); } if (adapter != null) { return adapter.getStringAt(row, column); } return null; } /**
/** * Returns the string representation at the specified row and column. * The column index is in absolute column coordinates. * * PRE: 0 <= row < getSize() * * @param row the row index in this filter's output ("view") coordinates * @param column column index in model coordinates * @return the string representation of the cell at the specified row and column. */ public String getStringAt(int row, int column) { int mappedRow = mapTowardModel(row); Filter filter = getMappingFilter(); if (filter != null) { return filter.getStringAt(mappedRow, column); } return adapter.getStringAt(mappedRow, column); } /**
/** * {@inheritDoc} * * PENDING JW: this is implemented to duplicate this table's lookup code * if either the row or the column is not visible. That's not good * enough if subclasses implemented a different strategy! We do it * anyway for now, mostly we will be lucky and improve the situation * against using toString always. * */ @Override public String getStringAt(int row, int column) { int viewRow = table.convertRowIndexToView(row); int viewColumn = table.convertColumnIndexToView(column); if ((viewRow >= 0) && (viewColumn >= 0)) { return table.getStringAt(viewRow, viewColumn); } TableCellRenderer renderer = getRendererByModelColumn(column); if (renderer instanceof StringValue) { return ((StringValue) renderer).getString(getValueAt(row, column)); } // no luck - return default return super.getStringAt(row, column); }