Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Sheet


  }

  public void testInsertColumnsWidth() {
    final String nm = "colwidth.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    int widthA = sheet1.getColumnWidth(0);
    int widthB = sheet1.getColumnWidth(1);
    int widthC = sheet1.getColumnWidth(2);
   
    sheet1.insertColumns(1,3);
   
    assertEquals(widthA, sheet1.getColumnWidth(0));
    assertTrue(widthB != sheet1.getColumnWidth(1));
    assertTrue(widthC != sheet1.getColumnWidth(2));
    assertEquals(widthB, sheet1.getColumnWidth(4));
    assertEquals(widthC, sheet1.getColumnWidth(5));
  }
View Full Code Here


 
  /*package*/ boolean moveToNewRow(RowIndex dstri, int left, int right, Map changed) {
    final CellIndex dstci = dstri.getCellIndex(getColumn());
    moveCell(dstci);
    final Matrix matrix = _rowIndex.getMatrix();
    final Sheet sheet = matrix.getSheet();
    if (_ltRefs != null) {
      if (matrix.isUiRelated()) {
        for(int j = _ltRefs.size() - 1; j >= 0; --j) {
          final Ref2d ref = (Ref2d) _ltRefs.get(j);
          if (ref.getBottom() >= dstri.getRow() //not overly moved and in range
View Full Code Here

    final CellIndex dstci = _rowIndex.getCellIndex(getColumn() + offset);
    if (dstci.isEmpty() && offset < 0) {
      ++indexdiff;
    }
    final Matrix matrix = _rowIndex.getMatrix();
    final Sheet sheet = matrix.getSheet();
    moveCell(dstci);
    if (_ltRefs != null) {
      if (matrix.isUiRelated()) {
        for(int j = _ltRefs.size() - 1; j >= 0; --j) {
          final Ref2d ref = (Ref2d) _ltRefs.get(j);
View Full Code Here

  }
 
  /*package*/ boolean moveToNewBoth(RowIndex dstri, int left, int top, int right, int bottom,
  int coloffset, int rowoffset, Set ltRefs, Map changed) {
    final Matrix matrix = _rowIndex.getMatrix();
    final Sheet sheet = matrix.getSheet();
    final CellIndex dstci = dstri.getCellIndex(getColumn()+coloffset);
    if (_rbRefs != null) {
      final int sz = _rbRefs.size();
      if (matrix.isUiRelated()) {
        for(int j = 0; j < sz; ++j) {
View Full Code Here

  /*package*/ Collection getIntersectRef3ds(int row, int col, int sheetIndex, Collection lst) {
    if (_ltRefs != null) {
      final BookImpl book = (BookImpl)((Matrix3d)getMatrix()).getBook();
      for(final Iterator it = _ltRefs.iterator(); it.hasNext();) {
        final Ref3d ref = (Ref3d) it.next();
        final Sheet bsheet = ref.getSheet();
        final Sheet esheet = ref.getSheetTo();
        final int[] indexes = book.getSheetIndexes(bsheet, esheet);
        final int bi = indexes[0];
        final int ei = indexes[1];
        final int refr = ref.getRight();
        final int refb = ref.getBottom();
View Full Code Here

  static public String getCelltext(Spreadsheet ss,int row,int column){
    /*List list = ss.getBook().getSheets();
    if(list.size()<=ss.getSelectedIndex()){
      throw new XelException("No such sheet :"+ss.getSelectedIndex());
    }*/
    Sheet sheet = ss.getSelectedSheet();
   
    Cell cell = sheet.getCell(row,column);
   
    if(cell==null) return "";
   
    Object value = cell.getText();
    String txt = value==null?"":value.toString();
View Full Code Here

    max = max<=10?max-1:10;
   
    int row_top = getRowBegin(ss).intValue();
    int row_bottom = getRowEnd(ss).intValue();
   
    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();
View Full Code Here

  }
 
  public int getSheetIndex(Sheet b) {
    int bi = -1;
    for (int j = _sheets.size() - 1;  j >= 0; --j) {
      final Sheet sheet = (Sheet) _sheets.get(j);
      if (b == sheet) {
        bi = j;
        break;
      }
    }
View Full Code Here

 
  public int[] getSheetIndexes(Sheet b, Sheet e) {
    int bi = -1;
    int ei = -1;
    for (int j = _sheets.size() - 1;  j >= 0; --j) {
      final Sheet sheet = (Sheet) _sheets.get(j);
      if (b == sheet) {
        bi = j;
        break;
      } else if (e == sheet) {
        ei = j;
View Full Code Here

    return SHEET_ID_PREFIX + (++_sheetIdSeed);
  }
 
  //Internal Use Only. Useed by SheetImpl to notify sheet name changes
  /*package*/ void updateSheetName(String oldnm, String newnm) {
    final Sheet sheet = (Sheet) _sheetMap.remove(oldnm);
    if (sheet != null) {
      _sheetMap.put(newnm, sheet);
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.Sheet

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.