Package org.zkoss.zss.ui.sys

Examples of org.zkoss.zss.ui.sys.SpreadsheetCtrl


    int bottom = (Integer) data.get("bottom");
   
    Worksheet sheet = spreadsheet.getSelectedSheet();
   
    if (sheetId.equals(((SheetCtrl)sheet).getUuid())) {
      final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) spreadsheet.getExtraCtrl());
     
      JSONObject mainBlock = spreadsheetCtrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL, left, top, right, bottom);
      if (spreadsheet.getColumnfreeze() >= 0) {
        mainBlock.put("leftFrozen",
            spreadsheetCtrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL, 0, top, spreadsheet.getColumnfreeze(), bottom));
      }
      if (spreadsheet.getRowfreeze() >= 0) {
        mainBlock.put("topFrozen",
            spreadsheetCtrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL, left, 0, right, spreadsheet.getRowfreeze()));
      }
      spreadsheet.smartUpdate("activeRangeUpdate", mainBlock);
    }
  }
View Full Code Here


      rangeTop = _mergeMatrix.getTopConnectedRow(newTop, rangeLeft, rangeRight);
      rangeBtm = _mergeMatrix.getBottomConnectedRow(newBtm, rangeLeft, rangeRight);
    }

   
    final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) _spreadsheet.getExtraCtrl());
    JSONObject mainBlock = spreadsheetCtrl.getRangeAttrs(sheet,
        header, SpreadsheetCtrl.CellAttribute.ALL, rangeLeft, rangeTop, rangeRight, rangeBtm);
    mainBlock.put("dir", "jump");
    json.put("data", mainBlock);
   
    _lastleft = left;
    _lastright = right;
    _lasttop = top;
    _lastbottom = bottom;
   
    _loadedLeft = rangeLeft;
    _loadedRight = rangeRight;
    _loadedTop = rangeTop;
    _loadedRight = rangeBtm;
   
    // prepare top frozen cell
    int fzr = _spreadsheet.getRowfreeze();
    if (fzr > -1) {
      mainBlock.put("topFrozen", spreadsheetCtrl.getRangeAttrs(sheet,
          header, SpreadsheetCtrl.CellAttribute.ALL, rangeLeft, 0, rangeRight, fzr));
    }

    //prepare left frozen cell
    int fzc = _spreadsheet.getColumnfreeze();
    if (fzc > -1) {
      mainBlock.put("leftFrozen", spreadsheetCtrl.getRangeAttrs(sheet,
          header, SpreadsheetCtrl.CellAttribute.ALL, 0, rangeTop, fzc, rangeBtm));
    }
    return json.toString();
  }
View Full Code Here

    json.put("left", cs);
   
    int rangeTop = rangeTopHeight > 0 ? blockTop - rangeTopHeight + 1 : blockTop;
    int rangeRight = rangeWidth > fetchWidth ? cs + rangeWidth - 1 : ce - 1;
    int rangeBottom = rangeBtmHeight < 0 ? blockBottom : blockBottom + rangeBtmHeight - 1;
    final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) _spreadsheet.getExtraCtrl());
    JSONObject mainBlock = spreadsheetCtrl.getRangeAttrs(sheet, _hidecolhead ? SpreadsheetCtrl.Header.NONE : SpreadsheetCtrl.Header.COLUMN,
        SpreadsheetCtrl.CellAttribute.ALL, cs, rangeTop, rangeRight, rangeBottom);
    mainBlock.put("dir", "east");
    json.put("data", mainBlock);
 
    _lastleft = blockLeft;
    _lastright = ce - 1;
    _lasttop = blockTop;
    _lastbottom = blockBottom;

    //process frozen row data
    int fzr = _spreadsheet.getRowfreeze();
    if (fzr > -1) {
      mainBlock.put("topFrozen", spreadsheetCtrl.getRangeAttrs(sheet, _hiderowhead ? SpreadsheetCtrl.Header.NONE : SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL,
          cs, 0, rangeRight, fzr));
    }
    return new LoadResult(cs, rangeTop, rangeRight, rangeBottom, json);
  }
View Full Code Here

    int rangeTop = rangeTopHeight > 0 ? blockTop - rangeTopHeight + 1 : blockTop;
    int rangeLeft = rangeWidth > fetchWidth ? blockLeft - rangeWidth - 1: ce + 1;
    if (rangeLeft < 0)
      rangeLeft = 0;
    int rangeBottom = rangeBtmHeight < 0 ? blockBottom : blockBottom + rangeBtmHeight - 1;
    final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) _spreadsheet.getExtraCtrl());
    JSONObject mainBlock = spreadsheetCtrl.getRangeAttrs(sheet, _hidecolhead ? SpreadsheetCtrl.Header.NONE : SpreadsheetCtrl.Header.COLUMN,
        SpreadsheetCtrl.CellAttribute.ALL, rangeLeft, rangeTop, cs, rangeBottom);
    mainBlock.put("dir", "west");
    json.put("data", mainBlock);
   
    _lastleft = ce+1;
    _lastright = blockRight;
    _lasttop = blockTop;
    _lastbottom = blockBottom;
   
    // process frozen row data
    int fzr = _spreadsheet.getRowfreeze();
    if (fzr > -1) {
      mainBlock.put("topFrozen", spreadsheetCtrl.getRangeAttrs(sheet, _hiderowhead ? SpreadsheetCtrl.Header.NONE : SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL,
          rangeLeft, 0, cs, fzr));
    }
    return new LoadResult(rangeLeft, rangeTop, cs, rangeBottom, json);
  }
