Package org.zkoss.zss.engine

Examples of org.zkoss.zss.engine.RefSheet


  private static ChangeInfo moveHSSFRange(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, int nRow, int nCol) {
    if (nRow == 0 && nCol == 0) { //nothing to do!
      return null;
    }
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = getRefSheet(book, sheet);
    final Set<Ref>[] refs = refSheet.moveRange(tRow, lCol, bRow, rCol, nRow, nCol);
    final List<CellRangeAddress[]> shiftedRanges = nCol != 0 && nRow == 0 ?
      ((HSSFSheetImpl)sheet).shiftColumnsRange(lCol, rCol, nCol, tRow, bRow, true, false, true, false, Range.FORMAT_NONE):
      nCol == 0 && nRow != 0 ?
      ((HSSFSheetImpl)sheet).shiftRowsRange(tRow, bRow, nRow, lCol, rCol, true, false, true, false, Range.FORMAT_NONE):
      ((HSSFSheetImpl)sheet).shiftBothRange(tRow, bRow, nRow, lCol, rCol, nCol, true); //nCol != 0 && nRow != 0
View Full Code Here


  private static ChangeInfo moveXSSFRange(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, int nRow, int nCol) {
    if (nRow == 0 && nCol == 0) { //nothing to do!
      return null;
    }
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = getRefSheet(book, sheet);
    final Set<Ref>[] refs = refSheet.moveRange(tRow, lCol, bRow, rCol, nRow, nCol);
    final List<CellRangeAddress[]> shiftedRanges = nCol != 0 && nRow == 0 ?
      ((XSSFSheetImpl)sheet).shiftColumnsRange(lCol, rCol, nCol, tRow, bRow, true, false, true, false, Range.FORMAT_NONE):
      nCol == 0 && nRow != 0 ?
      ((XSSFSheetImpl)sheet).shiftRowsRange(tRow, bRow, nRow, lCol, rCol, true, false, true, false, Range.FORMAT_NONE):
      ((XSSFSheetImpl)sheet).shiftBothRange(tRow, bRow, nRow, lCol, rCol, nCol, true); //nCol != 0 && nRow != 0
View Full Code Here

        }
        return shiftedFmla;
  }
 
  public static ChangeInfo unMerge(Worksheet sheet, int tRow, int lCol, int bRow, int rCol) {
    final RefSheet refSheet = BookHelper.getRefSheet((Book)sheet.getWorkbook(), sheet);
    final List<MergeChange> changes = new ArrayList<MergeChange>();
    for(int j = sheet.getNumMergedRegions() - 1; j >= 0; --j) {
          final CellRangeAddress merged = sheet.getMergedRegion(j);
         
          final int firstCol = merged.getFirstColumn();
View Full Code Here

 
  private static Set<Ref> setBordersOutline(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
    final int lb = BookHelper.BORDER_EDGE_LEFT;// leftBorder
View Full Code Here

    return all;
  }
 
  private static Set<Ref> setBordersInside(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
    final int lb = BookHelper.BORDER_EDGE_LEFT;// leftBorder
View Full Code Here

    return all;
  }

  private static Set<Ref> setBordersDiagonal(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
    final int db = BookHelper.BORDER_DIAGONAL_DOWN;// diagonal down Border
View Full Code Here

  }
 
  public static Set<Ref> setColumnWidth(Worksheet sheet, int lCol, int rCol, int char256) {
    final Book book = (Book) sheet.getWorkbook();
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Set<Ref> all = new HashSet<Ref>();
    for (int col = lCol; col <= rCol; ++col) {
      final int orgChar256 = sheet.getColumnWidth(col);
      if (char256 != orgChar256) {
        sheet.setColumnWidth(col, char256);
View Full Code Here

  }
 
  public static Set<Ref> setRowHeight(Worksheet sheet, int tRow, int bRow, short twips, boolean customHeight) {
    final Book book = (Book) sheet.getWorkbook();
    final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Set<Ref> all = new HashSet<Ref>();
    for (int row = tRow; row <= bRow; ++row) {
      Row rowobj = sheet.getRow(row);
      final int orgTwips = rowobj == null ? sheet.getDefaultRowHeight() : rowobj.getHeight();
      if ((twips < 0 && orgTwips < 0) || twips == orgTwips) {
View Full Code Here

        final Cell cell = BookHelper.getOrCreateCell(sheet, r, c);
        cell.setCellStyle(style);
      }
    }
    final Set<Ref> all = new HashSet<Ref>(1);
    final RefSheet refSheet = BookHelper.getRefSheet((Book)sheet.getWorkbook(), sheet);
    all.add(new AreaRefImpl(tRow, lCol, bRow, rCol, refSheet));
   
    return all;
  }
View Full Code Here

          final ChangeInfo changeInfo0 = BookHelper.copyCell(stepChunk.getStep(index).next(srcCell), srcCell, sheet, r, c, pasteType, BookHelper.PASTEOP_NONE, false);
          assignChangeInfo(toEval, affected, mergeChanges, changeInfo0);
        }
      }
    }
    final RefSheet refSheet = BookHelper.getRefSheet((Book)sheet.getWorkbook(), sheet);
    affected.add(new AreaRefImpl(srcbRow + 1, srclCol, dstbRow, srcrCol, refSheet));
    return changeInfo;
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.engine.RefSheet

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.