Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Range


      }
    }

    final Cell dstcell =  _matrix.getCellIndex(top, left).getCell();
    final RangeMerge rng = new RangeMerge(this, left, top, right, bottom);
    final Range org = ((CellImpl)dstcell).setRangeMerge(rng);
    if (org == null) { //new added merge
      _book.fireSSDataEvent(new SSDataEvent(rng, org, SSDataEvent.MERGE_ADD, SSDataEvent.MOVE_NO));
    } else { //old merge change size and move
      _book.fireSSDataEvent(new SSDataEvent(rng, org, SSDataEvent.MERGE_CHANGE, SSDataEvent.MOVE_NO));
    }
View Full Code Here


    final List cells = _matrix.getCells(left, top, right, bottom, new LinkedList());
    for (final Iterator it = cells.iterator(); it.hasNext();) {
      final CellImpl x = (CellImpl) it.next();
      final RangeMerge rng = x.setRangeMerge(null);
      if (rng != null) {
        final Range org = new RangeSimple(this, null, rng.getLeft(), rng.getTop(), rng.getRight(), rng.getBottom());
        final Ref2d ref = (Ref2d) rng.getRef();
        final CellIndex lt = ref.getLtIndex();
        final CellIndex rb = ref.getRbIndex();
        ref.remove(); //remove the reference
        if (lt.isEmpty()) {
View Full Code Here

      throw new java.lang.IndexOutOfBoundsException("Column out of bound (left, right): "+left+", "+right);
    }
    offsetColumnIndex(right, left - right - 1);
    _matrix.removeColumns(left, right);
    final Collection changed = _matrixMerge.removeColumns(left, right);
    final Range rng = new RangeSimple(this, null, left, -1, right, -1);
    _book.fireSSDataEvent(new SSDataEvent(rng, SSDataEvent.RANGE_DELETE, SSDataEvent.MOVE_H));
    for (final Iterator it = changed.iterator(); it.hasNext(); ) {
      final Range[] rngs = (Range[]) it.next();
      final Range org = rngs[0];
      final Range mod = rngs[1];
      _book.fireSSDataEvent(new SSDataEvent(mod, org,
        mod == null ? SSDataEvent.MERGE_DELETE : SSDataEvent.MERGE_CHANGE, SSDataEvent.MOVE_H));
    }
  }
View Full Code Here

    if (left < 0 || top < 0 || right < 0 || bottom < 0) {
      throw new java.lang.IndexOutOfBoundsException("Range out of bound (left,top,right,bottom): "+left+", "+top+", "+right+", "+bottom);
    }
    _matrix.removeRange(left, top, right, bottom, toLeft);
    final Collection changed = _matrixMerge.removeRange(left, top, right, bottom, toLeft);
    final Range rng = new RangeSimple(this, null, left, top, right, bottom);
    _book.fireSSDataEvent(new SSDataEvent(rng, SSDataEvent.RANGE_DELETE,
        toLeft ? SSDataEvent.MOVE_H : SSDataEvent.MOVE_V));
    for (final Iterator it = changed.iterator(); it.hasNext(); ) {
      final Range[] rngs = (Range[]) it.next();
      final Range org = rngs[0];
      final Range mod = rngs[1];
      _book.fireSSDataEvent(new SSDataEvent(mod, org,
        mod == null ? SSDataEvent.MERGE_DELETE : SSDataEvent.MERGE_CHANGE,
        toLeft ? SSDataEvent.MOVE_H : SSDataEvent.MOVE_V));
    }
  }
View Full Code Here

      throw new java.lang.IndexOutOfBoundsException("Row out of bound (top, bottom): "+top+", "+bottom);
    }
    offsetRowIndex(bottom, top - bottom - 1);
    _matrix.removeRows(top, bottom);
    final Collection changed = _matrixMerge.removeRows(top, bottom);
    final Range rng = new RangeSimple(this, null, -1, top, -1, bottom);
    _book.fireSSDataEvent(new SSDataEvent(rng, SSDataEvent.RANGE_DELETE, SSDataEvent.MOVE_V));
    for (final Iterator it = changed.iterator(); it.hasNext(); ) {
      final Range[] rngs = (Range[]) it.next();
      final Range org = rngs[0];
      final Range mod = rngs[1];
      _book.fireSSDataEvent(new SSDataEvent(mod, org,
        mod == null ? SSDataEvent.MERGE_DELETE : SSDataEvent.MERGE_CHANGE, SSDataEvent.MOVE_V));
    }
  }
