TableRowLineRenderer(TableLineRenderer table, RowElement row) { this.table = table; this.row = new RowLineRenderer(row, table.separator, table.leftCellPadding, table.rightCellPadding); this.header = row.header; this.index = 0; }
int getActualHeight(int width) { int actualHeight; switch (table.overflow) { case HIDDEN: actualHeight = 1; break; case WRAP: actualHeight = row.getActualHeight(width); break; default: throw new AssertionError(); } if (hasTop()) { actualHeight++; } if (hasBottom()) { actualHeight++; } return actualHeight; }
int getActualWidth() { return row.getActualWidth(); }
List<LineRenderer> getCols() { return row.getCols(); }
@Override public LineReader reader(int width) { int[] widths = new int[cols.size()]; int[] minWidths = new int[cols.size()]; for (int i = 0;i < cols.size();i++) { LineRenderer renderable = cols.get(i); widths[i] = Math.max(widths[i], renderable.getActualWidth()); minWidths[i] = Math.max(minWidths[i], renderable.getMinWidth()); } widths = Layout.flow().compute(false, width, widths, minWidths); if (widths == null) { return null; } else { // Size could be smaller and lead to ArrayIndexOutOfBounds later widths = Arrays.copyOf(widths, minWidths.length); return renderer(widths, -1); } } }
int getColsSize() { return row.getSize(); }
int getMinWidth() { return row.getMinWidth(); }
int getActualHeight(int[] widths) { int actualHeight; switch (table.overflow) { case HIDDEN: actualHeight = 1; break; case WRAP: actualHeight = 0; for (int i = 0;i < widths.length;i++) { LineRenderer col = row.getCols().get(i); actualHeight = Math.max(actualHeight, col.getActualHeight(widths[i])); } break; default: throw new AssertionError(); } if (hasTop()) { actualHeight++; } if (hasBottom()) { actualHeight++; } return actualHeight; }
int getColsSize() { return row.getSize(); }
int getMinWidth() { return row.getMinWidth(); }
int getMinHeight(int[] widths) { int minHeight; switch (table.overflow) { case HIDDEN: minHeight = 1; break; case WRAP: minHeight = 0; for (int i = 0;i < widths.length;i++) { LineRenderer col = row.getCols().get(i); minHeight = Math.max(minHeight, col.getMinHeight(widths[i])); } break; default: throw new AssertionError(); } if (hasTop()) { minHeight++; } if (hasBottom()) { minHeight++; } return minHeight; }
@Override public RowLineRenderer renderer() { return new RowLineRenderer(this, null, 0, 0); } }
@Override public LineReader reader(int width) { int[] widths = new int[cols.size()]; int[] minWidths = new int[cols.size()]; for (int i = 0;i < cols.size();i++) { LineRenderer renderable = cols.get(i); widths[i] = Math.max(widths[i], renderable.getActualWidth()); minWidths[i] = Math.max(minWidths[i], renderable.getMinWidth()); } widths = Layout.flow().compute(false, width, widths, minWidths); if (widths == null) { return null; } else { // Size could be smaller and lead to ArrayIndexOutOfBounds later widths = Arrays.copyOf(widths, minWidths.length); return renderer(widths, -1); } } }
int getColsSize() { return row.getSize(); }
int getActualWidth() { return row.getActualWidth(); }
int getMinWidth() { return row.getMinWidth(); }
int getActualHeight(int width) { int actualHeight; switch (table.overflow) { case HIDDEN: actualHeight = 1; break; case WRAP: actualHeight = row.getActualHeight(width); break; default: throw new AssertionError(); } if (hasTop()) { actualHeight++; } if (hasBottom()) { actualHeight++; } return actualHeight; }
List<LineRenderer> getCols() { return row.getCols(); }
TableRowLineRenderer(TableLineRenderer table, RowElement row) { this.table = table; this.row = new RowLineRenderer(row, table.separator, table.leftCellPadding, table.rightCellPadding); this.header = row.header; this.index = 0; }