Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Range


   
    List evts = ssl.getList();
    assertEquals(1, evts.size());
   
    SSDataEvent ev = (SSDataEvent)evts.get(0);
    Range org = ev.getRange();

    assertEquals(SSDataEvent.CONTENTS_CHANGE, ev.getType());
    assertEquals(2, org.getLeft());
    assertEquals(1, org.getTop());
    assertEquals(2, org.getRight());
    assertEquals(1, org.getBottom());
  }
View Full Code Here


    List evts = ssl.getList();
    assertEquals(1, evts.size()); //merge_add
   
    SSDataEvent ev = (SSDataEvent) evts.get(0);
    Range rng = ev.getRange();
    int type = ev.getType();
    assertNull(ev.getOriginalRange());
    assertEquals(SSDataEvent.MERGE_ADD, type);
    assertEquals(1, rng.getLeft());
    assertEquals(2, rng.getTop());
    assertEquals(3, rng.getRight());
    assertEquals(4, rng.getBottom());
   
    ssl.getList().clear();
   
    _sheet.unmergeCells(1, 2, 3, 4);
    assertEquals(1, evts.size()); //merge_delete

    ev = (SSDataEvent) evts.get(0);
   
    Range org = ev.getOriginalRange();
   
    type = ev.getType();
    assertNull(ev.getRange());
    assertEquals(SSDataEvent.MERGE_DELETE, type);
    assertEquals(1, org.getLeft());
    assertEquals(2, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(4, org.getBottom());

    assertFalse(_sheet.getCell(2, 1).isMerged());
    assertNull(((SheetImpl)_sheet).getMatrixMerge().getRowIndexIfExists(2));
    assertNull(((SheetImpl)_sheet).getMatrixMerge().getRowIndexIfExists(4));
View Full Code Here

  private static double addsq(double total, Object arg, XelContext ctx) {
    if (arg instanceof SSError) {
      throw new SSErrorXelException((SSError) arg);
    } else if (arg instanceof Range) { // a range, iterator thru available
                      // cells
      final Range rng = (Range) arg;
      final Collection cells = rng.getCells();
      for(final Iterator it = cells.iterator(); it.hasNext();) {
        final Cell cell = (Cell) it.next();
        total = addsq(total, cell.getResult(), (XelContext) cell); // recursive
      }
      return total;
View Full Code Here

    List evts = ssl.getList();
    assertEquals(2, evts.size()); //range_insert, merge_change
   
    SSDataEvent ev = (SSDataEvent) evts.get(1);
    Range org = ev.getOriginalRange();
   
    assertEquals(SSDataEvent.MERGE_CHANGE, ev.getType());
    assertEquals(1, org.getLeft());
    assertEquals(12, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(14, org.getBottom());

    Range mod = ev.getRange();
    assertEquals(2, mod.getLeft());
    assertEquals(12, mod.getTop());
    assertEquals(4, mod.getRight());
    assertEquals(14, mod.getBottom());
   
    merges = _sheet.getMergeRanges();
    merge = (int[]) merges.get(0);
    assertEquals(2, merge[0]);
    assertEquals(12, merge[1]);
View Full Code Here

    List evts = ssl.getList();
    assertEquals(5, evts.size()); //range_insert, contents_change * 3, merge_change
   
    SSDataEvent ev = (SSDataEvent) evts.get(4);
    Range org = ev.getOriginalRange();
   
    assertEquals(SSDataEvent.MERGE_CHANGE, ev.getType());
    assertEquals(1, org.getLeft());
    assertEquals(12, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(14, org.getBottom());

    Range mod = ev.getRange();
    assertEquals(1, mod.getLeft());
    assertEquals(12, mod.getTop());
    assertEquals(4, mod.getRight());
    assertEquals(14, mod.getBottom());
   
   
    merges = _sheet.getMergeRanges();
    merge = (int[]) merges.get(0);
    assertEquals(1, merge[0]);
View Full Code Here

    List evts = ssl.getList();
    assertEquals(3, evts.size()); //range_insert, contents_change, merge_change
   
    SSDataEvent ev = (SSDataEvent) evts.get(2);
    Range org = ev.getOriginalRange();
   
    assertEquals(6, org.getLeft());
    assertEquals(1, org.getTop());
    assertEquals(9, org.getRight());
    assertEquals(1, org.getBottom());

    Range mod = ev.getRange();
    assertEquals(6, mod.getLeft());
    assertEquals(1, mod.getTop());
    assertEquals(10, mod.getRight());
    assertEquals(1, mod.getBottom());
   
    merges = _sheet.getMergeRanges();
    merge = (int[]) merges.get(0);
    assertEquals(6, merge[0]);
    assertEquals(1, merge[1]);
View Full Code Here

    List evts = ssl.getList();
    assertEquals(2, evts.size());
   
    SSDataEvent ev = (SSDataEvent)evts.get(1);
    Range org = ev.getOriginalRange();

    assertEquals(SSDataEvent.MERGE_DELETE, ev.getType());
    assertEquals(1, org.getLeft());
    assertEquals(0, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(0, org.getBottom());

    Range mod = ev.getRange();
    assertNull(mod);
   
  }
View Full Code Here

    List evts = ssl.getList();
    assertEquals(2, evts.size());
   
    SSDataEvent ev = (SSDataEvent)evts.get(1);
    Range org = ev.getOriginalRange();

    assertEquals(SSDataEvent.MERGE_DELETE, ev.getType());
    assertEquals(1, org.getLeft());
    assertEquals(0, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(0, org.getBottom());

    Range mod = ev.getRange();
    assertNull(mod);
  }
View Full Code Here

    assertEquals(1, evts.size());
    SSDataEvent evt = (SSDataEvent) evts.get(0);
    assertEquals(SSDataEvent.RANGE_DELETE, evt.getType());
    assertEquals(SSDataEvent.MOVE_H, evt.getDirection());
   
    final Range rng = new RangeSimple(sheet1, null, 2, -1, 2, -1);
    assertEquals(rng, evt.getRange());
  }
View Full Code Here

    cell.setValue(new Double(1));
    assertEquals(TextHAlign.CENTER, cell.getTextHAlign());
    cell.setValue("a string");
    assertEquals(TextHAlign.CENTER, cell.getTextHAlign());
   
    Range rng = new RangeSimple(_sheet, null, 0, 2, 0, 2); //A3
    rng.copy(new RangeSimple(_sheet, null, 0, 3, 2, 3)); //A4:C4
   
    for (int j = 0; j < 3; ++j) {
      Cell cellA4 = ((SheetImpl)_sheet).getCell(3,j); //A4 ~ C4
      FormatImpl fm2 = (FormatImpl) cellA4.getFormat();
     
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.