Package org.zkoss.zss.engine

Examples of org.zkoss.zss.engine.RefSheet


    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = ((RefSheetImpl)refSheet).getDirectDependents(row, col);
      return refs != null && !refs.isEmpty() ?
          new RangeImpl(refs, sheet) : Ranges.EMPTY_RANGE;
    }
  }
View Full Code Here


    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = refSheet.getAllPrecedents(row, col);
      return refs != null && !refs.isEmpty() ?
          new RangeImpl(refs, sheet) : Ranges.EMPTY_RANGE;
    }
   
  }
View Full Code Here

    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = refSheet.getDirectPrecedents(row, col);
      return refs != null && !refs.isEmpty() ?
          new RangeImpl(refs, sheet) : Ranges.EMPTY_RANGE;
    }
  }
View Full Code Here

    synchronized (_sheet) {
      Ref ref = _refs != null && !_refs.isEmpty() ? _refs.iterator().next() : null;
      if (ref != null) {
        final int tRow = ref.getTopRow();
        final int lCol = ref.getLeftCol();
        final RefSheet refSheet = ref.getOwnerSheet();
        final Cell cell = getCell(tRow, lCol, refSheet);
        if (cell != null) {
          return getValue0(cell);
        }
      }
View Full Code Here

        final int left = ref.getLeftCol() + colOffset;
        final int top = ref.getTopRow() + rowOffset;
        final int right = ref.getRightCol() + colOffset;
        final int bottom = ref.getBottomRow() + rowOffset;
       
        final RefSheet refSheet = ref.getOwnerSheet();
        final int nleft = colOffset < 0 ? Math.max(0, left) : left; 
        final int ntop = rowOffset < 0 ? Math.max(0, top) : top;
        final int nright = colOffset > 0 ? Math.min(maxCol, right) : right;
        final int nbottom = rowOffset > 0 ? Math.min(maxRow, bottom) : bottom;
       
View Full Code Here

  @Override
  public boolean isCustomHeight() {
    Ref ref = _refs != null && !_refs.isEmpty() ? _refs.iterator().next() : null;
    if (ref != null) {
      final int tRow = ref.getTopRow();
      final RefSheet refSheet = ref.getOwnerSheet();
      final Row row = getRow(tRow, refSheet);
      if (row != null) {
        return row.isCustomHeight();
      }
    }
View Full Code Here

  }
 
  /*package*/ static void clearFormulaCache(Book book, Set<Ref> all) {
    if (all != null) {
      for(Ref ref : all) {
        final RefSheet refSheet = ref.getOwnerSheet();
        final Book bookTarget = BookHelper.getBook(book, refSheet);
        final Cell cell = getCell(book, ref.getTopRow(), ref.getLeftCol(), refSheet);
        if (cell != null)
          bookTarget.getFormulaEvaluator().notifySetFormula(cell);
      }
View Full Code Here

  }
 
  /*package*/ static void reevaluate(Book book, Set<Ref> last) {
    if (last != null) {
      for(Ref ref : last) {
        final RefSheet refSheet = ref.getOwnerSheet();
        //locate the model book and sheet of the refSheet
        final Book bookTarget = BookHelper.getBook(book, refSheet);
        final Cell cell = getCell(book, ref.getTopRow(), ref.getLeftCol(), refSheet);
        if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
          evaluate(bookTarget, cell);
View Full Code Here

  }
 
  public static void notifyCellChanges(Book book, Set<Ref> all) {
    if (all != null) {
      for(Ref ref : all) {
        final RefSheet refSheet = ref.getOwnerSheet();
        final RefBook refBook = refSheet.getOwnerBook();
        refBook.publish(new SSDataEvent(SSDataEvent.ON_CONTENTS_CHANGE, ref, SSDataEvent.MOVE_NO));
      }
    }
  }
View Full Code Here

  }
 
  public static void notifySizeChanges(Book book, Set<Ref> all) {
    if (all != null) {
      for(Ref ref : all) {
        final RefSheet refSheet = ref.getOwnerSheet();
        final RefBook refBook = refSheet.getOwnerBook();
        refBook.publish(new SSDataEvent(SSDataEvent.ON_SIZE_CHANGE, ref, SSDataEvent.MOVE_NO));
      }
    }
  }
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.