Package org.apache.poi.ddf

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


        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

        dg.setOptions((short)(dgId << 4));
        dgg.setDrawingsSaved(dgg.getDrawingsSaved() + 1);
        dgg.setMaxDrawingGroupId(dgId);

        for (EscherContainerRecord c : dgContainer.getChildContainers()) {
            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

        EscherSpgrRecord spg = new EscherSpgrRecord();
        spg.setOptions((short)1);
        spcont.addChildRecord(spg);

        EscherSpRecord sp = new EscherSpRecord();
        short type = (ShapeTypes.NotPrimitive << 4) + 2;
        sp.setOptions(type);
        sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_GROUP);
        spcont.addChildRecord(sp);

        EscherClientAnchorRecord anchor = new EscherClientAnchorRecord();
        spcont.addChildRecord(anchor);
View Full Code Here

     *
     * @return type of the shape.
     */
    public int getShapeType(){
        EscherContainerRecord groupInfoContainer = (EscherContainerRecord)_escherContainer.getChild(0);
        EscherSpRecord spRecord = groupInfoContainer.getChildById(EscherSpRecord.RECORD_ID);
        return spRecord.getOptions() >> 4;
    }
View Full Code Here

    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

     * 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

     * 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

            }
            if(_txtrun == null) {
                logger.log(POILogger.WARN, "text run not found for OutlineTextRefAtom.TextIndex=" + idx);
            }
        } else {
            EscherSpRecord escherSpRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
            int shapeId = escherSpRecord.getShapeId();
            if(runs != null) for (int i = 0; i < runs.length; i++) {
                if(runs[i].getShapeId() == shapeId){
                    _txtrun = runs[i];
                    break;
                }
View Full Code Here

                    //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

TOP

Related Classes of org.apache.poi.ddf.EscherSpRecord

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.