Package org.zkoss.zss.model.impl

Examples of org.zkoss.zss.model.impl.SheetImpl


  }

  protected void setUp() throws Exception {
    super.setUp();
    _book = new BookImpl("Mybook");
    _sheet = new SheetImpl(_book, "Sheet1", 256, 64*1024);
  }
 
View Full Code Here


  }

  protected void setUp() throws Exception {
    super.setUp();
    final Book book = new BookImpl("Mybook");
    _sheet = new SheetImpl(book, "Sheet1", 256, 64*1024);
  }
 
View Full Code Here

   * @see junit.framework.TestCase#setUp()
   */
  protected void setUp() throws Exception {
    super.setUp();
    final Book book = new BookImpl("Mybook");
    _sheet = new SheetImpl(book, "Sheet1", 256, 64*1024);
    _im = ((SheetImpl)_sheet).getMatrix();
   
    _ref1 = (Ref2d)_im.addRef(_sheet, null, 1, 2, 2, 4); //B3:C5
    _ref2 = (Ref2d)_im.addRef(_sheet, null, 3, 7, 4, 10); //D8:E11
  }
View Full Code Here

    if (type == TokenType.OPERAND && subtype == TokenSubtype.RANGE) {
      //prepare the original Reference
      final Reference orgref = ctx != null ?
        (Reference) ctx.getVariableResolver().resolveVariable("zkoss.ss.Ref") : null;
      final SheetImpl sheet =  orgref != null ?
        (SheetImpl) orgref.getSheet() : null;
      final Book book = sheet != null ?
        sheet.getBook() : (ctx instanceof Book) ? (Book) ctx : null;

      final String[] range = parseRange(value);
      final String sheetnm1 = range[0];
      final String sheetnm2 = range[1];
      final String cell1 = range[2];
      final String cell2 = range[3];

      int[] lt = null;
      int[] rb = null;
      boolean var1 = false;
      boolean var2 = false;

      lt = parseCell(cell1);
      var1 = (lt == null);

      if (cell2 != null) {
        rb = parseCell(cell2);
        var2 = (lt == null);
      } else { //cell2 == null
        // cell1 is single col but cell2 is not available, should be a variable
        if (!var1 && lt[1] == -1) {
          var1 = true;
        }
      }
      if (lt != null && rb != null) {
        int l = lt[0];
        int t = lt[1];
        int absl = lt[2];
        int abst = lt[3];
       
        int r = rb[0];
        int b = rb[1];
        int absr = rb[2];
        int absb = rb[3];
       
        if (l > r) {
          int tmp = l;
          l = r;
          r = tmp;
         
          tmp = absl;
          absl = absr;
          absr = tmp;
         
          lt[0] = l;
          lt[2] = absl;
          rb[0] = r;
          rb[2] = absr;
        }
       
        if (t > b) {
          int tmp = t;
          t = b;
          b = tmp;
         
          tmp = abst;
          abst = absb;
          absb = tmp;
         
          lt[1] = t;
          lt[3] = abst;
          rb[1] = b;
          rb[3] = absb;
        }
      }
      final SheetImpl psheet1 = (book != null && sheetnm1 != null) ?
          (SheetImpl)book.lookupSheet(sheetnm1) : sheet;
      final SheetImpl psheet2 = (book != null && sheetnm2 != null) ?
          (SheetImpl)book.lookupSheet(sheetnm2) : sheet;
//      final SheetImpl psheet1 = sheet1 != null ? sheet1 : sheet;
//      final SheetImpl psheet2 = sheet2 != null ? sheet2 : sheet;
      final boolean abssheet = book != null && (sheetnm1 != null || sheetnm2 != null);
     
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.impl.SheetImpl

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.