Package org.zkoss.poi.ss

Examples of org.zkoss.poi.ss.SpreadsheetVersion


   * @param sheet the {@link Worksheet} the Range will refer to.
   * @return the associated {@link Range} of the whole specified {@link Worksheet}.
   */
  public static Range range(Worksheet sheet) {
    final Book book = (Book) sheet.getWorkbook();
    final SpreadsheetVersion ver = book.getSpreadsheetVersion();
    return newRange(sheet, sheet, 0, 0, ver.getLastRowIndex(), ver.getLastColumnIndex());
  }
View Full Code Here


    final String sheet1 = parts[0];
    final String sheet2 = parts[1];
    final String lt = parts[2];
    final String rb = parts[3];
    final String c1str = (sheet1 != null ? sheet1 : "") + (sheet2 != null ? (":" + sheet2) : "") + (sheet1 != null ? "!" : "") + lt;
    final SpreadsheetVersion ver = ((Book)sheet.getWorkbook()).getSpreadsheetVersion()
    final int maxcol = ver.getLastColumnIndex();
    final int maxrow = ver.getLastRowIndex();

    AreaReference ref = null;
    try {
      final CellReference c1 = new CellReference(c1str);
      if (c1.getCol() <= maxcol && c1.getRow() <= maxrow) {
View Full Code Here

  private static Ptg[] offsetPtgs(Cell srcCell, Worksheet srcSheet, Cell dstCell, Worksheet dstSheet, int offRow, int offCol) {
    final Ptg[] srcPtgs = getCellPtgs(srcCell);
    final int ptglen = srcPtgs.length;
    final Ptg[] dstPtgs = new Ptg[ptglen];
   
    final SpreadsheetVersion ver = ((Book)dstSheet.getWorkbook()).getSpreadsheetVersion();
    for(int j = 0; j < ptglen; ++j) {
      final Ptg srcPtg = srcPtgs[j];
      final Ptg dstPtg = offsetPtg(srcPtg, dstCell, offRow, offCol, ver);
      dstPtgs[j] = dstPtg;
    }
View Full Code Here

   *
   * @param sel the selection rect
   */
  public void setSelection(Rect sel) {
    if (!Objects.equals(_selectionRect, sel)) {
      final SpreadsheetVersion ver = _book.getSpreadsheetVersion();
      if (sel.getLeft() < 0 || sel.getTop() < 0
          || sel.getRight() > ver.getLastColumnIndex()
          || sel.getBottom() > ver.getLastRowIndex()
          || sel.getLeft() > sel.getRight()
          || sel.getTop() > sel.getBottom()) {
        throw new UiException("illegal selection : " + sel.toString());
      }
      setSelectionDirectly(sel);
View Full Code Here

  public Range getOffset(int rowOffset, int colOffset) {
    if (rowOffset == 0 && colOffset == 0) { //no offset, return this
      return this;
    }
    if (_refs != null && !_refs.isEmpty()) {
      final SpreadsheetVersion ver = ((Book)_sheet.getWorkbook()).getSpreadsheetVersion();
      final int maxCol = ver.getLastColumnIndex();
      final int maxRow = ver.getLastRowIndex();
      final Set<Ref> nrefs = new LinkedHashSet<Ref>(_refs.size());
      final Map<RefAddr, Ref> refMap = new HashMap<RefAddr, Ref>(_refs.size()); //index of Ref left/top/right/bottom

      for(Ref ref : _refs) {
        final int left = ref.getLeftCol() + colOffset;
View Full Code Here

TOP

Related Classes of org.zkoss.poi.ss.SpreadsheetVersion

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.