Package org.zkoss.zss.model.event

Examples of org.zkoss.zss.model.event.SSDataEvent


      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


    }
    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

   
    book.notifyChange(new String[] {"ABCD"});
    events = listener.getList();
    assertEquals(1, events.size());

    SSDataEvent event = (SSDataEvent) events.get(0);
    Range rng = event.getRange();
   
    assertEquals(0, rng.getTop()); //row
    assertEquals(0, rng.getLeft()); //column
   
    assertEquals("Hello ZK", sheet1.getCell(rng.getTop(),rng.getLeft()).getText());
View Full Code Here

 
  /*package*/void mySetFormat(Format format, boolean notify) {
    _format = format;
    final Sheet sheet = getSheet();
    if (notify) {
      sheet.getBook().fireSSDataEvent(new SSDataEvent(
        new RangeSimple(sheet, null, getColumn(), getRow(), getColumn(), getRow()),
        SSDataEvent.CONTENTS_CHANGE, SSDataEvent.MOVE_NO));
    }
  }
View Full Code Here

    ((SheetImpl)sheet1).getCell(0,1).setValue(5); //change B1 (1 -> 5) => F6.
System.out.println(Objects.toString(ssl.getList()));
    assertEquals(2, ssl.getList().size());
   
    for(final Iterator it = ssl.getList().iterator(); it.hasNext();) {
      final SSDataEvent evt = (SSDataEvent) it.next();
      final Range rng = evt.getRange();
      if (rng.getLeft() == 1 && rng.getTop() == 0) {
        assertEquals(5d, ((Number)sheet1.getCell(0,1).getResult()).doubleValue(), 0d);
      } else  if (rng.getLeft() == 5 && rng.getTop() == 5) {
        assertEquals(8d, ((Number)sheet1.getCell(5,5).getResult()).doubleValue(), 0d);
      } else {
View Full Code Here

    ((SheetImpl)sheet1).getCell(0,1).setValue(5); //change B1 (1 -> 5) => F6.
System.out.println(Objects.toString(ssl.getList()));
    assertEquals(2, ssl.getList().size());

    for(final Iterator it = ssl.getList().iterator(); it.hasNext();) {
      final SSDataEvent evt = (SSDataEvent) it.next();
      final Range rng = evt.getRange();
      if (rng.getLeft() == 1 && rng.getTop() == 0) {
        assertEquals(5d, ((Number)sheet1.getCell(0,1).getResult()).doubleValue(), 0d);
      } else  if (rng.getLeft() == 5 && rng.getTop() == 5) {
        assertEquals(10d, ((Number)sheet1.getCell(5,5).getResult()).doubleValue(), 0d);
      } else {
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.event.SSDataEvent

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.