Exemplo n.º 1
0
  /**
   * Gets the row record. Usually called by the cell in the specified row in order to determine its
   * size
   *
   * @param r the row
   * @return the RowRecord for the specified row
   */
  RowRecord getRowInfo(int r) {
    if (!rowRecordsInitialized) {
      rowRecords = new RowRecord[getRows()];
      Iterator i = rowProperties.iterator();

      int rownum = 0;
      RowRecord rr = null;
      while (i.hasNext()) {
        rr = (RowRecord) i.next();
        rownum = rr.getRowNumber();
        if (rownum < rowRecords.length) {
          rowRecords[rownum] = rr;
        }
      }

      rowRecordsInitialized = true;
    }

    return r < rowRecords.length ? rowRecords[r] : null;
  }
Exemplo n.º 2
0
  /**
   * Gets the row view for the specified row
   *
   * @param row the row number
   * @return the row format, or the default format if no override is specified
   */
  public CellView getRowView(int row) {
    RowRecord rr = getRowInfo(row);

    CellView cv = new CellView();

    if (rr != null) {
      cv.setDimension(rr.getRowHeight()); // deprecated
      cv.setSize(rr.getRowHeight());
      cv.setHidden(rr.isCollapsed());
      if (rr.hasDefaultFormat()) {
        cv.setFormat(formattingRecords.getXFRecord(rr.getXFIndex()));
      }
    } else {
      cv.setDimension(settings.getDefaultRowHeight());
      cv.setSize(settings.getDefaultRowHeight()); // deprecated
    }

    return cv;
  }