Package org.zkoss.zss.engine.impl

Examples of org.zkoss.zss.engine.impl.AreaRefImpl


    final int dstB = dstT + dstRowCount - 1;
    final int dstR = dstL + dstColCount - 1;
   
    //ZSS-22: Shall not allow Copy and Paste operation in a protected spreadsheet
    final Worksheet dstSheet = BookHelper.getSheet(_sheet, dstRefSheet);
    final Ref pasteRef = new AreaRefImpl(dstT, dstL, dstB, dstR, dstRefSheet);
    return new RangeImpl(pasteRef, dstSheet).isAnyCellProtected() ? null : pasteRef;
  }
View Full Code Here


    final List<MergeChange> changeMerges = prepareChangeMerges(refSheet, shiftedRanges);
    final Set<Ref> last = refs[0];
    final Set<Ref> all = refs[1];
    if (horizontal) {
      final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
      all.add(new AreaRefImpl(tRow, lCol, bRow, maxcol, refSheet));
      shiftFormulas(all, sheet, tRow, bRow, 0, lCol, maxcol, num);
    } else {
      final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
      all.add(new AreaRefImpl(tRow, lCol, maxrow, rCol, refSheet));
      shiftFormulas(all, sheet, tRow, maxrow, num, lCol, rCol, 0);
    }
   
    return new ChangeInfo(last, all, changeMerges);
  }
View Full Code Here

    final List<MergeChange> changeMerges = prepareChangeMerges(refSheet, shiftedRanges);
    final Set<Ref> last = refs[0];
    final Set<Ref> all = refs[1];
    if (horizontal) {
      final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
      all.add(new AreaRefImpl(tRow, lCol, bRow, maxcol, refSheet));
      shiftFormulas(all, sheet, tRow, bRow, 0, lCol, maxcol, num);
    } else {
      final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
      all.add(new AreaRefImpl(tRow, lCol, maxrow, rCol, refSheet));
      shiftFormulas(all, sheet, tRow, maxrow, num, lCol, rCol, 0);
    }
   
    return new ChangeInfo(last, all, changeMerges);
  }
View Full Code Here

    final Set<Ref> last = refs[0];
    final Set<Ref> all = refs[1];
   
    if (horizontal) {
      final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
      all.add(new AreaRefImpl(tRow, lCol, bRow, maxcol, refSheet));
      shiftFormulas(all, sheet, tRow, bRow, 0, rCol + 1, maxcol, -num);
    } else {
      final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
      all.add(new AreaRefImpl(tRow, lCol, maxrow, rCol, refSheet));
      shiftFormulas(all, sheet, bRow + 1, maxrow, -num, lCol, rCol, 0);
    }
   
    return new ChangeInfo(last, all, changeMerges);
  }
View Full Code Here

    final Set<Ref> last = refs[0];
    final Set<Ref> all = refs[1];
   
    if (horizontal) {
      final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
      all.add(new AreaRefImpl(tRow, lCol, bRow, maxcol, refSheet));
      shiftFormulas(all, sheet, tRow, bRow, 0, rCol + 1, maxcol, -num);
    } else {
      final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
      all.add(new AreaRefImpl(tRow, lCol, maxrow, rCol, refSheet));
      shiftFormulas(all, sheet, bRow + 1, maxrow, -num, lCol, rCol, 0);
    }
   
    return new ChangeInfo(last, all, changeMerges);
  }
View Full Code Here

      ((HSSFSheetImpl)sheet).shiftBothRange(tRow, bRow, nRow, lCol, rCol, nCol, true); //nCol != 0 && nRow != 0
    final List<MergeChange> changeMerges = prepareChangeMerges(refSheet, shiftedRanges);
    final Set<Ref> last = refs[0];
    final Set<Ref> all = refs[1];
    shiftFormulas(all, sheet, tRow, bRow, nRow, lCol, rCol, nCol);
    all.add(new AreaRefImpl(tRow, lCol, bRow, rCol, refSheet)); //original selection
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
    int ntRow = Math.max(0, tRow + nRow);
    int nlCol = Math.max(0, lCol + nCol);
    int nbRow = Math.min(maxrow, bRow + nRow);
    int nrCol = Math.min(maxcol, rCol + nCol);
    if (ntRow <= nbRow && nlCol <= nrCol)
    all.add(new AreaRefImpl(ntRow, nlCol, nbRow, nrCol, refSheet));
   
    return new ChangeInfo(last, all, changeMerges);
  }
View Full Code Here

      ((XSSFSheetImpl)sheet).shiftBothRange(tRow, bRow, nRow, lCol, rCol, nCol, true); //nCol != 0 && nRow != 0
    final List<MergeChange> changeMerges = prepareChangeMerges(refSheet, shiftedRanges);
    final Set<Ref> last = refs[0];
    final Set<Ref> all = refs[1];
    shiftFormulas(all, sheet, tRow, bRow, nRow, lCol, rCol, nCol);
    all.add(new AreaRefImpl(tRow, lCol, bRow, rCol, refSheet)); //original selection
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
    int ntRow = Math.max(0, tRow + nRow);
    int nlCol = Math.max(0, lCol + nCol);
    int nbRow = Math.min(maxrow, bRow + nRow);
    int nrCol = Math.min(maxcol, rCol + nCol);
    if (ntRow <= nbRow && nlCol <= nrCol)
    all.add(new AreaRefImpl(ntRow, nlCol, nbRow, nrCol, refSheet));
   
    return new ChangeInfo(last, all, changeMerges);
  }
View Full Code Here

      if (rng != null) {
        int tRow = rng.getFirstRow();
        int lCol = rng.getFirstColumn();
        int bRow = rng.getLastRow();
        int rCol = rng.getLastColumn();
        ref = new AreaRefImpl(tRow, lCol, bRow, rCol, sheet);
      }
      final CellRangeAddress orgRng = rngs[0];
      int tRow = orgRng.getFirstRow();
      int lCol = orgRng.getFirstColumn();
      int bRow = orgRng.getLastRow();
      int rCol = orgRng.getLastColumn();
      final Ref orgRef = new AreaRefImpl(tRow, lCol, bRow, rCol, sheet);
      changeMerges.add(new MergeChange(orgRef, ref));
    }
    return changeMerges;
  }
View Full Code Here

          final int lastCol = merged.getLastColumn();
          final int firstRow = merged.getFirstRow();
          final int lastRow = merged.getLastRow();
          if (firstCol >= lCol && lastCol <= rCol
            && firstRow >= tRow && lastRow <= bRow) { //total cover
        changes.add(new MergeChange(new AreaRefImpl(firstRow, firstCol, lastRow, lastCol, refSheet), null));
        sheet.removeMergedRegion(j);
          }
    }
    return new ChangeInfo(null, null, changes);
  }
View Full Code Here

        }
      }
    }
   
    sheet.addMergedRegion(new CellRangeAddress(tRow, bRow, lCol, rCol));
    final Ref mergeArea = new AreaRefImpl(tRow, lCol, bRow, rCol, BookHelper.getRefSheet((Book)sheet.getWorkbook(), sheet));
    all.add(mergeArea);
    changes.add(new MergeChange(null, mergeArea));
   
    return new ChangeInfo(last, all, changes);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.engine.impl.AreaRefImpl

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.