View Full Code Here

    json.put("left", blockLeft);
   
    int rangeBottom = Math.min(cacheRangeHeight > fetchHeight ? rs + cacheRangeHeight - 1 : re - 1, _spreadsheet.getMaxrows() - 1);
    rangeLeft = rangeLeft > 0 && rangeLeft < blockLeft ? rangeLeft : blockLeft;
    cacheRight = Math.max(blockRight, cacheRight);
    final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) _spreadsheet.getExtraCtrl());
    JSONObject mainBlock = spreadsheetCtrl.getRangeAttrs(sheet, _hidecolhead ? SpreadsheetCtrl.Header.NONE : SpreadsheetCtrl.Header.ROW, SpreadsheetCtrl.CellAttribute.ALL,
        rangeLeft, rs, cacheRight, rangeBottom);
    mainBlock.put("dir", "south");
    json.put("data", mainBlock);

    _lastleft = blockLeft;
    _lastright = blockRight;
    _lasttop = blockTop;
    _lastbottom = re-1;
   
    // process frozen left
    int fzc = _spreadsheet.getColumnfreeze();
    if (fzc > -1) {
      mainBlock.put("leftFrozen", spreadsheetCtrl.getRangeAttrs(sheet, _hidecolhead ? SpreadsheetCtrl.Header.NONE : SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL,
          0, rs, fzc, rangeBottom));
    }

    return new LoadResult(rangeLeft, rs, cacheRight, rangeBottom, json);
  }
View Full Code Here

   
    int rangeTop = cacheRangeHeight > fetchHeight ? rs - cacheRangeHeight - 1 : re + 1;
    rangeLeft = rangeLeft > 0 && rangeLeft < blockLeft ? rangeLeft : blockLeft;
//    rangeRight = Math.min(Math.max(blockRight, rangeRight), _spreadsheet.getMaxcolumns() - 1);
    rangeRight = Math.max(blockRight, rangeRight);
    final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) _spreadsheet.getExtraCtrl());
    JSONObject mainBlock = spreadsheetCtrl.getRangeAttrs(sheet, _hidecolhead ? SpreadsheetCtrl.Header.NONE : SpreadsheetCtrl.Header.ROW, SpreadsheetCtrl.CellAttribute.ALL,
        rangeLeft, rangeTop, rangeRight, rs);
    mainBlock.put("dir", "north");
    json.put("data", mainBlock);
   
    _lastleft = blockLeft;
    _lastright = blockRight;
    _lasttop = re + 1;
    _lastbottom = blockBottom;
   
    // process frozen left
    int frc = _spreadsheet.getColumnfreeze();
    if (frc > -1) {
      mainBlock.put("leftFrozen", spreadsheetCtrl.getRangeAttrs(sheet, _hidecolhead ? SpreadsheetCtrl.Header.NONE : SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL,
          0, rangeTop, frc, rs));
    }
    return new LoadResult(rangeLeft, rangeTop, rangeRight, rs, json);
  }
View Full Code Here

        }
      }
      smartUpdate("mergeRange", merr.toString());
     
     
      final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) this.getExtraCtrl());
      smartUpdate("activeRange",
          spreadsheetCtrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL, 0, 0,
              getInitColumnSize() , getInitRowSize()));
     
      //handle Validation, must after render("activeRange"
      List<Map> dvs = convertDataValidationToJSON(sheet.getDataValidations());
      if (dvs != null) {
View Full Code Here

      if (iter.hasNext()) {
        merr.append(";");
      }
    }
    renderer.render("mergeRange", merr.toString());
    /**
     * Add attr for UI renderer
     */
    final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) this.getExtraCtrl());
   
    int initColSize = getInitColumnSize();
    int preloadColSize = getPreloadColumnSize();
    int initRowSize = getInitRowSize();
    int preloadRowSize = getPreloadRowSize();
    renderer.render("activeRange",
      spreadsheetCtrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL, 0, 0,
          initColSize , initRowSize));
   
    renderer.render("preloadRowSize", preloadColSize);
    renderer.render("preloadColumnSize", preloadRowSize);
   
View Full Code Here

 
  /**
   * Internal Use Only
   */
  public void updateRange(Worksheet sheet, String sheetId, int left, int top, int right, int bottom) {
    SpreadsheetCtrl ctrl = (SpreadsheetCtrl) getExtraCtrl();
    String ret = ctrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.NONE, SpreadsheetCtrl.CellAttribute.ALL, left, top, right, bottom).toJSONString();
    response(bottom + "_" + right + "_" + _updateRangeId.next(), new AuUpdateData(this, AuUpdateData.UPDATE_RANGE_FUNCTION, "", sheetId, ret));
  }
View Full Code Here

    final String sheetId = Utils.getSheetUuid((Worksheet) cell.getSheet());
    response(row + "_" + col + "_" + _updateCellId.next(), new AuDataUpdate(this, "", sheetId, result));
  }
 
  private void responseUpdateCell(Worksheet sheet, String sheetId, int left, int top, int right, int bottom) {
    SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) this.getExtraCtrl());
    JSONObject result = spreadsheetCtrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.NONE, CellAttribute.ALL, left, top, right, bottom);
    result.put("type", "udcell");
    response(top + "_" + left + "_" + _updateCellId.next(),
        new AuDataUpdate(this, "", sheetId, result));
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.ui.sys.SpreadsheetCtrl

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.