Package org.uguess.birt.report.engine.spreadsheet.model

Examples of org.uguess.birt.report.engine.spreadsheet.model.MergeBlock


        short y2 = y;

        if (element.isMerged()) {
            Iterator<MergeBlock> it = modelSheet.mergesIterator();
            while (it.hasNext()) {
                MergeBlock merge = it.next();
                if (merge.include(y, x)) {
                    if (x == merge.getStartColumn() && y == merge.getStartRow()) {
                        x2 = (short) (x + merge.getColumnSpan());
                        y2 = (short) (y + merge.getRowSpan());
                        xlsSheet.addMergedRegion(new Region(y, x, y2, x2));

                        break;
                    }
                }
View Full Code Here


        }
        return cell;
    }

    private Cell setCell(int row, int col, Cell cell, boolean careMerge) {
        MergeBlock merge = null;
        boolean merged = false;

        if (careMerge) {
            merge = getMergeBlock(row, col);
            merged = (!merge.isEmpty());
        }

        Long key = getCellsHashKey(row, col);
        if (cell.isEmpty()) {
            if (merged) {
View Full Code Here

        return c;
    }

    public MergeBlock addMergeBlock(int startRow, int startColumn, int endRow,
            int endColumn) {
        MergeBlock merge = MergeBlockImpl.createEmpty();

        if (startRow == endRow && startColumn == endColumn) {
            // This is a single cell.
            return merge;
        }

        ArrayList<MergeBlock> removes = new ArrayList<MergeBlock>();
        MergeBlock mbNew = MergeBlockImpl.create(startRow,
                startColumn,
                endRow,
                endColumn);

        Iterator<MergeBlock> itr = merges.iterator();
        while (itr.hasNext()) {
            merge = itr.next();
            if (mbNew.cross(merge)) {
                if (mbNew.equals(merge)) {
                    // if already a same merge block exists.
                    return merge;
                } else if (mbNew.include(merge)) {
                    // if already an overlapped merge block exists, we
                    // should remove it.
                    removes.add(merge);
                    itr.remove();
                } else {
View Full Code Here

    public MergeBlock removeMergeBlock(int row, int col) {
        if (!isMerged(row, col)) {
            return MergeBlockImpl.createEmpty();
        }

        MergeBlock merge = MergeBlockImpl.createEmpty();
        Iterator<MergeBlock> itr = merges.iterator();
        while (itr.hasNext()) {
            MergeBlock mg = itr.next();
            if (mg.include(row, col)) {
                merge = mg;
                itr.remove();
                break;
            }
        }
View Full Code Here

    }

    public void removeAllMergeBlocks() {
        Iterator<MergeBlock> itr = merges.iterator();
        while (itr.hasNext()) {
            MergeBlock merge = itr.next();
            updateCellMergeUnderMergeBlock(merge, MergeBlockImpl.createEmpty());
        }
        merges.clear();
    }
View Full Code Here

    private void checkEmpty(Cell cell, int rowNum, int colNum) {
        Object value = cell.getValue();

        if (!isEmpty(cell)) {
            if (cell.getMergeBlock() != null && !cell.getMergeBlock().isEmpty()) {
                MergeBlock merge = cell.getMergeBlock();
                for (int i = merge.getStartColumn(); i <= merge.getEndColumn(); i++) {
                    emptyColumnList.remove(new Integer(i));
                }
                for (int i = merge.getStartRow(); i <= merge.getEndRow(); i++) {
                    emptyRowList.remove(new Integer(i));
                }
            } else {
                emptyColumnList.remove(new Integer(colNum));
                emptyRowList.remove(new Integer(rowNum));
View Full Code Here

TOP

Related Classes of org.uguess.birt.report.engine.spreadsheet.model.MergeBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.