private Formatter getFormatter(int row, int column) { for (Map.Entry<CellMatcher, Formatter> kv : formatters.entrySet()) { if (kv.getKey().matches(row, column, model)) { return kv.getValue(); } } throw new AssertionError("Can't be reached thanks to the whole-table default"); }
private TextWrapper getWrapper(int row, int column) { for (Map.Entry<CellMatcher, TextWrapper> kv : wrappers.entrySet()) { if (kv.getKey().matches(row, column, model)) { return kv.getValue(); } } throw new AssertionError("Can't be reached thanks to the whole-table default"); }
private SizeConstraints getSizeConstraints(int row, int column) { for (Map.Entry<CellMatcher, SizeConstraints> kv : sizeConstraints.entrySet()) { if (kv.getKey().matches(row, column, model)) { return kv.getValue(); } } throw new AssertionError("Can't be reached thanks to the whole-table default"); }
if (kv.getKey().matches(row, column, model)) { subLines[row][column] = kv.getValue().align(subLines[row][column], cellWidths[column], cellHeights[row]);