public LogicalTable(IGridTable table, int[] columnOffset, int[] rowOffset) { super(table); if (columnOffset == null) { int width = LogicalTableHelper.calcLogicalColumns(table); this.columnOffset = LogicalTableHelper.calculateColumnOffsets(width, table); } else this.columnOffset = columnOffset; if (rowOffset == null) { int height = LogicalTableHelper.calcLogicalRows(table); this.rowOffset = LogicalTableHelper.calculateRowOffsets(height, table); } else this.rowOffset = rowOffset; }
/** * If there is no merged cells in the top row and left column - returns {@link SimpleLogicalTable} * in other case return {@link LogicalTable} * * @param table Original source grid table. * @return {@link ILogicalTable} table with correctly calculated height and width. */ public static ILogicalTable logicalTable(IGridTable table) { int width = calcLogicalColumns(table); int height = calcLogicalRows(table); if (width == table.getWidth() && height == table.getHeight()) { return new SimpleLogicalTable(table); } return new LogicalTable(table, width, height); }