Examples of RowRecord


Examples of org.apache.poi.hssf.record.RowRecord

    public void collapseRow( int rowNumber )
    {

        // Find the start of the group.
        int startRow = findStartOfRowOutlineGroup( rowNumber );
        RowRecord rowRecord = (RowRecord) getRow( startRow );

        // Hide all the columns until the end of the group
        int lastRow = writeHidden( rowRecord, startRow, true );

        // Write collapse field
        if (getRow(lastRow + 1) != null)
        {
            getRow(lastRow + 1).setColapsed( true );
        }
        else
        {
            RowRecord row = createRow( lastRow + 1);
            row.setColapsed( true );
            insertRow( row );
        }
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

     * @return RowRecord created for the passed in row number
     * @see org.apache.poi.hssf.record.RowRecord
     */
    public static RowRecord createRow(int row)
    {
        RowRecord rowrec = new RowRecord();

        //rowrec.setRowNumber(( short ) row);
        rowrec.setRowNumber(row);
        rowrec.setHeight(( short ) 0xff);
        rowrec.setOptimize(( short ) 0x0);
        rowrec.setOptionFlags(( short ) 0x100)// seems necessary for outlining
        rowrec.setXFIndex(( short ) 0xf);
        return rowrec;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

        if (!isRowGroupCollapsed(idx))
            return;

        // Find the start of the group.
        int startIdx = findStartOfRowOutlineGroup( idx );
        RowRecord row = getRow( startIdx );

        // Find the end of the group.
        int endIdx = findEndOfRowOutlineGroup( idx );

        // expand:
        // colapsed bit must be unset
        // hidden bit gets unset _if_ surrounding groups are expanded you can determine
        //   this by looking at the hidden bit of the enclosing group.  You will have
        //   to look at the start and the end of the current group to determine which
        //   is the enclosing group
        // hidden bit only is altered for this outline level.  ie.  don't uncollapse contained groups
        if ( !isRowGroupHiddenByParent( idx ) )
        {
            for ( int i = startIdx; i <= endIdx; i++ )
            {
                if ( row.getOutlineLevel() == getRow( i ).getOutlineLevel() )
                    getRow( i ).setZeroHeight( false );
                else if (!isRowGroupCollapsed(i))
                    getRow( i ).setZeroHeight( false );
            }
        }
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

    {
        this.rowNum = rowNum;
        cells = new HashMap(10);   // new ArrayList(INITIAL_CAPACITY);
        this.book = book;
        this.sheet = sheet;
        row = new RowRecord();
        row.setHeight((short) 0xff);
        row.setLastCol((short) -1);
        row.setFirstCol((short) -1);

        // row.setRowNumber(rowNum);
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

    public RowRecord getRow(int rownum)
    {

        // Integer integer = new Integer(rownum);
        RowRecord row = new RowRecord();

        row.setRowNumber(( short ) rownum);
        return ( RowRecord ) records.get(row);
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

    /** Performs a deep clone of the record*/
    public Object clone() {
      RowRecordsAggregate rec = new RowRecordsAggregate();
      for (Iterator rowIter = getIterator(); rowIter.hasNext();) {
        //return the cloned Row Record & insert
        RowRecord row = (RowRecord)((RowRecord)rowIter.next()).clone();
        rec.insertRow(row);
      }
      return rec;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

  public void testMovingMergedRegion() {
    List records = new ArrayList();
   
    MergeCellsRecord merged = new MergeCellsRecord();
    merged.addArea(0, (short)0, 1, (short)2);
    records.add(new RowRecord());
    records.add(new RowRecord());
    records.add(new RowRecord());
    records.add(merged);
   
    Sheet sheet = Sheet.createSheet(records, 0);
    sheet.records.remove(0);
   
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

   * Makes sure all rows registered for this sheet are aggregated, they were being skipped
   *
   */
  public void testRowAggregation() {
    List records = new ArrayList();
    RowRecord row = new RowRecord();
    row.setRowNumber(0);   
    records.add(row);
   
    row = new RowRecord();
    row.setRowNumber(1);
    records.add(row);

    records.add(new StringRecord());
   
    row = new RowRecord();
    row.setRowNumber(2);
    records.add(row);
   
   
    Sheet sheet = Sheet.createSheet(records, 0);
    assertNotNull("Row [2] was skipped", sheet.getRow(2));
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

    public RowRecord getRow(int rownum)
    {

        // Integer integer = new Integer(rownum);
        RowRecord row = new RowRecord();

        row.setRowNumber(( short ) rownum);
        return ( RowRecord ) records.get(row);
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.RowRecord

      //For a performance improvement, it would be better to return an instance of
      //an iterator and use that instance throughout, rather than recreating one and
      //having to move it to the right position.
      int startIndex = block * DBCellRecord.BLOCK_SIZE;
      Iterator rowIter = records.values().iterator();
      RowRecord row = null;
      //Position the iterator at the start of the block
      for (int i=0; i<=startIndex;i++) {
        row = (RowRecord)rowIter.next();
      }

      return row.getRowNumber();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.