Package org.zkoss.zss.engine.xel

Examples of org.zkoss.zss.engine.xel.Ref2d


  }
 
  /*package*/ Collection getColumnOverlapRefs(int top, int bottom, Collection lst) {
    if (_ltRefs != null) {
      for(final Iterator it = _ltRefs.iterator(); it.hasNext();) {
        final Ref2d ref = (Ref2d) it.next();
        final int refb = ref.getBottom();
        if (bottom == -1 || refb <= bottom) {
          lst.add(ref);
        }
      }
    }
    if (_rbRefs != null) {
      for(final Iterator it = _rbRefs.iterator(); it.hasNext();) {
        final Ref2d ref = (Ref2d) it.next();
        final int reft = ref.getTop();
        if (top == -1 || reft >= top) {
          lst.add(ref);
        }
      }
    }
View Full Code Here


  }
 
  /*package*/ Collection getTotalOverlapRefs(int left, int top, int right, int bottom, Collection lst) {
    if (_ltRefs != null) {
      for(final Iterator it = _ltRefs.iterator(); it.hasNext();) {
        final Ref2d ref = (Ref2d) it.next();
        final int refr = ref.getRight();
        final int refb = ref.getBottom();
        if ((right == -1 || refr <= right)
        && (bottom == -1 || refb <= bottom)) {
          lst.add(ref);
        }
      }
    }
    if (_rbRefs != null) {
      for(final Iterator it = _rbRefs.iterator(); it.hasNext();) {
        final Ref2d ref = (Ref2d) it.next();
        final int refl = ref.getLeft();
        final int reft = ref.getTop();
        if ((left == -1 || refl >= left)
        && (top == -1 || reft >= top)) {
          lst.add(ref);
        }
      }
View Full Code Here

  }
 
  /*package*/ Collection getIntersectRef2ds(int row, int col, Collection lst) {
    if (_ltRefs != null) {
      for(final Iterator it = _ltRefs.iterator(); it.hasNext();) {
        final Ref2d ref = (Ref2d) it.next();
        final int refr = ref.getRight();
        final int refb = ref.getBottom();
       
        if ((refr == -1 || refr >= col) && (refb == -1 || refb >= row)) {
          lst.add(ref);
        }
      }
View Full Code Here

    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()) {
          _matrixMerge.detachCellIndex(lt.getRow(), lt.getColumn());
        }
        if (rb.isEmpty()) {
          _matrixMerge.detachCellIndex(rb.getRow(), rb.getColumn());
View Full Code Here

  }

  //test remove 3:5, B3:C5 -> #REF!, D8:E11 -> D5:E8
  public void testRemoveRows3() {
    _im.removeRows(2, 4);
    final Ref2d ref = (Ref2d) _ref1;
    assertNull(ref.getRbIndex());
    assertNull(ref.getLtIndex());
    assertEquals(4, _ref2.getTop());
    assertEquals(7, _ref2.getBottom());
    assertEquals(3, _ref2.getLeft());
    assertEquals(4, _ref2.getRight());
  }
View Full Code Here

 
  public Reference getRef() {
    return _ref;
  }
  public Collection getCells() {
     final Ref2d ref = (Ref2d) _ref;
    if (ref.getLtIndex() == null || ref.getRbIndex() == null) {
      throw new SSErrorXelException(SSError.REF);
    }
    return super.getCells();
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.engine.xel.Ref2d

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.