@Override public int getColumn() { return delegate.getColumn(); }
public int getColumn() { return delegate.getColumn(); }
public SimpleGridBuilder addCell(ICell cell) { int row = cell.getRow(); int column = cell.getColumn(); NavigableMap<Integer, ICell> columns = rows.get(row); if (columns == null) { columns = new TreeMap<Integer, ICell>(); rows.put(row, columns); } columns.put(column, cell); return this; }
private boolean isCurrentCellATopLeftCellInRegion() { ICell topLeftCell = getTopLeftCellFromRegion(); return topLeftCell.getColumn() == this.column && topLeftCell.getRow() == this.row; }
private void compareCols(IGridTable grid1, IGridTable grid2, List<ICell> diff) { // compareRows is hard enough :) // let reuse it List<ICell> iDiff = new ArrayList<>(); compareRows(grid1.transpose(), grid2.transpose(), iDiff); // fix diff -- invert coordinates for (ICell c : iDiff) { diff.add(grid1.getCell(c.getRow(), c.getColumn())); } }
private void compareCols(IGridTable grid1, IGridTable grid2, List<ICell> diff) { // compareRows is hard enough :) // let reuse it List<ICell> iDiff = new ArrayList<>(); compareRows(grid1.transpose(), grid2.transpose(), iDiff); // fix diff -- invert coordinates for (ICell c : iDiff) { diff.add(grid1.getCell(c.getRow(), c.getColumn())); } }
private IGridFilter makeFilter(IGridTable table, List<ICell> selectedCells) { List<IGridRegion> regions = new ArrayList<IGridRegion>(); for (ICell cell : selectedCells) { IGridRegion region = table.getSubtable(cell.getColumn(), cell.getRow(), 1, 1).getRegion(); regions.add(region); } if (regions.isEmpty()) { return null; } IGridRegion[] aRegions = regions.toArray(new IGridRegion[regions.size()]); return new ColorGridFilter(new RegionGridSelector(aRegions, true), WebStudioUtils.getWebStudio().getModel().getFilterHolder().makeFilter()); }
private IGridFilter makeFilter(IGridTable table, List<ICell> selectedCells) { List<IGridRegion> regions = new ArrayList<>(); for (ICell cell : selectedCells) { IGridRegion region = table.getSubtable(cell.getColumn(), cell.getRow(), 1, 1).getRegion(); regions.add(region); } if (regions.isEmpty()) { return null; } IGridRegion[] aRegions = regions.toArray(new IGridRegion[0]); return new ColorGridFilter(new RegionGridSelector(aRegions, true), WebStudioUtils.getWebStudio().getModel().getFilterHolder().makeFilter()); }
private IGridFilter makeFilter(IGridTable table, List<ICell> selectedCells) { List<IGridRegion> regions = new ArrayList<>(); for (ICell cell : selectedCells) { IGridRegion region = table.getSubtable(cell.getColumn(), cell.getRow(), 1, 1).getRegion(); regions.add(region); } if (regions.isEmpty()) { return null; } IGridRegion[] aRegions = regions.toArray(new IGridRegion[0]); return new ColorGridFilter(new RegionGridSelector(aRegions, true), WebStudioUtils.getWebStudio().getModel().getFilterHolder().makeFilter()); }
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; }
/** * 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; }
int logicalColStart = cell.getColumn(); int logicalWidth = data.getColumnWidth(i);