Examples of EscherRecord


Examples of org.apache.poi.ddf.EscherRecord

            dgg.addCluster( dgId, 0 );
            dgg.setDrawingsSaved(dgg.getDrawingsSaved() + 1);

            EscherDgRecord dg = null;
            for(Iterator<EscherRecord> it = escherContainer.getChildIterator(); it.hasNext();) {
                EscherRecord er = it.next();
                if(er instanceof EscherDgRecord) {
                    dg = (EscherDgRecord)er;
                    //update id of the drawing in the cloned sheet
                    dg.setOptions( (short) ( dgId << 4 ) );
                } else if (er instanceof EscherContainerRecord){
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

            if (count < 1) {
                children.append( "  children: " + nl );
            }
            String newIndent = "   ";

            EscherRecord record = iterator.next();
            children.append(newIndent + "Child " + count + ":" + nl);

             children.append( printEscherRecord(record) );

            count++;
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      r.writeOut(baos);
      byte[] b = baos.toByteArray();

      EscherRecord er = factory.createRecord(b, 0);
      er.fillFields(b, 0, factory);

      System.out.println( printEscherRecord( er ) );

    } else if(optVerbose && r.getChildRecords() == null) {
      String recData = getPrintableRecordContents(r);
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

        while (recordIter.hasNext())
        {
            Object obj = recordIter.next();
            if (obj instanceof EscherRecord)
            {
                EscherRecord escherRecord = (EscherRecord) obj;

                if (escherRecord instanceof EscherBSERecord)
                {
                    EscherBSERecord bse = (EscherBSERecord) escherRecord;
                    EscherBlipRecord blip = bse.getBlipRecord();
                    if (blip != null)
                    {
                        pictures.add(new Picture(blip.getPicturedata()));
                    }
                    else if (bse.getOffset() > 0)
                    {
                        // Blip stored in delay stream, which in a word doc, is the main stream
                        EscherRecordFactory recordFactory = new DefaultEscherRecordFactory();
                        blip = (EscherBlipRecord) recordFactory.createRecord(_mainStream, bse.getOffset());
                        blip.fillFields(_mainStream, bse.getOffset(), recordFactory);
                        pictures.add(new Picture(blip.getPicturedata()));
                    }
                }

                // Recursive call.
                searchForPictures(escherRecord.getChildRecords(), pictures);
            }
        }
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

    StringBuffer result = new StringBuffer();
    result.append( '[' ).append( getRecordName() ).append( ']' + nl );
    for ( Iterator iterator = getEscherRecords().iterator(); iterator.hasNext(); )
    {
      EscherRecord escherRecord = (EscherRecord) iterator.next();
      result.append( escherRecord.toString() );
    }
    result.append( "[/" ).append( getRecordName() ).append( ']' + nl );

    return result.toString();
  }
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

    final List<EscherRecord> shapeRecords = new ArrayList<EscherRecord>();
    EscherRecordFactory recordFactory = new DefaultEscherRecordFactory()
    {
      public EscherRecord createRecord( byte[] data, int offset )
      {
        EscherRecord r = super.createRecord( data, offset );
        if ( r.getRecordId() == EscherClientDataRecord.RECORD_ID || r.getRecordId() == EscherTextboxRecord.RECORD_ID )
        {
          shapeRecords.add( r );
        }
        return r;
      }
    };

    // Calculate the size of the buffer
    EscherAggregate agg = new EscherAggregate(drawingManager);
    int loc = locFirstDrawingRecord;
    int dataSize = 0;
    while ( loc + 1 < records.size()
        && sid( records, loc ) == DrawingRecord.sid
        && isObjectRecord( records, loc + 1 ) )
    {
      dataSize += ( (DrawingRecord) records.get( loc ) ).getData().length;
      loc += 2;
    }

    // Create one big buffer
    byte buffer[] = new byte[dataSize];
    int offset = 0;
    loc = locFirstDrawingRecord;
    while ( loc + 1 < records.size()
        && sid( records, loc ) == DrawingRecord.sid
        && isObjectRecord( records, loc + 1 ) )
    {
      DrawingRecord drawingRecord = (DrawingRecord) records.get( loc );
      System.arraycopy( drawingRecord.getData(), 0, buffer, offset, drawingRecord.getData().length );
      offset += drawingRecord.getData().length;
      loc += 2;
    }

    // Decode the shapes
    //    agg.escherRecords = new ArrayList();
    int pos = 0;
    while ( pos < dataSize )
    {
      EscherRecord r = recordFactory.createRecord( buffer, pos );
      int bytesRead = r.fillFields( buffer, pos, recordFactory );
      agg.addEscherRecord( r );
      pos += bytesRead;
    }

    // Associate the object records with the shapes
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

    final List spEndingOffsets = new ArrayList();
    final List shapes = new ArrayList();
    int pos = 0;
    for ( Iterator iterator = records.iterator(); iterator.hasNext(); )
    {
      EscherRecord e = (EscherRecord) iterator.next();
      pos += e.serialize( pos, buffer, new EscherSerializationListener()
      {
        public void beforeRecordSerialize( int offset, short recordId, EscherRecord record )
        {
        }
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

    //  the first container, with a EscherSRecord too
    EscherContainerRecord patriachContainer =
      (EscherContainerRecord)tcc.get(0);
    EscherSpgrRecord spgr = null;
    for(Iterator<EscherRecord> it = patriachContainer.getChildIterator(); it.hasNext();) {
      EscherRecord r = it.next();
      if(r instanceof EscherSpgrRecord) {
        spgr = (EscherSpgrRecord)r;
        break;
      }
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

    log.log(POILogger.WARN, "Not processing objects into Patriarch!");
  }
 
  private void convertRecordsToUserModel(EscherContainerRecord shapeContainer, Object model) {
    for(Iterator<EscherRecord> it = shapeContainer.getChildIterator(); it.hasNext();) {
      EscherRecord r = it.next();
      if(r instanceof EscherSpgrRecord) {
        // This may be overriden by a later EscherClientAnchorRecord
        EscherSpgrRecord spgr = (EscherSpgrRecord)r;
       
        if(model instanceof HSSFShapeGroup) {
View Full Code Here

Examples of org.apache.poi.ddf.EscherRecord

        convertPatriarch( patriarch );
        EscherContainerRecord dgContainer = (EscherContainerRecord) getEscherRecord( 0 );
        EscherContainerRecord spgrContainer = null;
        Iterator<EscherRecord> iter = dgContainer.getChildIterator();
        while (iter.hasNext()) {
          EscherRecord child = iter.next();
          if (child.getRecordId() == EscherContainerRecord.SPGR_CONTAINER) {
            spgrContainer = (EscherContainerRecord) child;
          }
        }
        convertShapes( patriarch, spgrContainer, shapeToObj );
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.