Package org.zkoss.zss.ui.impl

Examples of org.zkoss.zss.ui.impl.MergedRect


       
        boolean merged = false;
        MergeMatrixHelper mergeHelper = _spreadsheet.getMergeMatrixHelper(sheet);
        for (int r = tRow; r <= bRow; r++) {
          for (int c = lCol; c <= rCol; c++) {
            MergedRect rect = mergeHelper.getMergeRange(r, c);
            if (rect != null) {
              merged = true;
              break;
            }
          }
View Full Code Here


      // 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(";");
        }
      }
View Full Code Here

    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(";");
      }
    }
View Full Code Here

    Iterator iter = ranges.iterator();
    final int defaultSize = colHelper.getDefaultSize();
    final int defaultRowSize = rowHelper.getDefaultSize();

    while (iter.hasNext()) {
      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 {
          height += defaultRowSize ;
        }
      }

      if (width <= 0 || height <= 0) { //total hidden
        sb.append(name).append(" .zsmerge").append(block.getId()).append("{");
        sb.append("display:none;");
        sb.append("}");

        sb.append(name).append(" .zsmerge").append(block.getId());
        sb.append(" .zscelltxt").append("{");
        sb.append("display:none;");
        sb.append("}");
      } else {
        celltextwidth = width - 2 * cp - 1;// 1 is border width
        int celltextheight = height - 1; //1 is border height
 
        if (!isGecko) {
          cellwidth = celltextwidth;
          cellheight = celltextheight;
        } else {
          cellwidth = width;
          cellheight = height;
        }
       
        sb.append(name).append(" .zsmerge").append(block.getId()).append("{");
        sb.append("width:").append(cellwidth).append("px;");
        sb.append("height:").append(cellheight).append("px;");
        sb.append("}");
 
        sb.append(name).append(" .zsmerge").append(block.getId());
        sb.append(" .zscelltxt").append("{");
        sb.append("width:").append(celltextwidth).append("px;");
        sb.append("height:").append(celltextheight).append("px;");
        sb.append("}");
      }
View Full Code Here

 
  private boolean isMergedCell(int tRow, int lCol, int bRow, int rCol) {
    MergeMatrixHelper mmhelper = spreadsheet.getMergeMatrixHelper(spreadsheet.getSelectedSheet());
    for (final Iterator iter = mmhelper.getRanges().iterator(); iter
        .hasNext();) {
      MergedRect block = (MergedRect) iter.next();
      int bt = block.getTop();
      int bl = block.getLeft();
      int bb = block.getBottom();
      int br = block.getRight();
      if (lCol <= bl && tRow <= bt && rCol >= br && bRow >= bb) {
        return true;
      }
    }
    return false;
View Full Code Here

TOP

Related Classes of org.zkoss.zss.ui.impl.MergedRect

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.