Package org.zkoss.zss.ui

Examples of org.zkoss.zss.ui.Rect


   */
  public List getRangesByColumn(int col){
    Iterator iter = _mergeRanges.iterator();
    List result = new ArrayList();
    while(iter.hasNext()){
      Rect rect = (Rect)iter.next();
      int left = rect.getLeft();
      int right = rect.getRight();
      if(left<=col && right>=col){
        result.add(rect);
      }
    }
    return result;
View Full Code Here


  }

  public int getRightConnectedColumn(int col, int top, int bottom) {
    int size = _mergeRanges.size();
    List result = new ArrayList();
    Rect rect;
    for(int i=0;i<size;i++){
      rect = (MergedRect)_mergeRanges.get(i);
      if(rect.getTop()>_frozenRow && (rect.getTop()<top || rect.getBottom()>bottom)){
        continue;
      }
      result.add(rect);
    }
   
    boolean conti = true;
    while(conti){
      conti = false;
      size = result.size();
      for(int i=0;i<size;i++){
        rect = (MergedRect)result.get(i);
        if(rect.getRight()>col && rect.getLeft()<=col){
          col = rect.getRight();
          conti = true;
          result.remove(i);
          break;
        }
      }
View Full Code Here

  }

  public int getLeftConnectedColumn(int col, int top, int bottom) {
    int size = _mergeRanges.size();
    List result = new ArrayList();
    Rect rect;
    for(int i=0;i<size;i++){
      rect = (MergedRect)_mergeRanges.get(i);
      if(rect.getTop()>_frozenRow && (rect.getTop()<top || rect.getBottom()>bottom)){
        continue;
      }
      result.add(rect);
    }
   
    boolean conti = true;
    while(conti){
      conti = false;
      size = result.size();
      for(int i=0;i<size;i++){
        rect = (MergedRect)result.get(i);
        if(rect.getLeft()<col && rect.getRight()>=col){
          col = rect.getLeft();
          conti = true;
          result.remove(i);
          break;
        }
      }
View Full Code Here

    Sheet sheet = ss.getSelectedSheet();
    MergeMatrixHelper mmhelper = ((SpreadsheetCtrl)ss.getExtraCtrl()).getMergeMatrixHelper(sheet);
    List blocks = mmhelper.getRangesByColumn(max);
    Iterator iter = blocks.iterator();
    while(iter.hasNext()){
      Rect rect = (Rect)iter.next();
      int top = rect.getTop();
      //int left = rect.getLeft();
      int right = rect.getRight();
      //int bottom = rect.getBottom();
      if(top<row_top || top<row_bottom){
        continue;
      }
     
View Full Code Here

   */
  public Set getRangesByColumn(int col){
    Iterator iter = _mergeRanges.iterator();
    Set result = new HashSet();
    while(iter.hasNext()){
      Rect rect = (Rect)iter.next();
      int left = rect.getLeft();
      int right = rect.getRight();
      if(left<=col && right>=col){
        result.add(rect);
      }
    }
    return result;
View Full Code Here

  }

  public int getRightConnectedColumn(int col, int top, int bottom) {
    int size = _mergeRanges.size();
    List result = new ArrayList();
    Rect rect;
    for(int i=0;i<size;i++){
      rect = (MergedRect)_mergeRanges.get(i);
      if(rect.getTop()>_frozenRow && (rect.getTop()<top || rect.getBottom()>bottom)){
        continue;
      }
      result.add(rect);
    }
   
    boolean conti = true;
    while(conti){
      conti = false;
      size = result.size();
      for(int i=0;i<size;i++){
        rect = (MergedRect)result.get(i);
        if(rect.getRight()>col && rect.getLeft()<=col){
          col = rect.getRight();
          conti = true;
          result.remove(i);
          break;
        }
      }
View Full Code Here

  }

  public int getLeftConnectedColumn(int col, int top, int bottom) {
    int size = _mergeRanges.size();
    List result = new ArrayList();
    Rect rect;
    for(int i=0;i<size;i++){
      rect = (MergedRect)_mergeRanges.get(i);
      if(rect.getTop()>_frozenRow && (rect.getTop()<top || rect.getBottom()>bottom)){
        continue;
      }
      result.add(rect);
    }
   
    boolean conti = true;
    while(conti){
      conti = false;
      size = result.size();
      for(int i=0;i<size;i++){
        rect = (MergedRect)result.get(i);
        if(rect.getLeft()<col && rect.getRight()>=col){
          col = rect.getLeft();
          conti = true;
          result.remove(i);
          break;
        }
      }
View Full Code Here

  }

  public int getBottomConnectedRow(int row, int left, int right) {
    int size = _mergeRanges.size();
    List result = new ArrayList();
    Rect rect;
    for(int i=0;i<size;i++){
      rect = (MergedRect)_mergeRanges.get(i);
      if(rect.getLeft()>_frozenCol && (rect.getLeft()<left || rect.getRight()>right)){
        continue;
      }
      result.add(rect);
    }
   
    boolean conti = true;
    while(conti){
      conti = false;
      size = result.size();
      for(int i=0;i<size;i++){
        rect = (MergedRect)result.get(i);
        if(rect.getBottom()>row && rect.getTop()<=row){
          row = rect.getBottom();
          conti = true;
          result.remove(i);
          break;
        }
      }
View Full Code Here

  }

  public int getTopConnectedRow(int row, int left, int right) {
    int size = _mergeRanges.size();
    List result = new ArrayList();
    Rect rect;
    for(int i=0;i<size;i++){
      rect = (MergedRect)_mergeRanges.get(i);
      if(rect.getLeft()>_frozenCol && (rect.getLeft()<left || rect.getRight()>right)){
        continue;
      }
      result.add(rect);
    }
   
    boolean conti = true;
    while(conti){
      conti = false;
      size = result.size();
      for(int i=0;i<size;i++){
        rect = (MergedRect)result.get(i);
        if(rect.getTop()<row && rect.getBottom()>=row){
          row = rect.getTop();
          conti = true;
          result.remove(i);
          break;
        }
      }
View Full Code Here

    }
    if (rowIdx == -1) { //can not find number cell, use last cell as chart's value
      rowIdx = selection.getBottom();
      colIdx = selection.getRight();
    }
    return new Rect(colIdx, rowIdx, selection.getRight(), selection.getBottom());
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.ui.Rect

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.