Package org.zkoss.zss.engine

Examples of org.zkoss.zss.engine.Ref


 
  @Override
  public void setColumnWidth(int char256) {
    synchronized (_sheet) {
      if (_refs != null && !_refs.isEmpty()) {
        final Ref ref = _refs.iterator().next();
        final RefSheet refSheet = ref.getOwnerSheet();
        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


 
  @Override
  public void setRowHeight(int points, boolean customHeight) {
    synchronized (_sheet) {
      if (_refs != null && !_refs.isEmpty()) {
        final Ref ref = _refs.iterator().next();
        final RefSheet refSheet = ref.getOwnerSheet();
        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

 
  @Override
  public void move(int nRow, int nCol) {
    synchronized (_sheet) {
      if (_refs != null && !_refs.isEmpty()) {
        final Ref ref = _refs.iterator().next();
        final RefSheet refSheet = ref.getOwnerSheet();
        final RefBook refBook = refSheet.getOwnerBook();
        final int tRow = ref.getTopRow();
        final int lCol = ref.getLeftCol();
        final int bRow = ref.getBottomRow();
        final int rCol = ref.getRightCol();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final ChangeInfo info = BookHelper.moveRange(sheet, tRow, lCol, bRow, rCol, nRow, nCol);
        notifyMergeChange(refBook, info, ref, SSDataEvent.ON_CONTENTS_CHANGE, SSDataEvent.MOVE_NO);
      }
    }
View Full Code Here

      if (_refs != null && !_refs.isEmpty() && !((RangeImpl)dstRange).getRefs().isEmpty()) {
        //destination range allow only one contiguous reference
        if (((RangeImpl)dstRange).getRefs().size() > 1) {
          throw new UiException("Command cannot be used on multiple selections");
        }
        final Ref srcRef = _refs.iterator().next();
        final Ref dstRef = ((RangeImpl)dstRange).getRefs().iterator().next();
        fillRef(srcRef, dstRef, fillType);
      }
    }
  }
View Full Code Here

 
  @Override
  public void clearContents() {
    synchronized (_sheet) {
      if (_refs != null && !_refs.isEmpty()) {
        final Ref ref = _refs.iterator().next();
        final RefSheet refSheet = ref.getOwnerSheet();
        final int tRow = ref.getTopRow();
        final int lCol = ref.getLeftCol();
        final int bRow = ref.getBottomRow();
        final int rCol = ref.getRightCol();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        clearContents(sheet, tRow, lCol, bRow, rCol);
      }
    }
  }
View Full Code Here

  @Override
  public void fillDown() {
    synchronized (_sheet) {
      if (_refs != null && !_refs.isEmpty()) {
        final Ref dstRef = _refs.iterator().next();
        final Ref srcRef = new AreaRefImpl(dstRef.getTopRow(), dstRef.getLeftCol(), dstRef.getTopRow(), dstRef.getRightCol(), dstRef.getOwnerSheet());
        fillRef(srcRef, dstRef, Range.FILL_COPY);
      }
    }
  }
View Full Code Here

 
  @Override
  public void fillLeft() {
    synchronized (_sheet) {
      if (_refs != null && !_refs.isEmpty()) {
        final Ref dstRef = _refs.iterator().next();
        final Ref srcRef = new AreaRefImpl(dstRef.getTopRow(), dstRef.getRightCol(), dstRef.getBottomRow(), dstRef.getRightCol(), dstRef.getOwnerSheet());
        fillRef(srcRef, dstRef, Range.FILL_COPY);
      }
    }
  }
View Full Code Here

  @Override
  public void fillRight() {
    synchronized (_sheet) {
      if (_refs != null && !_refs.isEmpty()) {
        final Ref dstRef = _refs.iterator().next();
        final Ref srcRef = new AreaRefImpl(dstRef.getTopRow(), dstRef.getLeftCol(), dstRef.getBottomRow(), dstRef.getLeftCol(), dstRef.getOwnerSheet());
        fillRef(srcRef, dstRef, Range.FILL_COPY);
      }
    }
  }
View Full Code Here

  @Override
  public void fillUp() {
    synchronized (_sheet) {
      if (_refs != null && !_refs.isEmpty()) {
        final Ref dstRef = _refs.iterator().next();
        final Ref srcRef = new AreaRefImpl(dstRef.getBottomRow(), dstRef.getLeftCol(), dstRef.getBottomRow(), dstRef.getRightCol(), dstRef.getOwnerSheet());
        fillRef(srcRef, dstRef, Range.FILL_COPY);
      }
    }
  }
View Full Code Here

  }
 
  @Override
  public void setDisplayGridlines(boolean show) {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final Set<Ref> all = new HashSet<Ref>();
      final boolean old = sheet.isDisplayGridlines();
      if (old != show) {
        sheet.setDisplayGridlines(show);
        //sheet is important, row, column is not in this event
View Full Code Here

TOP

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

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.