@Override public IGridRegion getRegion() { return delegate.getRegion(); }
public IGridRegion getRegion() { return cell.getRegion(); }
public IGridRegion getRegion() { return delegate.getRegion(); }
private IGridRegion[] getMergedRegions() { if (mergedRegions == null) { List<IGridRegion> regions = new ArrayList<IGridRegion>(); for (NavigableMap<Integer, ICell> columns : rows.values()) { for (ICell cell : columns.values()) { if (cell.getRegion() != null) { regions.add(cell.getRegion()); } } } mergedRegions = regions.toArray(new IGridRegion[regions.size()]); } return mergedRegions; }
int getRowSpan(ICell cell) { IGridRegion gr = cell.getRegion(); if (gr == null) { return 1; } return IGridRegion.Tool.height(IGridRegion.Tool.intersect(reg, gr)); }
int getColSpan(ICell cell) { IGridRegion gr = cell.getRegion(); if (gr == null) { return 1; } return IGridRegion.Tool.width(IGridRegion.Tool.intersect(reg, gr)); }
int getRowSpan(ICell cell) { IGridRegion gr = cell.getRegion(); if (gr == null) { return 1; } return IGridRegion.Tool.height(IGridRegion.Tool.intersect(reg, gr)); }
int getColSpan(ICell cell) { IGridRegion gr = cell.getRegion(); if (gr == null) { return 1; } return IGridRegion.Tool.width(IGridRegion.Tool.intersect(reg, gr)); }
public int getWidth(ICell cell) { IGridRegion gr; if ((gr = cell.getRegion()) == null) { return grid.getColumnWidth(cell.getColumn()); } int w = 0; gr = IGridRegion.Tool.intersect(gr, reg); if (gr != null) { for (int c = gr.getLeft(); c <= gr.getRight(); c++) { w += grid.getColumnWidth(c); } } return w; }
public int getWidth(ICell cell) { IGridRegion gr; if ((gr = cell.getRegion()) == null) { return grid.getColumnWidth(cell.getColumn()); } int w = 0; gr = IGridRegion.Tool.intersect(gr, reg); if (gr != null) { for (int c = gr.getLeft(); c <= gr.getRight(); c++) { w += grid.getColumnWidth(c); } } return w; }
ICell theValueCell = theCell; if (theCell.getRegion() != null) { theValueCell = theCell.getTopLeftCellFromRegion();
/** * The cell in merged region must point to the top left cell of the region. If the cell is not in merged region, * return cellTable object unchanged. If cellTable is not cell return cellTable object unchanged. * * @param cellTable original cell * @return top left cell if region is merged or the cell itself otherwise */ private static IGridTable getTopLeftCellFromMergedRegion(IGridTable cellTable) { if (cellTable instanceof SingleCellGridTable) { ICell cell = cellTable.getCell(0, 0); IGridRegion region = cell.getRegion(); if (region == null) { return cellTable; } int left; int top; if (cellTable.isNormalOrientation()) { top = region.getTop(); left = region.getLeft(); } else { top = region.getLeft(); left = region.getTop(); } if (cell.getColumn() != left || cell.getRow() != top) { IGridTable table = ((SingleCellGridTable) cellTable).getOriginalGridTable(); return new SingleCellGridTable(table, left, top); } } return cellTable; }
/** * Gets the URI to the table by its four coordinates on the sheet. * * @return URI to the table in the sheet. (e.g. * <code>file:D:\work\Workspace\org.openl.tablets.tutorial4\rules * \main&wbName=Tutorial_4.xls&wsName=Vehicle-Scoring&range=B3:D12</code>) */ public String getRangeUri(int colStart, int rowStart, int colEnd, int rowEnd) { if (colStart == colEnd && rowStart == rowEnd) { ICell cell = getCell(colStart, rowStart); IGridRegion region = cell.getRegion(); if (region == null || (region.getRight() == region.getLeft() && region.getBottom() == region.getTop())) { return getUri() + "&" + "cell=" + cell.getUri(); } else { String range = getCell(region.getLeft(), region.getTop()).getUri() + RANGE_SEPARATOR + getCell(region.getRight(), region.getBottom()).getUri(); return getUri() + "&" + XlsURLConstants.RANGE + "=" + range; } } String range = getCell(colStart, rowStart).getUri() + RANGE_SEPARATOR + getCell(colEnd, rowEnd).getUri(); return getUri() + "&" + XlsURLConstants.RANGE + "=" + range; }