Package org.zkoss.zss.ui.impl

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


     
     
      //remove merge before a new column or row
      removeAffectedMergeRange(sheet,0,col);

      JSONObj result = new JSONObj();
      result.setData("type","column");
      result.setData("col",col);
      result.setData("size",size);
     
      List extnm = new ArrayList();
      int right = size+_loadedRect.getRight();
      for(int i=col;i<=right;i++){
        extnm.add(getColumntitle(i));
      }
      result.setData("extnm", extnm);
     
      HeaderPositionHelper colHelper = Spreadsheet.this.getColumnPositionHelper(sheet);
     
      colHelper.shiftMeta(col,size);
      _maxColumns += size;
      int cf = getColumnfreeze();
      if(cf>=col){
        _colFreeze += size;
      }
     
      result.setData("maxcol", _maxColumns);
      result.setData("colfreeze", _colFreeze);
     
      smartUpdateValues("insertrc_"+Utils.nextUpdateId(),new Object[]{"",Utils.getId(sheet),result.toString()});
     
      _loadedRect.setRight(right);
     
      //update surround cell
      int left = col;
View Full Code Here


      //let client handle it
     
      //remove merge before a new column or row
      removeAffectedMergeRange(sheet,1,row);
     
      JSONObj result = new JSONObj();
      result.setData("type","row");
      result.setData("row",row);
      result.setData("size",size);
     
      List extnm = new ArrayList();
      int bottom = size+_loadedRect.getBottom();
      for(int i=row;i<=bottom;i++){
        extnm.add(getRowtitle(i));
      }
      result.setData("extnm", extnm);
     
      HeaderPositionHelper rowHelper = Spreadsheet.this.getRowPositionHelper(sheet);
      rowHelper.shiftMeta(row,size);
      _maxRows += size;
      int rf = getRowfreeze();
      if(rf>=row){
        _rowFreeze += size;
      }
     
      result.setData("maxrow", _maxRows);
      result.setData("rowfreeze", _rowFreeze);
     
      smartUpdateValues("insertrc_"+Utils.nextUpdateId(),new Object[]{"",Utils.getId(sheet),result.toString()});
     
      _loadedRect.setBottom(bottom);
     
     
      //update surround cell
View Full Code Here

     
     
      //remove merge before a new column or row
      removeAffectedMergeRange(sheet,0,col);
     
      JSONObj result = new JSONObj();
      result.setData("type","column");
      result.setData("col",col);
      result.setData("size",size);
     
      List extnm = new ArrayList();
     
      int right = _loadedRect.getRight() - size;
      if(right<col){
        right = col - 1;
      }
      for(int i=col;i<=right;i++){
        extnm.add(getColumntitle(i));
      }
      result.setData("extnm", extnm);
     
      HeaderPositionHelper colHelper = Spreadsheet.this.getColumnPositionHelper(sheet);
      colHelper.unshiftMeta(col,size);
     
     
      _maxColumns -= size;
      int cf = getColumnfreeze();
      if(cf>-1 && col<=cf){
        if(col+size>cf){
          _colFreeze = col-1;
        }else{
          _colFreeze -=size;
        }
      }
     
      result.setData("maxcol", _maxColumns);
      result.setData("colfreeze", _colFreeze);
     
      smartUpdateValues("removerc_"+Utils.nextUpdateId(),new Object[]{"",Utils.getId(sheet),result.toString()});
     
      _loadedRect.setRight(right);
     
      //update surround cell
      int left = col;
View Full Code Here

      //let client handle it
     
      //remove merge before a new column or row
      removeAffectedMergeRange(sheet,1,row);
     
      JSONObj result = new JSONObj();
      result.setData("type","row");
      result.setData("row",row);
      result.setData("size",size);
     
      List extnm = new ArrayList();
     
      int bottom = _loadedRect.getBottom() - size;
      if(bottom<row){
        bottom = row - 1;
      }
      for(int i=row;i<=bottom;i++){
        extnm.add(getRowtitle(i));
      }
      result.setData("extnm", extnm);
     
      HeaderPositionHelper rowHelper = Spreadsheet.this.getRowPositionHelper(sheet);
      rowHelper.unshiftMeta(row,size);
     
     
      _maxRows -= size;
      int rf = getRowfreeze();
      if(rf>-1 && row<=rf){
        if(row+size>rf){
          _rowFreeze = row-1;
        }else{
          _rowFreeze -=size;
        }
      }
     
      result.setData("maxrow", _maxRows);
      result.setData("rowfreeze", _rowFreeze);
     
      smartUpdateValues("removerc_"+Utils.nextUpdateId(),new Object[]{"",Utils.getId(sheet),result.toString()});
     
      _loadedRect.setBottom(bottom);
     
      //update surround cell
      int top = row;
View Full Code Here

      }
      updateCell(sheet,left>0?left-1:0,top>1?top-1:0,right+1,bottom+1);
    }
   
    private void updateMergeCell0(Sheet sheet,MergedRect block,String type){
      JSONObj result = new JSONObj();
      result.setData("type", type);
      result.setData("id", block.getId());
      int left = block.getLeft();
      int top = block.getTop();
      int right = block.getRight();
      int bottom = block.getBottom();
     
      //don't check range to ignore update case,
      //because I still need to sync merge cell data to client side
     
      result.setData("left", left);
      result.setData("top", top);
      result.setData("right", right);
      result.setData("bottom", bottom);
     
      HeaderPositionHelper helper = Spreadsheet.this.getColumnPositionHelper(sheet);
      int w = helper.getStartPixel(block.getRight()+1)-helper.getStartPixel(block.getLeft());
      result.setData("width",w);
     
      smartUpdateValues("merge_"+Utils.nextUpdateId(),new Object[]{"",Utils.getId(sheet),result.toString()});
    }
View Full Code Here

      updateCell(sheet,left>0?left-1:0,top>1?top-1:0,right+1,bottom+1);
     
    }

    public void setColumnWidth(Sheet sheet, int col, int width,int id) {
      JSONObj result = new JSONObj();
      result.setData("type", "column");
      result.setData("column",col);
      result.setData("width",width);
      result.setData("id",id);
      smartUpdateValues("size_col"+col,new Object[]{"",Utils.getId(sheet),result.toString()});
    }
View Full Code Here

      result.setData("id",id);
      smartUpdateValues("size_col"+col,new Object[]{"",Utils.getId(sheet),result.toString()});
    }

    public void setRowHeight(Sheet sheet, int row, int height,int id) {
      JSONObj result = new JSONObj();
      result.setData("type", "row");
      result.setData("row",row);
      result.setData("height",height);
      result.setData("id",id);
      smartUpdateValues("size_row"+row,new Object[]{"",Utils.getId(sheet),result.toString()});
    }
View Full Code Here

    */

  }
 
  private String ackResult(){
    JSONObj jresult = new JSONObj();
    jresult.setData("type","ack");
    return jresult.toString();
  }
View Full Code Here

    jresult.setData("type","ack");
    return jresult.toString();
  }
 
  private String ackError(String message){
    JSONObj jresult = new JSONObj();
    jresult.setData("type","error");
    jresult.setData("message",message);
    return jresult.toString();
  }
View Full Code Here

    return jresult.toString();
  }
 
 
  private String pruneResult(String dir,int reserve){
    JSONObj jresult = new JSONObj();
    jresult.setData("type","prune");
    jresult.setData("dir",dir);
    jresult.setData("reserve",reserve);
    return jresult.toString();
  }
View Full Code Here

TOP

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

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.