Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Worksheet


      //Note when use cache, do not use setRowfreeze/setColumnfreeze (cause invalidate)
      _rowFreeze = rowfreeze;
      _colFreeze = colfreeze;
    }
   
    Worksheet sheet = _selectedSheet;
   
    String css = getDynamicMediaURI(this, _cssVersion++, "ss_" + this.getUuid() + "_" + getSelectedSheetId(), "css");
    smartUpdate("scss", css);
    if (!cacheInClient)  {
     
      smartUpdate("rowFreeze", getRowfreeze());
      smartUpdate("columnFreeze", getColumnfreeze());
     
      //handle AutoFilter
      Map afmap = convertAutoFilterToJSON(sheet.getAutoFilter());
      if (afmap != null) {
        smartUpdate("_autoFilter", afmap);
      } else {
        smartUpdate("_autoFilter", (String) null);
      }
     
      smartUpdate("rowHeight", getRowheight());
      smartUpdate("columnWidth", getColumnwidth());
     
      smartUpdate("displayGridlines", !_hideGridlines);
      smartUpdate("protect", _protectSheet);
     
      // generate customized row & column information
      HeaderPositionHelper colHelper = getColumnPositionHelper(sheet);
      HeaderPositionHelper rowHelper = getRowPositionHelper(sheet);
      smartUpdate("csc", getSizeHelperStr(colHelper));
      smartUpdate("csr", getSizeHelperStr(rowHelper));
     
      // generate merge range information
      MergeMatrixHelper mmhelper = getMergeMatrixHelper(sheet);
      Iterator iter = mmhelper.getRanges().iterator();
      StringBuffer merr = new StringBuffer();
      while (iter.hasNext()) {
        MergedRect block = (MergedRect) iter.next();
        int left = block.getLeft();
        int top = block.getTop();
        int right = block.getRight();
        int bottom = block.getBottom();
        int id = block.getId();
        merr.append(left).append(",").append(top).append(",").append(right).append(",").append(bottom).append(",").append(id);
        if (iter.hasNext()) {
          merr.append(";");
        }
      }
      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) {
        smartUpdate("dataValidations", dvs);
      } else {
        smartUpdate("dataValidations", (String) null);
      }
View Full Code Here


   * @return the row freeze of this spreadsheet or selected sheet.
   */
  public int getRowfreeze() {
    if (_rowFreezeset)
      return _rowFreeze;
    final Worksheet sheet = getSelectedSheet();
    if (sheet != null) {
       if (BookHelper.isFreezePane(sheet)) { //issue #103: Freeze row/column is not correctly interpreted
         _rowFreeze = BookHelper.getRowFreeze(sheet) - 1;
       }
      _rowFreezeset = true;
View Full Code Here

   * @return the column freeze of this spreadsheet or selected sheet.
   */
  public int getColumnfreeze() {
    if (_colFreezeset)
      return _colFreeze;
    Worksheet sheet = getSelectedSheet();
    if (sheet != null) {
       if (BookHelper.isFreezePane(sheet)) {//issue #103: Freeze row/column is not correctly interpreted
         _colFreeze = BookHelper.getColumnFreeze(sheet) - 1;
       }
      _colFreezeset = true;
View Full Code Here

  /**
   * Gets the default row height of the selected sheet
   * @return default value depends on selected sheet
   */
  public int getRowheight() {
    Worksheet sheet = getSelectedSheet();
    int rowHeight = sheet != null ? sheet.getDefaultRowHeight() : -1;

    return (rowHeight <= 0) ? _defaultRowHeight : Utils.twipToPx(rowHeight);
  }
View Full Code Here

  /**
   * Sets the default row height of the selected sheet
   * @param rowHeight the row height
   */
  public void setRowheight(int rowHeight) {
    Worksheet sheet = getSelectedSheet();
    int rowHeightTwip = Utils.pxToTwip(rowHeight);
    int dh = sheet.getDefaultRowHeight();

    if (dh != rowHeightTwip) {
      sheet.setDefaultRowHeight((short)rowHeightTwip);
      invalidate();
      /**
       * rename rowh -> rowHeight, not implement yet
       */
      //smartUpdate("rowHeight", rowHeight);
View Full Code Here

  /**
   * Gets the default column width of the selected sheet
   * @return default value depends on selected sheet
   */
  public int getColumnwidth() {
    final Worksheet sheet = getSelectedSheet();
    return Utils.getDefaultColumnWidthInPx(sheet);
  }
View Full Code Here

  /**
   * Sets the default column width of the selected sheet
   * @param columnWidth the default column width
   */
  public void setColumnwidth(int columnWidth) {
    final Worksheet sheet = getSelectedSheet();
    int dw = sheet.getDefaultColumnWidth();
    if (dw != columnWidth) {
      sheet.setDefaultColumnWidth(columnWidth);
     
      invalidate();
      /**
       * rename colw -> columnWidth , not implement yet
       */
 
View Full Code Here

      //smartUpdate("columnWidth", columnWidth);
    }
  }
 
  private int getDefaultCharWidth() {
    final Worksheet sheet = getSelectedSheet();
    return Utils.getDefaultCharWidth(sheet);
  }
View Full Code Here

      }
      final Map addrmap = new HashMap();
      final int left = addr.getFirstColumn();
      final int right = addr.getLastColumn();
      final int top = addr.getFirstRow();
      final Worksheet sheet = this.getSelectedSheet();
      addrmap.put("left", left);
      addrmap.put("top", top);
      addrmap.put("right", right);
      addrmap.put("bottom", addr.getLastRow());
     
View Full Code Here

      final CellRangeAddress addr = addrList.getCellRangeAddress(j);
      final int left = addr.getFirstColumn();
      final int right = addr.getLastColumn();
      final int top = addr.getFirstRow();
      final int bottom = addr.getLastRow();
      final Worksheet sheet = this.getSelectedSheet();
      final Map<String, Integer> addrmap = new HashMap<String, Integer>();
      addrmap.put("left", left);
      addrmap.put("top", top);
      addrmap.put("right", right);
      addrmap.put("bottom", bottom);
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.Worksheet

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.