Package org.zkoss.zss.ui.impl.HeaderPositionHelper

Examples of org.zkoss.zss.ui.impl.HeaderPositionHelper.HeaderPositionInfo


      JSONObject attrs = new JSONObject();
//      attrs.put("i", col);//getHeaderAttrs method has provide index info
      attrs.put("t", Spreadsheet.this.getColumntitle(col));

      HeaderPositionHelper colHelper = Spreadsheet.this.getColumnPositionHelper(sheet);
      HeaderPositionInfo info = colHelper.getInfo(col);
      if (info != null) {
        attrs.put("p", info.id);
//        if (info.size != defaultSize) {
//          attrs.put("s", info.size);
//        }
View Full Code Here


      JSONObject attrs = new JSONObject();
//      attrs.put("i", row);//getHeaderAttrs method has provide index info
      attrs.put("t", Spreadsheet.this.getRowtitle(row));

      HeaderPositionHelper rowHelper = Spreadsheet.this.getRowPositionHelper(sheet);
      HeaderPositionInfo info = rowHelper.getInfo(row);
      if (info != null) {
        attrs.put("p", info.id);
//        if (info.hidden)
//          attrs.put("h", 1);
      }
View Full Code Here

      HeaderPositionHelper helper = Spreadsheet.this.getRowPositionHelper(sheet);
      JSONObject attrs = new JSONObject();
      //row num
      attrs.put("r", row);
     
      HeaderPositionInfo info = helper.getInfo(row);
      if (info != null) {
        attrs.put("h", info.id);
        if (info.hidden) {
          attrs.put("hd", "t"); //t stand for true
        }
View Full Code Here

    @Override
    public Boolean getLeftHeaderHiddens(int row) {
      Worksheet sheet = getSelectedSheet();
      HeaderPositionHelper rowHelper = Spreadsheet.this
          .getRowPositionHelper(sheet);
      HeaderPositionInfo info = rowHelper.getInfo(row);
      return info == null ? Boolean.FALSE : Boolean.valueOf(info.hidden);
    }
View Full Code Here

    @Override
    public Boolean getTopHeaderHiddens(int col) {
      Worksheet sheet = getSelectedSheet();
      HeaderPositionHelper colHelper = Spreadsheet.this
          .getColumnPositionHelper(sheet);
      HeaderPositionInfo info = colHelper.getInfo(col);
      return info == null ? Boolean.FALSE : Boolean.valueOf(info.hidden);
    }
View Full Code Here

 
  private void updateColWidth(Worksheet sheet, int col) {
    final int width = Utils.getColumnWidthInPx(sheet, col);
    final boolean newHidden = sheet.isColumnHidden(col);
    HeaderPositionHelper posHelper = getColumnPositionHelper(sheet);
    HeaderPositionInfo info = posHelper.getInfo(col);
    if ((info == null && (width != posHelper.getDefaultSize() || newHidden)) || (info != null && (info.size != width || info.hidden != newHidden))) {
      int id = info == null ? _custColId.next() : info.id;
      posHelper.setInfoValues(col, width, id, newHidden);
      ((ExtraCtrl) getExtraCtrl()).setColumnWidth(sheet, col, width, id, newHidden);
    }
View Full Code Here

  private void updateRowHeight(Worksheet sheet, int row) {
    final int height = Utils.getRowHeightInPx(sheet, row);
    final Row rowobj = sheet.getRow(row);
    final boolean newHidden = rowobj == null ? false : rowobj.getZeroHeight();
    HeaderPositionHelper posHelper = getRowPositionHelper(sheet);
    HeaderPositionInfo info = posHelper.getInfo(row);
    if ((info == null && (height != posHelper.getDefaultSize() || newHidden)) || (info != null && (info.size != height || info.hidden != newHidden))) {
      int id = info == null ? _custRowId.next() : info.id;
      posHelper.setInfoValues(row, height, id, newHidden);
      ((ExtraCtrl) getExtraCtrl()).setRowHeight(sheet, row, height, id, newHidden);
    }
View Full Code Here

     
      for(Row row: sheet) {
        final boolean hidden = row.getZeroHeight();
        final int height = Utils.getRowHeightInPx(sheet, row);
        if (height != defaultSize || hidden) { //special height or hidden
          infos.add(new HeaderPositionInfo(row.getRowNum(), height, _custRowId.next(), hidden));
        }
        final int colnum = row.getLastCellNum() - 1;
        if (colnum > maxcol) {
          maxcol = colnum;
        }
View Full Code Here

        final boolean hidden = sheet.isColumnHidden(j); //whether this column is hidden
        final int fileColumnWidth = sheet.getColumnWidth(j); //file column width
        if (fileColumnWidth != defaultColSize256 || hidden) {
          final int colwidth = fileColumnWidth != defaultColSize256 ?
              Utils.fileChar256ToPx(fileColumnWidth, charWidth) : defaultColSizeInPx;
          infos.add(new HeaderPositionInfo(j, colwidth, _custColId.next(), hidden));
        }
      }

      helpers.putHelper(sheetId, helper = new HeaderPositionHelper(defaultColSizeInPx, infos));
    }
View Full Code Here

      MergedRect block = (MergedRect) iter.next();
      int left = block.getLeft();
      int right = block.getRight();
      int width = 0;
      for (int i = left; i <= right; i++) {
        final HeaderPositionInfo info = colHelper.getInfo(i);
        if (info != null) {
          final boolean hidden = info.hidden;
          final int colSize = hidden ? 0 : info.size;
          width += colSize;
        } else {
          width += defaultSize ;
        }
      }
      int top = block.getTop();
      int bottom = block.getBottom();
      int height = 0;
      for (int i = top; i <= bottom; i++) {
        final HeaderPositionInfo info = rowHelper.getInfo(i);
        if (info != null) {
          final boolean hidden = info.hidden;
          final int rowSize = hidden ? 0 : info.size;
          height += rowSize;
        } else {
View Full Code Here

TOP

Related Classes of org.zkoss.zss.ui.impl.HeaderPositionHelper.HeaderPositionInfo

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.