Package org.zkoss.zss.ui.impl

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


      Sheet sheet = getSelectedSheet();
      MergeMatrixHelper mmhelper = getMergeMatrixHelper(sheet);
      //Cell cell = sheet.getCell(row,col);
      //if(cell!=null){
        boolean islefttop = mmhelper.isMergeRangeLeftTop(row, col);
        MergedRect block;
       
        if(islefttop){
          //System.out.println("1>>>>>"+row+","+col+">>zsmerge");
          block = mmhelper.getMergeRange(row, col);
          sb.append(" zsmerge").append(block.getId());
        }else if((block = mmhelper.getMergeRange(row, col)) != null){
          //System.out.println("2>>>>>"+row+","+col+">>zsmergee");
          sb.append(" zsmergee");
        }else{
          //System.out.println("3>>>>>"+row+","+col);
View Full Code Here


        if (cfh.hasRightBorder()){
          HTMLs.appendAttribute(sb, "z.rbo", "t");
        }
      }
     
      MergedRect block;
      if((block = matrix.getMergeRange(row, col)) != null){
        HTMLs.appendAttribute(sb, "z.merr",block.getRight());
        HTMLs.appendAttribute(sb, "z.merid",block.getId());
        HTMLs.appendAttribute(sb, "z.merl", block.getLeft());
      }
     
      return sb.toString();
    }
View Full Code Here

        mmhelper.deleteAffectedMergeRangeByRow(index,toremove);
      }else{
        return;
      }
      for(Iterator iter = toremove.iterator();iter.hasNext();){
        MergedRect block = (MergedRect)iter.next();
        updateMergeCell0(sheet,block,"remove");
      }
    }
View Full Code Here

    public void deleteMergeCell(Sheet sheet,int left,int top,int right,int bottom){
      MergeMatrixHelper mmhelper = this.getMergeMatrixHelper(sheet);
      List torem = new ArrayList();
      mmhelper.deleteMergeRange(left,top,right,bottom,torem);
      for(Iterator iter = torem.iterator();iter.hasNext();){
        MergedRect rect = (MergedRect)iter.next();
        log.debug("(R)remove merge:"+rect);
        updateMergeCell0(sheet,rect,"remove");
      }
      updateCell(sheet,left>0?left-1:0,top>1?top-1:0,right+1,bottom+1);
    }
View Full Code Here

     
      List toadd = new ArrayList();
      List torem = new ArrayList();
      mmhelper.addMergeRange(left,top,right,bottom,toadd,torem);
      for(Iterator iter = torem.iterator();iter.hasNext();){
        MergedRect rect = (MergedRect)iter.next();
        log.debug("(A)remove merge:"+rect);
        updateMergeCell0(sheet,rect,"remove");
      }
      for(Iterator iter = toadd.iterator();iter.hasNext();){
        MergedRect rect = (MergedRect)iter.next();
        log.debug("add merge:"+rect);
        updateMergeCell0(sheet,rect,"add");
      }
      updateCell(sheet,left>0?left-1:0,top>1?top-1:0,right+1,bottom+1);
     
View Full Code Here

      if (cfh.hasRightBorder()){
        jcell.setData("rbo",true);//format
      }
    }
   
    MergedRect rect = _mergeMatrix.getMergeRange(row, col);
    if((rect != null)){
      jcell.setData("merr",rect.getRight());//right
      jcell.setData("merid",rect.getId());//right
      jcell.setData("merl",rect.getLeft());//left
    }
   
    int[] meta = _colHelper.getMeta(col);
    if(meta!=null){
      jcell.setData("zsw", meta[2]);
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

    //merge size;
    List ranges = mmhelper.getRanges();
    Iterator iter = ranges.iterator();

    while(iter.hasNext()){
      MergedRect block = (MergedRect)iter.next();
      int left = block.getLeft();
      //int top = range.getTop();
      int right = block.getRight();
      //int bottom = range.getBottom();
     
      int width=0;
      for(int i=left;i<=right;i++){
        width += colHelper.getSize(i);
      }
     
      celltextwidth = width - 2*cp - 1;// 1 is border width
     
      if(!isGecko){
        cellwidth = celltextwidth;
      }else{
        cellwidth = width;
      }
     
      sb.append(name).append(" .zsmerge").append(block.getId()).append("{\n");
      sb.append("width:").append(cellwidth).append("px;");
      sb.append("}\n");
     
      sb.append(name).append(" .zsmerge").append(block.getId());
      sb.append(" .zscelltxt").append("{\n");
      sb.append("width:").append(celltextwidth).append("px;");
      sb.append("}\n");
    }
   
View Full Code Here

    public void deleteMergeCell(Worksheet sheet, int left, int top, int right, int bottom) {
      MergeMatrixHelper mmhelper = this.getMergeMatrixHelper(sheet);
      Set torem = new HashSet();
      mmhelper.deleteMergeRange(left, top, right, bottom, torem);
      for (Iterator iter = torem.iterator(); iter.hasNext();) {
        MergedRect rect = (MergedRect) iter.next();

        updateMergeCell0(sheet, rect, "remove");
      }
      //updateCell(sheet, left > 0 ? left - 1 : 0, top > 1 ? top - 1 : 0, right + 1, bottom + 1);
      updateCell(sheet, left, top, right, bottom);
View Full Code Here

      Set toadd = new HashSet();
      Set torem = new HashSet();
      mmhelper.addMergeRange(left, top, right, bottom, toadd, torem);
      for (Iterator iter = torem.iterator(); iter.hasNext();) {
        MergedRect rect = (MergedRect) iter.next();
        log.debug("(A)remove merge:" + rect);
        updateMergeCell0(sheet, rect, "remove");
      }
      for (Iterator iter = toadd.iterator(); iter.hasNext();) {
        MergedRect rect = (MergedRect) iter.next();
        log.debug("add merge:" + rect);
        updateMergeCell0(sheet, rect, "add");
      }
//      updateCell(sheet, left > 0 ? left - 1 : 0, top > 1 ? top - 1 : 0, right + 1, bottom + 1);
      updateCell(sheet, left, top, right, bottom);
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.