Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Book


      addRef(ref);
    }
  }
 
  private void initAreaRef(int tRow, int lCol, int bRow, int rCol, Worksheet sheet, Worksheet lastSheet) {
    final Book book  = (Book) sheet.getWorkbook();
    final int s1 = book.getSheetIndex(sheet);
    final int s2 = book.getSheetIndex(lastSheet);
    final int sb = Math.min(s1,s2);
    final int se = Math.max(s1,s2);
    for (int s = sb; s <= se; ++s) {
      final Worksheet sht = book.getWorksheetAt(s);
      final RefSheet refSht = BookHelper.getOrCreateRefBook(book).getOrCreateRefSheet(sht.getSheetName());
      addRef(new AreaRefImpl(tRow, lCol, bRow, rCol, refSht));
    }
  }
View Full Code Here


    }
  }
 
  /*package*/ void reevaluateAndNotify(Set<Ref>[] refs) { //[0]: last, [1]: all
    if (refs != null) {
      final Book book  = (Book) _sheet.getWorkbook();
      BookHelper.reevaluateAndNotify(book, refs[0], refs[1]);
    }
  }
View Full Code Here

      return BookHelper.setCellValue(cell, value);
    }
  }
 
  private Row getRow(int rowIndex, RefSheet refSheet) {
    final Book book = BookHelper.getBook(_sheet, refSheet);
    if (book != null) {
      final Worksheet sheet = book.getWorksheet(refSheet.getSheetName());
      if (sheet != null) {
        return sheet.getRow(rowIndex);
      }
    }
    return null;
View Full Code Here

    return null;
  }
 
  private Cell getCell(int rowIndex, int colIndex, RefSheet refSheet) {
    //locate the model book and sheet of the refSheet
    final Book book = BookHelper.getBook(_sheet, refSheet);
    if (book != null) {
      final Worksheet sheet = book.getWorksheet(refSheet.getSheetName());
      if (sheet != null) {
        final Row row = sheet.getRow(rowIndex);
        if (row != null) {
          return row.getCell(colIndex);
        }
View Full Code Here

    return null;
  }
 
  private Cell getOrCreateCell(int rowIndex, int colIndex, RefSheet refSheet, int cellType) {
    //locate the model book and sheet of the refSheet
    final Book book = BookHelper.getBook(_sheet, refSheet);
    final String sheetname = refSheet.getSheetName();
    final Worksheet sheet = getOrCreateSheet(book, sheetname);
    final Row row = getOrCreateRow(sheet, rowIndex);
    return getOrCreateCell(row, colIndex, cellType);
  }
View Full Code Here

      final int dstCol = dstlCol + count;
      final int srcCol = srclCol + count % widthRepeatCount;
      final int char256 = srcSheet.getColumnWidth(srcCol);
      BookHelper.setColumnWidth(dstSheet, dstCol, dstCol, char256);
    }
    final Book book = (Book) dstSheet.getWorkbook();
    //bug# ZSS-52: Past special, copy column width's behavior doesn't correct
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final Set<Ref> affected = new HashSet<Ref>();
    affected.add(dstRef.isWholeColumn() ? dstRef : new AreaRefImpl(0, dstlCol, maxrow, dstRef.getRightCol(), dstRefSheet));
    BookHelper.notifySizeChanges(book, affected);
  }
View Full Code Here

        final int bRow = ref.getBottomRow();
        final int rCol = ref.getRightCol();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final Set<Ref> all = BookHelper.setBorders(sheet, tRow, lCol, bRow, rCol, borderIndex, lineStyle, color);
        if (all != null) {
          final Book book = (Book) _sheet.getWorkbook();
          BookHelper.notifyCellChanges(book, all);
        }
      }
    }
  }
View Full Code Here

        final int lCol = ref.getLeftCol();
        final int rCol = ref.getRightCol();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final Set<Ref> all = BookHelper.setColumnWidth(sheet, lCol, rCol, char256);
        if (all != null) {
          final Book book = (Book) _sheet.getWorkbook();
          BookHelper.notifySizeChanges(book, all);
        }
      }
    }
  }
View Full Code Here

        final int tRow = ref.getTopRow();
        final int bRow = ref.getBottomRow();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final Set<Ref> all = BookHelper.setRowHeight(sheet, tRow, bRow, (short) (points * 20), customHeight); //in twips, set customHeight
        if (all != null) {
          final Book book = (Book) _sheet.getWorkbook();
          BookHelper.notifySizeChanges(book, all);
        }
      }
    }
  }
View Full Code Here

          final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
          final Set<Ref> refs = BookHelper.setCellStyle(sheet, tRow, lCol, bRow, rCol, style);
          all.addAll(refs);
        }
        if (!all.isEmpty()) {
          final Book book = (Book) _sheet.getWorkbook();
          BookHelper.notifyCellChanges(book, all);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.Book

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.