Examples of EscherSpRecord


Examples of org.apache.poi.ddf.EscherSpRecord

            throws Exception
    {
        DrawingGroupRecord r = new DrawingGroupRecord();
        assertEquals(4, r.getRecordSize());

        EscherSpRecord sp = new EscherSpRecord();
        sp.setRecordId(EscherSpRecord.RECORD_ID);
        sp.setOptions((short) 0x1111);
        sp.setFlags(-1);
        sp.setShapeId(-1);
        EscherContainerRecord dggContainer = new EscherContainerRecord();
        dggContainer.setOptions((short) 0x000F);
        dggContainer.setRecordId((short) 0xF000);
        dggContainer.addChildRecord(sp);
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

        EscherContainerRecord container1 = new EscherContainerRecord();
        EscherContainerRecord spContainer1 = new EscherContainerRecord();
        EscherContainerRecord spContainer2 = new EscherContainerRecord();
        EscherContainerRecord spContainer3 = new EscherContainerRecord();
        EscherSpRecord sp1 = new EscherSpRecord();
        EscherSpRecord sp2 = new EscherSpRecord();
        EscherSpRecord sp3 = new EscherSpRecord();
        EscherClientDataRecord d2 = new EscherClientDataRecord();
        EscherClientDataRecord d3 = new EscherClientDataRecord();

        container1.setOptions( (short) 0x000F );
        spContainer1.setOptions( (short) 0x000F );
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

                    //recursively find shape records and re-generate shapeId
                    List<EscherRecord> spRecords = new ArrayList<EscherRecord>();
                    EscherContainerRecord cp = (EscherContainerRecord)er;
                    cp.getRecordsById(EscherSpRecord.RECORD_ID,  spRecords);
                    for(Iterator<EscherRecord> spIt = spRecords.iterator(); spIt.hasNext();) {
                        EscherSpRecord sp = (EscherSpRecord)spIt.next();
                        int shapeId = drawingManager.allocateShapeId((short)dgId, dg);
                        //allocateShapeId increments the number of shapes. roll back to the previous value
                        dg.setNumShapes(dg.getNumShapes()-1);
                        sp.setShapeId(shapeId);
                    }
                }
            }

        }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

                    //recursively find shape records and re-generate shapeId
                    List<EscherRecord> spRecords = new ArrayList<EscherRecord>();
                    EscherContainerRecord cp = (EscherContainerRecord)er;
                    cp.getRecordsById(EscherSpRecord.RECORD_ID,  spRecords);
                    for(Iterator<EscherRecord> spIt = spRecords.iterator(); spIt.hasNext();) {
                        EscherSpRecord sp = (EscherSpRecord)spIt.next();
                        int shapeId = drawingManager.allocateShapeId((short)dgId, dg);
                        //allocateShapeId increments the number of shapes. roll back to the previous value
                        dg.setNumShapes(dg.getNumShapes()-1);
                        sp.setShapeId(shapeId);
                    }
                }
            }

        }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

    protected EscherContainerRecord createSpContainer(boolean isChild) {
        _escherContainer = new EscherContainerRecord();
        _escherContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
        _escherContainer.setOptions((short)15);

        EscherSpRecord sp = new EscherSpRecord();
        int flags = EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE;
        if (isChild) flags |= EscherSpRecord.FLAG_CHILD;
        sp.setFlags(flags);
        _escherContainer.addChildRecord(sp);

        EscherOptRecord opt = new EscherOptRecord();
        opt.setRecordId(EscherOptRecord.RECORD_ID);
        _escherContainer.addChildRecord(opt);
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

     * Whether the shape is horizontally flipped
     *
     * @return whether the shape is horizontally flipped
     */
     public boolean getFlipHorizontal(){
        EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
        return (spRecord.getFlags()& EscherSpRecord.FLAG_FLIPHORIZ) != 0;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

     * Whether the shape is vertically flipped
     *
     * @return whether the shape is vertically flipped
     */
    public boolean getFlipVertical(){
        EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
        return (spRecord.getFlags()& EscherSpRecord.FLAG_FLIPVERT) != 0;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

        dgg.setDrawingsSaved(dgg.getDrawingsSaved() + 1);
        dgg.setMaxDrawingGroupId(dgId);

        for (Iterator it = dgContainer.getChildContainers().iterator(); it.hasNext(); ) {
            EscherContainerRecord c = (EscherContainerRecord)it.next();
            EscherSpRecord spr = null;
            switch(c.getRecordId()){
                case EscherContainerRecord.SPGR_CONTAINER:
                    EscherContainerRecord dc = (EscherContainerRecord)c.getChild(0);
                    spr = dc.getChildById(EscherSpRecord.RECORD_ID);
                    break;
                case EscherContainerRecord.SP_CONTAINER:
                    spr = c.getChildById(EscherSpRecord.RECORD_ID);
                    break;
            }
            if(spr != null) spr.setShapeId(allocateShapeId());
        }

        //PPT doen't increment the number of saved shapes for group descriptor and background
        dg.setNumShapes(1);
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

  private void convertGroup( HSSFShapeGroup shape, EscherContainerRecord escherParent, Map shapeToObj )
  {
    EscherContainerRecord spgrContainer = new EscherContainerRecord();
    EscherContainerRecord spContainer = new EscherContainerRecord();
    EscherSpgrRecord spgr = new EscherSpgrRecord();
    EscherSpRecord sp = new EscherSpRecord();
    EscherOptRecord opt = new EscherOptRecord();
    EscherRecord anchor;
    EscherClientDataRecord clientData = new EscherClientDataRecord();

    spgrContainer.setRecordId( EscherContainerRecord.SPGR_CONTAINER );
    spgrContainer.setOptions( (short) 0x000F );
    spContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
    spContainer.setOptions( (short) 0x000F );
    spgr.setRecordId( EscherSpgrRecord.RECORD_ID );
    spgr.setOptions( (short) 0x0001 );
    spgr.setRectX1( shape.getX1() );
    spgr.setRectY1( shape.getY1() );
    spgr.setRectX2( shape.getX2() );
    spgr.setRectY2( shape.getY2() );
    sp.setRecordId( EscherSpRecord.RECORD_ID );
    sp.setOptions( (short) 0x0002 );
    int shapeId = drawingManager.allocateShapeId(drawingGroupId);
    sp.setShapeId( shapeId );
    if (shape.getAnchor() instanceof HSSFClientAnchor)
      sp.setFlags( EscherSpRecord.FLAG_GROUP | EscherSpRecord.FLAG_HAVEANCHOR );
    else
      sp.setFlags( EscherSpRecord.FLAG_GROUP | EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_CHILD );
    opt.setRecordId( EscherOptRecord.RECORD_ID );
    opt.setOptions( (short) 0x0023 );
    opt.addEscherProperty( new EscherBoolProperty( EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x00040004 ) );
    opt.addEscherProperty( new EscherBoolProperty( EscherProperties.GROUPSHAPE__PRINT, 0x00080000 ) );
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

    EscherContainerRecord dgContainer = new EscherContainerRecord();
    EscherDgRecord dg;
    EscherContainerRecord spgrContainer = new EscherContainerRecord();
    EscherContainerRecord spContainer1 = new EscherContainerRecord();
    EscherSpgrRecord spgr = new EscherSpgrRecord();
    EscherSpRecord sp1 = new EscherSpRecord();

    dgContainer.setRecordId( EscherContainerRecord.DG_CONTAINER );
    dgContainer.setOptions( (short) 0x000F );
    dg = drawingManager.createDgRecord();
    drawingGroupId = dg.getDrawingGroupId();
//    dg.setOptions( (short) ( drawingId << 4 ) );
//    dg.setNumShapes( getNumberOfShapes( patriarch ) );
//    dg.setLastMSOSPID( 0 );  // populated after all shape id's are assigned.
    spgrContainer.setRecordId( EscherContainerRecord.SPGR_CONTAINER );
    spgrContainer.setOptions( (short) 0x000F );
    spContainer1.setRecordId( EscherContainerRecord.SP_CONTAINER );
    spContainer1.setOptions( (short) 0x000F );
    spgr.setRecordId( EscherSpgrRecord.RECORD_ID );
    spgr.setOptions( (short) 0x0001 )// version
    spgr.setRectX1( patriarch.getX1() );
    spgr.setRectY1( patriarch.getY1() );
    spgr.setRectX2( patriarch.getX2() );
    spgr.setRectY2( patriarch.getY2() );
    sp1.setRecordId( EscherSpRecord.RECORD_ID );
    sp1.setOptions( (short) 0x0002 );
    sp1.setShapeId( drawingManager.allocateShapeId(dg.getDrawingGroupId()) );
    sp1.setFlags( EscherSpRecord.FLAG_GROUP | EscherSpRecord.FLAG_PATRIARCH );

    dgContainer.addChildRecord( dg );
    dgContainer.addChildRecord( spgrContainer );
    spgrContainer.addChildRecord( spContainer1 );
    spContainer1.addChildRecord( spgr );
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.