View Full Code Here

      throw new java.lang.IndexOutOfBoundsException("Column out of bound (left, right): "+left+", "+right);
    }
    offsetColumnIndex(left, right - left + 1);
    _matrix.insertColumns(left, right);
    final Collection changed = _matrixMerge.insertColumns(left, right);
    final Range rng = new RangeSimple(this, null, left, -1, right, -1);
    _book.fireSSDataEvent(new SSDataEvent(rng, SSDataEvent.RANGE_INSERT, SSDataEvent.MOVE_H));
    copyLeftFormat(left, -1, right, -1);
    for (final Iterator it = changed.iterator(); it.hasNext(); ) {
      final Range[] rngs = (Range[]) it.next();
      final Range org = rngs[0];
      final Range mod = rngs[1];
      _book.fireSSDataEvent(new SSDataEvent(mod, org, SSDataEvent.MERGE_CHANGE, SSDataEvent.MOVE_H));
    }
  }
View Full Code Here

        final Format format = cell.getFormat();
        if (format != null) {
          for(int k = left; k <= right; ++k) {
            copyCellFormat(cell, row, k);
          }
          final Range xrng = new RangeSimple(this, null, left, row, right, row);
          _book.fireSSDataEvent(new SSDataEvent(xrng, SSDataEvent.CONTENTS_CHANGE, SSDataEvent.MOVE_NO));
        }
      }
    }
  }
View Full Code Here

        final Format format = cell.getFormat();
        if (format != null) {
          for(int r = top; r <= bottom; ++r) {
            copyCellFormat(cell, r, col);
          }
          final Range xrng = new RangeSimple(this, null, col, top, col, bottom);
          _book.fireSSDataEvent(new SSDataEvent(xrng, SSDataEvent.CONTENTS_CHANGE, SSDataEvent.MOVE_NO));
        }
      }
    }
  }
View Full Code Here

    if (left < 0 || top < 0 || right < 0 || bottom < 0) {
      throw new java.lang.IndexOutOfBoundsException("Range out of bound (left,top,right,bottom): "+left+", "+top+", "+right+", "+bottom);
    }
    _matrix.insertRange(left, top, right, bottom, toRight);
    final Collection changed = _matrixMerge.insertRange(left, top, right, bottom, toRight);
    final Range rng = new RangeSimple(this, null, left, top, right, bottom);
    _book.fireSSDataEvent(new SSDataEvent(rng, SSDataEvent.RANGE_INSERT,
        toRight ? SSDataEvent.MOVE_H : SSDataEvent.MOVE_V));
    if (toRight) { //copy left hand side
      copyLeftFormat(left, top, right, bottom);
    } else {
      copyTopFormat(left, top, right, bottom);
    }
    for (final Iterator it = changed.iterator(); it.hasNext(); ) {
      final Range[] rngs = (Range[]) it.next();
      final Range org = rngs[0];
      final Range mod = rngs[1];
      _book.fireSSDataEvent(new SSDataEvent(mod, org, SSDataEvent.MERGE_CHANGE,
          toRight ? SSDataEvent.MOVE_H : SSDataEvent.MOVE_V));
    }
  }
View Full Code Here

      throw new java.lang.IndexOutOfBoundsException("Row out of bound (top, bottom): "+top+", "+bottom);
    }
    offsetRowIndex(top, bottom - top + 1);
    _matrix.insertRows(top, bottom);
    final Collection changed = _matrixMerge.insertRows(top, bottom);
    final Range rng = new RangeSimple(this, null, -1, top, -1, bottom);
    _book.fireSSDataEvent(new SSDataEvent(rng, SSDataEvent.RANGE_INSERT, SSDataEvent.MOVE_V));
    copyTopFormat(-1, top, -1, bottom);
    for (final Iterator it = changed.iterator(); it.hasNext(); ) {
      final Range[] rngs = (Range[]) it.next();
      final Range org = rngs[0];
      final Range mod = rngs[1];
      _book.fireSSDataEvent(new SSDataEvent(mod, org, SSDataEvent.MERGE_CHANGE, SSDataEvent.MOVE_V));
    }
  }
View Full Code Here

TOP

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

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.